Skip to main content
PATCH
/
cloud
/
v1
/
l7policies
/
{project_id}
/
{region_id}
/
{l7policy_id}
Update load balancer L7 policy
curl --request PATCH \
  --url https://api.gcore.com/cloud/v1/l7policies/{project_id}/{region_id}/{l7policy_id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "action": "REDIRECT_TO_URL",
  "redirect_url": "https://www.example.com",
  "name": "redirect-example.com",
  "position": 1,
  "redirect_http_code": 301,
  "tags": [
    "test_tag"
  ]
}
'
{
  "tasks": [
    "d478ae29-dedc-4869-82f0-96104425f565"
  ]
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID

Example:

1

region_id
integer
required

Region ID

Example:

1

l7policy_id
string
required

L7 policy ID

Example:

"023f2e34-7806-443b-bfae-16c324569a3d"

Body

application/json
action
string
required

Action

Allowed value: "REDIRECT_TO_URL"
Example:

"REDIRECT_TO_URL"

redirect_url
string
required

Requests matching this policy will be redirected to this URL. Only valid if action is REDIRECT_TO_URL.

Example:

"https://www.example.com"

name
string

Human-readable name of the policy

Pattern: ^[a-zA-Z0-9][a-zA-Z 0-9._\-]{1,61}[a-zA-Z0-9._]$
Example:

"redirect-example.com"

position
integer

The position of this policy on the listener

Example:

1

redirect_http_code
integer
default:302

Requests matching this policy will be redirected to the specified URL or Prefix URL with the HTTP response code. Valid if action is REDIRECT_TO_URL or REDIRECT_PREFIX. Valid options are 301, 302, 303, 307, or 308. Default is 302.

Examples:

301

302

303

307

308

tags
string[]

A list of simple strings assigned to the resource.

Example:
["test_tag"]

Response

200 - application/json

OK

tasks
string[]
required

List of task IDs representing asynchronous operations. Use these IDs to monitor operation progress:

  • GET /v1/tasks/{task_id} - Check individual task status and details Poll task status until completion (FINISHED/ERROR) before proceeding with dependent operations.
Example:
["d478ae29-dedc-4869-82f0-96104425f565"]