PATCH
/
cloud
/
v1
/
networks
/
{project_id}
/
{region_id}
/
{network_id}
Python
from gcore import Gcore

client = Gcore(
    api_key="My API Key",
)
network = client.cloud.networks.update(
    network_id="b39792c3-3160-4356-912e-ba396c95cdcf",
    project_id=1,
    region_id=1,
)
print(network.id)
{
  "created_at": "2019-06-18T11:56:16+0000",
  "creator_task_id": "fd50fdd1-0482-4c9b-b847-fc9924665af6",
  "default": true,
  "external": true,
  "id": "eed97610-708d-43a5-a9a5-caebd2b7b4ee",
  "mtu": 1500,
  "name": "public",
  "port_security_enabled": true,
  "project_id": 1337,
  "region": "Luxembourg 1",
  "region_id": 7,
  "segmentation_id": 9,
  "shared": false,
  "subnets": [
    "f00624ab-41bc-4d54-a723-1673ce32d997",
    "41e0f698-4d39-483b-b77a-18eb070e4c09"
  ],
  "tags": [
    {
      "key": "my-tag",
      "read_only": false,
      "value": "my-tag-value"
    }
  ],
  "task_id": null,
  "type": "vlan",
  "updated_at": "2019-06-18T11:57:00+0000"
}

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

Examples:

1

region_id
integer
required

Region ID

Examples:

1

network_id
string<uuid4>
required

Network ID

Examples:

"b39792c3-3160-4356-912e-ba396c95cdcf"

Body

application/json
name
string

Name.

Examples:

"some_name"

tags
object | null

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.

Examples:
{
"my-tag": "my-tag-value",
"my-tag-to-remove": null
}

Response

200 - application/json

OK

created_at
string<date-time>
required

Datetime when the network was created

Examples:

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

creator_task_id
string<uuid4> | null
required

Task that created this entity

Examples:

"fd50fdd1-0482-4c9b-b847-fc9924665af6"

default
boolean | null
required

True if network has is_default attribute

Examples:

true

external
boolean
required

True if the network router:external attribute

Examples:

true

id
string<uuid4>
required

Network ID

Examples:

"eed97610-708d-43a5-a9a5-caebd2b7b4ee"

mtu
integer
required

MTU (maximum transmission unit). Default value is 1450

Examples:

1500

name
string
required

Network name

Examples:

"public"

port_security_enabled
boolean
required

Indicates port_security_enabled status of all newly created in the network ports.

Examples:

true

false

project_id
integer | null
required

Project ID

Examples:

1337

region
string
required

Region name

Examples:

"Luxembourg 1"

region_id
integer
required

Region ID

Examples:

7

segmentation_id
integer | null
required

Id of network segment

Examples:

9

shared
boolean
required

True when the network is shared with your project by external owner

Examples:

false

subnets
string<uuid4>[]
required

List of subnetworks

Examples:
[
"f00624ab-41bc-4d54-a723-1673ce32d997",
"41e0f698-4d39-483b-b77a-18eb070e4c09"
]
tags
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.

Examples:
[
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
]
task_id
string<uuid4> | null
required

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.

Examples:

null

type
string
required

Network type (vlan, vxlan)

Examples:

"vlan"

updated_at
string<date-time>
required

Datetime when the network was last updated

Examples:

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