Skip to main content
GET
/
cloud
/
v1
/
volumes
/
{project_id}
/
{region_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
)
page = client.cloud.volumes.list(
    project_id=1,
    region_id=1,
)
page = page.results[0]
print(page.id)
{
  "count": 1,
  "results": [
    {
      "bootable": true,
      "created_at": "2023-11-07T05:31:56Z",
      "id": "<string>",
      "is_root_volume": true,
      "name": "<string>",
      "project_id": 123,
      "region": "<string>",
      "region_id": 123,
      "size": 123,
      "status": "attaching",
      "tags": [
        {
          "key": "<string>",
          "read_only": true,
          "value": "<string>"
        }
      ],
      "volume_type": "<string>",
      "attachments": [
        {
          "attachment_id": "<string>",
          "volume_id": "<string>",
          "attached_at": "2019-07-26T14:22:03+0000",
          "device": "/dev/vda",
          "flavor_id": "g1-standard-1-2",
          "instance_name": "instance-1",
          "server_id": "8dc30d49-bb34-4920-9bbd-03a2587ec0ad"
        }
      ],
      "creator_task_id": "d74c2bb9-cea7-4b23-a009-2f13518ae66d",
      "limiter_stats": {
        "MBps_base_limit": 123,
        "MBps_burst_limit": 123,
        "iops_base_limit": 123,
        "iops_burst_limit": 123
      },
      "snapshot_ids": [
        "<string>"
      ],
      "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"
      }
    }
  ]
}

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

region_id
integer
required

Region ID

Query Parameters

bootable
boolean

Filter by bootable field

cluster_id
string

Filter volumes by k8s cluster ID

has_attachments
boolean

Filter by the presence of attachments

id_part
string

Filter the volume list result by the ID part of the volume

instance_id
string<uuid4>

Filter volumes by instance ID

limit
integer
default:1000

Optional. Limit the number of returned items

Required range: x <= 1000
name_part
string

Filter volumes by name_part inclusion in volume name.Any substring can be used and volumes will be returned with names containing the substring.

offset
integer
default:0

Optional. Offset value is used to exclude the first set of records from the result

Required range: x >= 0
tag_key
string[]

Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2

Tag key. The maximum size for a key is 255 characters.

Required string length: 1 - 255
tag_key_value
string

Optional. Filter by tag key-value pairs.

Response

200 - application/json

OK

count
integer
required

Number of objects

Required range: x >= 0
results
VolumeSerializer · object[]
required

Objects