List flavors matching volume requirements
curl --request POST \
--url https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"volumes": [
{
"apptemplate_id": "<string>",
"boot_index": 123,
"image_id": "<string>",
"name": "<string>",
"size": 2,
"snapshot_id": "<string>",
"volume_id": "<string>"
}
]
}
'import requests
url = "https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors"
payload = { "volumes": [
{
"apptemplate_id": "<string>",
"boot_index": 123,
"image_id": "<string>",
"name": "<string>",
"size": 2,
"snapshot_id": "<string>",
"volume_id": "<string>"
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
volumes: [
{
apptemplate_id: '<string>',
boot_index: 123,
image_id: '<string>',
name: '<string>',
size: 2,
snapshot_id: '<string>',
volume_id: '<string>'
}
]
})
};
fetch('https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors', 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/instances/{project_id}/{region_id}/available_flavors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'volumes' => [
[
'apptemplate_id' => '<string>',
'boot_index' => 123,
'image_id' => '<string>',
'name' => '<string>',
'size' => 2,
'snapshot_id' => '<string>',
'volume_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors"
payload := strings.NewReader("{\n \"volumes\": [\n {\n \"apptemplate_id\": \"<string>\",\n \"boot_index\": 123,\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 2,\n \"snapshot_id\": \"<string>\",\n \"volume_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"volumes\": [\n {\n \"apptemplate_id\": \"<string>\",\n \"boot_index\": 123,\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 2,\n \"snapshot_id\": \"<string>\",\n \"volume_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"volumes\": [\n {\n \"apptemplate_id\": \"<string>\",\n \"boot_index\": 123,\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 2,\n \"snapshot_id\": \"<string>\",\n \"volume_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"results": [
{
"architecture": "x86_64",
"disabled": false,
"flavor_id": "g2-standard-32-64",
"flavor_name": "g2-standard-32-64",
"hardware_description": {},
"os_type": "linux",
"ram": 2048,
"vcpus": 1
}
]
}Instances
List flavors matching volume requirements
List all flavors that are suitable for instance creation based on volume requirements.
When include_prices is specified, the list includes pricing information.
POST
/
cloud
/
v1
/
instances
/
{project_id}
/
{region_id}
/
available_flavors
List flavors matching volume requirements
curl --request POST \
--url https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"volumes": [
{
"apptemplate_id": "<string>",
"boot_index": 123,
"image_id": "<string>",
"name": "<string>",
"size": 2,
"snapshot_id": "<string>",
"volume_id": "<string>"
}
]
}
'import requests
url = "https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors"
payload = { "volumes": [
{
"apptemplate_id": "<string>",
"boot_index": 123,
"image_id": "<string>",
"name": "<string>",
"size": 2,
"snapshot_id": "<string>",
"volume_id": "<string>"
}
] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
volumes: [
{
apptemplate_id: '<string>',
boot_index: 123,
image_id: '<string>',
name: '<string>',
size: 2,
snapshot_id: '<string>',
volume_id: '<string>'
}
]
})
};
fetch('https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors', 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/instances/{project_id}/{region_id}/available_flavors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'volumes' => [
[
'apptemplate_id' => '<string>',
'boot_index' => 123,
'image_id' => '<string>',
'name' => '<string>',
'size' => 2,
'snapshot_id' => '<string>',
'volume_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors"
payload := strings.NewReader("{\n \"volumes\": [\n {\n \"apptemplate_id\": \"<string>\",\n \"boot_index\": 123,\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 2,\n \"snapshot_id\": \"<string>\",\n \"volume_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"volumes\": [\n {\n \"apptemplate_id\": \"<string>\",\n \"boot_index\": 123,\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 2,\n \"snapshot_id\": \"<string>\",\n \"volume_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/available_flavors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"volumes\": [\n {\n \"apptemplate_id\": \"<string>\",\n \"boot_index\": 123,\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"size\": 2,\n \"snapshot_id\": \"<string>\",\n \"volume_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"results": [
{
"architecture": "x86_64",
"disabled": false,
"flavor_id": "g2-standard-32-64",
"flavor_name": "g2-standard-32-64",
"hardware_description": {},
"os_type": "linux",
"ram": 2048,
"vcpus": 1
}
]
}Authorizations
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
Example:
1
Region ID
Example:
1
Query Parameters
Set to true if flavor listing should include flavor prices.
Body
application/json
Volumes details. Non-important info such as names may be omitted.
Show child attributes
Show child attributes
Response
200 - application/json
OK
Number of objects
Required range:
x >= 0Example:
1
results
(Instances flavor schema without price · object | Instances flavor schema with price · object)[]
required
Objects
Instances flavor schema without price information
- Instances flavor schema without price
- Instances flavor schema with price
Show child attributes
Show child attributes
Was this page helpful?
⌘I