PATCH
/
cloud
/
v1
/
volumes
/
{project_id}
/
{region_id}
/
{volume_id}
Python
from gcore import Gcore

client = Gcore(
    api_key="My API Key",
)
volume = client.cloud.volumes.update(
    volume_id="726ecfcc-7fd0-4e30-a86e-7892524aa483",
    project_id=1,
    region_id=1,
)
print(volume.id)
{
  "attachments": [
    {
      "attached_at": "2019-07-26T14:22:03+0000",
      "attachment_id": "f2ed59d9-8068-400c-be4b-c4501ef6f33c",
      "device": "/dev/vda",
      "flavor_id": "g1-standard-1-2",
      "instance_name": "instance-1",
      "server_id": "8dc30d49-bb34-4920-9bbd-03a2587ec0ad",
      "volume_id": "67baa7d1-08ea-4fc5-bef2-6b2465b7d227"
    }
  ],
  "bootable": false,
  "created_at": "2019-05-29T05:32:41+0000",
  "creator_task_id": "d74c2bb9-cea7-4b23-a009-2f13518ae66d",
  "id": "726ecfcc-7fd0-4e30-a86e-7892524aa483",
  "is_root_volume": false,
  "limiter_stats": {
    "MBps_base_limit": 50,
    "MBps_burst_limit": 200,
    "iops_base_limit": 1000,
    "iops_burst_limit": 5000
  },
  "name": "volume-1",
  "project_id": 1,
  "region": "Luxembourg",
  "region_id": 1,
  "size": 50,
  "snapshot_ids": [
    "<string>"
  ],
  "status": "available",
  "tags": [
    {
      "key": "my-tag",
      "read_only": false,
      "value": "my-tag-value"
    }
  ],
  "task_id": "<string>",
  "updated_at": "2019-05-29T05:39:20+0000",
  "volume_image_metadata": {
    "checksum": "ba3cd24377dde5dfdd58728894004abb",
    "container_format": "bare",
    "disk_format": "raw",
    "image_id": "723037e2-ec6d-47eb-92de-6276c8907839",
    "image_name": "cirros-gcloud",
    "min_disk": "1",
    "min_ram": "0",
    "size": "46137344"
  },
  "volume_type": "standard"
}

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

volume_id
string<uuid4>
required

Volume ID

Examples:

"726ecfcc-7fd0-4e30-a86e-7892524aa483"

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

bootable
boolean
required

Indicates whether the volume is bootable.

Examples:

false

created_at
string<date-time>
required

The date and time when the volume was created.

Examples:

"2019-05-29T05:32:41+0000"

id
string
required

The unique identifier of the volume.

Examples:

"726ecfcc-7fd0-4e30-a86e-7892524aa483"

is_root_volume
boolean
required

Indicates whether this is a root volume.

Examples:

false

name
string
required

The name of the volume.

Examples:

"volume-1"

project_id
integer
required

Project ID.

Examples:

1

region
string
required

The region where the volume is located.

Examples:

"Luxembourg"

region_id
integer
required

The identifier of the region.

Examples:

1

size
integer
required

The size of the volume in gibibytes (GiB).

Examples:

50

status
enum<string>
required

The current status of the volume.

Available options:
attaching,
available,
awaiting-transfer,
backing-up,
creating,
deleting,
detaching,
downloading,
error,
error_backing-up,
error_deleting,
error_extending,
error_restoring,
extending,
in-use,
maintenance,
reserved,
restoring-backup,
retyping,
reverting,
uploading
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"
}
]
volume_type
string
required

The type of volume storage.

Examples:

"standard"

attachments
VolumeAttachmentSerializer · object[] | null

List of attachments associated with the volume.

creator_task_id
string | null

The ID of the task that created this volume.

Examples:

"d74c2bb9-cea7-4b23-a009-2f13518ae66d"

limiter_stats
object | null

Quality of Service (QoS) parameters for this volume. Schema representing the Quality of Service (QoS) parameters for a volume.

snapshot_ids
string[] | null

List of snapshot IDs associated with this volume.

task_id
string | 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

The date and time when the volume was last updated.

Examples:

"2019-05-29T05:39:20+0000"

volume_image_metadata
object | null

Image metadata for volumes created from an image.

Examples:
{
"checksum": "ba3cd24377dde5dfdd58728894004abb",
"container_format": "bare",
"disk_format": "raw",
"image_id": "723037e2-ec6d-47eb-92de-6276c8907839",
"image_name": "cirros-gcloud",
"min_disk": "1",
"min_ram": "0",
"size": "46137344"
}