Skip to main content
GET
/
cloud
/
v1
/
volumes
/
{project_id}
/
{region_id}
List volumes
curl --request GET \
  --url https://api.gcore.com/cloud/v1/volumes/{project_id}/{region_id} \
  --header 'Authorization: <api-key>'
import requests

url = "https://api.gcore.com/cloud/v1/volumes/{project_id}/{region_id}"

headers = {"Authorization": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: '<api-key>'}};

fetch('https://api.gcore.com/cloud/v1/volumes/{project_id}/{region_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v1/volumes/{project_id}/{region_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.gcore.com/cloud/v1/volumes/{project_id}/{region_id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.gcore.com/cloud/v1/volumes/{project_id}/{region_id}")
.header("Authorization", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.gcore.com/cloud/v1/volumes/{project_id}/{region_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "count": 1,
  "results": [
    {
      "bootable": false,
      "created_at": "2019-05-29T05:32:41+0000",
      "id": "726ecfcc-7fd0-4e30-a86e-7892524aa483",
      "is_root_volume": false,
      "name": "volume-1",
      "project_id": 1,
      "region": "Luxembourg",
      "region_id": 1,
      "size": 50,
      "tags": [
        {
          "key": "my-tag",
          "read_only": false,
          "value": "my-tag-value"
        }
      ],
      "volume_type": "standard",
      "attachments": [
        {
          "attachment_id": "f2ed59d9-8068-400c-be4b-c4501ef6f33c",
          "volume_id": "67baa7d1-08ea-4fc5-bef2-6b2465b7d227",
          "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": 50,
        "MBps_burst_limit": 200,
        "iops_base_limit": 1000,
        "iops_burst_limit": 5000
      },
      "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

Example:

1

region_id
integer
required

Region ID

Example:

1

Query Parameters

bootable
boolean

Filter by bootable field

Example:

false

cluster_id
string

Filter volumes by k8s cluster ID

Example:

"t12345"

has_attachments
boolean

Filter by the presence of attachments

Example:

true

id_part
string

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

Example:

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

instance_id
string<uuid4>

Filter volumes by instance ID

Example:

"169942e0-9b53-42df-95ef-1a8b6525c2bd"

limit
integer
default:1000

Optional. Limit the number of returned items

Required range: x <= 1000
Example:

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.

Example:

"test"

offset
integer
default:0

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

Required range: x >= 0
Example:

0

tag_key
string[]

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

Tag key. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character. Trailing or leading whitespaces will be stripped.

Required string length: 1 - 255
Pattern: ^[^\s=]+$
Example:
["key1", "key2"]
tag_key_value
string

Optional. Filter by tag key-value pairs.

Example:
{ "key": "value" }

Response

200 - application/json

OK

count
integer
required

Number of objects

Required range: x >= 0
Example:

1

results
VolumeSerializer · object[]
required

Objects