Skip to main content
PATCH
/
cloud
/
v1
/
loadbalancers
/
{project_id}
/
{region_id}
/
{load_balancer_id}
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
load_balancer = client.cloud.load_balancers.update(
    load_balancer_id="ac307687-31a4-4a11-a949-6bea1b2878f5",
    project_id=1,
    region_id=7,
)
print(load_balancer.id)
{
  "admin_state_up": true,
  "created_at": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "name": "<string>",
  "operating_status": "DEGRADED",
  "project_id": 123,
  "provisioning_status": "ACTIVE",
  "region": "<string>",
  "region_id": 123,
  "tags_v2": [
    {
      "key": "<string>",
      "read_only": true,
      "value": "<string>"
    }
  ],
  "additional_vips": [
    {
      "ip_address": "<string>",
      "subnet_id": "<string>"
    }
  ],
  "creator_task_id": "9f3ec11e-bcd4-4fe6-924a-a4439a56ad22",
  "ddos_profile": {
    "fields": [
      {
        "base_field": 10,
        "default": null,
        "description": "ARK server ports. Valid port values are in range 1000-65535",
        "field_type": null,
        "field_value": [
          45046,
          45047
        ],
        "id": 11,
        "name": "ARK Ports",
        "required": true,
        "validation_schema": {
          "items": {
            "maximum": 65535,
            "minimum": 1000,
            "type": "integer"
          },
          "minItems": 1,
          "type": "array"
        },
        "value": null
      }
    ],
    "id": 0,
    "options": {
      "active": true,
      "bgp": true
    },
    "profile_template": {
      "description": "test client profile template",
      "fields": [
        {
          "default": null,
          "description": "ARK server ports. Valid port values are in range 1000-65535",
          "field_type": null,
          "id": 11,
          "name": "ARK Ports",
          "required": true,
          "validation_schema": {
            "items": {
              "maximum": 65535,
              "minimum": 1000,
              "type": "integer"
            },
            "minItems": 1,
            "type": "array"
          }
        }
      ],
      "id": 0,
      "name": "test_client_profile_template"
    },
    "profile_template_description": "ARK server ports. Valid port values are in range 1000-65535",
    "protocols": [
      {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      }
    ],
    "site": "ED",
    "status": {
      "error_description": "",
      "status": "Updated"
    }
  },
  "flavor": {
    "flavor_id": "1d276f53-2834-4855-9859-aa922f073055",
    "flavor_name": "lb1-1-2",
    "ram": 2048,
    "vcpus": 1
  },
  "floating_ips": [
    {
      "created_at": "2023-11-07T05:31:56Z",
      "creator_task_id": "d1e1500b-e2be-40aa-9a4b-cc493fa1af30",
      "fixed_ip_address": "192.168.10.15",
      "floating_ip_address": "172.24.4.34",
      "id": "<string>",
      "port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
      "project_id": 123,
      "region": "<string>",
      "region_id": 123,
      "router_id": "11005a33-c5ac-4c96-ab6f-8f2827cc7da6",
      "status": "ACTIVE",
      "tags": [
        {
          "key": "<string>",
          "read_only": true,
          "value": "<string>"
        }
      ],
      "task_id": "a4eb4b29-048e-42f6-a5e1-2c18bc001c45",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ],
  "listeners": [
    {
      "id": "<string>"
    }
  ],
  "logging": {
    "destination_region_id": 1,
    "enabled": true,
    "retention_policy": {
      "period": 45
    },
    "topic_name": "my-log-name"
  },
  "preferred_connectivity": "L2",
  "stats": {
    "active_connections": 0,
    "bytes_in": 34942398609,
    "bytes_out": 304777113641,
    "request_errors": 4,
    "total_connections": 21095970
  },
  "task_id": "<string>",
  "updated_at": "2019-06-18T11:57:00+0000",
  "vip_address": "5.5.5.5",
  "vip_ip_family": "ipv4",
  "vip_port_id": "4177d1ef-f1c2-4e45-a531-3e05dfa6d848",
  "vrrp_ips": [
    {
      "ip_address": "<string>",
      "role": "BACKUP",
      "subnet_id": "<string>"
    }
  ]
}

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:

7

load_balancer_id
string<uuid4>
required

Load-Balancer ID

Example:

"ac307687-31a4-4a11-a949-6bea1b2878f5"

Body

application/json
logging
LoadbalancerLoggingSerializer · object

Logging configuration

name
string

Name.

Example:

"some_name"

preferred_connectivity
enum<string>

Preferred option to establish connectivity between load balancer and its pools members

Available options:
L2,
L3
Example:
["L2", "L3"]
tags
UpdateTagsSerializer · object

Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide key-value pairs to add or update tags. Set tag values to null to remove tags. Unspecified tags remain unchanged. Read-only tags are always preserved and cannot be modified.

Examples:

  • Add/update tags: {'tags': {'environment': 'production', 'team': 'backend'}} adds new tags or updates existing ones.
  • Delete tags: {'tags': {'old_tag': null}} removes specific tags.
  • Remove all tags: {'tags': null} removes all user-managed tags (read-only tags are preserved).
  • Partial update: {'tags': {'environment': 'staging'}} only updates specified tags.
  • Mixed operations: {'tags': {'environment': 'production', 'cost_center': 'engineering', 'deprecated_tag': null}} adds/updates 'environment' and 'cost_center' while removing 'deprecated_tag', preserving other existing tags.
  • Replace all: first delete existing tags with null values, then add new ones in the same request.
Example:
{
"my-tag": "my-tag-value",
"my-tag-to-remove": null
}

Response

200 - application/json

OK

admin_state_up
boolean
required

Administrative state of the resource. When set to true, the resource is enabled and operational. When set to false, the resource is disabled and will not process traffic. Defaults to true.

Examples:

true

false

created_at
string<date-time>
required

Datetime when the load balancer was created

Example:

"2019-06-18T11:56:16+0000"

id
string<uuid4>
required

Load balancer ID

Example:

"e8ab1be4-1521-4266-be69-28dad4148a30"

name
string
required

Load balancer name

Example:

"lbaas_test_lb"

operating_status
enum<string>
required

Load balancer operating status

Available options:
DEGRADED,
DRAINING,
ERROR,
NO_MONITOR,
OFFLINE,
ONLINE
project_id
integer
required

Project ID

Example:

1337

provisioning_status
enum<string>
required

Load balancer lifecycle status

Available options:
ACTIVE,
DELETED,
ERROR,
PENDING_CREATE,
PENDING_DELETE,
PENDING_UPDATE
region
string
required

Region name

Example:

"Luxembourg 1"

region_id
integer
required

Region ID

Example:

7

tags_v2
TagSerializer · object[]
required

List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.

Example:
[
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
]
additional_vips
NetworkPortFixedIp · object[]

List of additional IP addresses

creator_task_id
string<uuid4> | null

Task that created this entity

Example:

"9f3ec11e-bcd4-4fe6-924a-a4439a56ad22"

ddos_profile
GetClientProfileSerializer · object

Loadbalancer advanced DDoS protection profile.

Example:
{
"fields": [
{
"base_field": 10,
"default": null,
"description": "ARK server ports. Valid port values are in range 1000-65535",
"field_type": null,
"field_value": [45046, 45047],
"id": 11,
"name": "ARK Ports",
"required": true,
"validation_schema": {
"items": {
"maximum": 65535,
"minimum": 1000,
"type": "integer"
},
"minItems": 1,
"type": "array"
},
"value": null
}
],
"id": 0,
"options": { "active": true, "bgp": true },
"profile_template": {
"description": "test client profile template",
"fields": [
{
"default": null,
"description": "ARK server ports. Valid port values are in range 1000-65535",
"field_type": null,
"id": 11,
"name": "ARK Ports",
"required": true,
"validation_schema": {
"items": {
"maximum": 65535,
"minimum": 1000,
"type": "integer"
},
"minItems": 1,
"type": "array"
}
}
],
"id": 0,
"name": "test_client_profile_template"
},
"profile_template_description": "ARK server ports. Valid port values are in range 1000-65535",
"protocols": [
{
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
],
"site": "ED",
"status": {
"error_description": "",
"status": "Updated"
}
}
flavor
LbFlavorSerializer · object

Load balancer flavor (if not default)

Example:
{
"flavor_id": "1d276f53-2834-4855-9859-aa922f073055",
"flavor_name": "lb1-1-2",
"ram": 2048,
"vcpus": 1
}
floating_ips
FloatingIPSerializer · object[]

List of assigned floating IPs

listeners
ListenerSerializer · object[]

Load balancer listeners

logging
LoggingOutSerializer · object

Logging configuration

Example:
{
"destination_region_id": 1,
"enabled": true,
"retention_policy": { "period": 45 },
"topic_name": "my-log-name"
}
preferred_connectivity
enum<string>
default:L2

Preferred option to establish connectivity between load balancer and its pools members

Available options:
L2,
L3
Examples:

"L2"

"L3"

stats
LoadbalancerStatsSerializer · object

Statistics of load balancer.

Example:
{
"active_connections": 0,
"bytes_in": 34942398609,
"bytes_out": 304777113641,
"request_errors": 4,
"total_connections": 21095970
}
task_id
string<uuid4> | null

The UUID of the active task that currently holds a lock on the resource. This lock prevents concurrent modifications to ensure consistency. If null, the resource is not locked.

updated_at
string<date-time> | null

Datetime when the load balancer was last updated

Example:

"2019-06-18T11:57:00+0000"

vip_address
string<ipvanyaddress> | null

Load balancer IP address

Example:

"5.5.5.5"

vip_ip_family
enum<string> | null

Load balancer IP family

Available options:
dual,
ipv4,
ipv6
Example:

"ipv4"

vip_port_id
string<uuid4> | null

The ID of the Virtual IP (VIP) port.

Example:

"4177d1ef-f1c2-4e45-a531-3e05dfa6d848"

vrrp_ips
VRRPIP · object[]

List of VRRP IP addresses