Check instance quota
curl --request POST \
--url https://api.gcore.com/cloud/v2/instances/{project_id}/{region_id}/check_limits \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"flavor": "g1-standard-1-2",
"interfaces": [
{
"type": "subnet",
"floating_ip": {
"existing_floating_id": "c64e5db1-5f1f-43ec-a8d9-5090df85b82d",
"source": "existing"
},
"network_id": "ddc28e44-2acb-499b-985b-831f29432e1c",
"port_id": "ff83e13a-b256-4be2-ba5d-028d3f0ab450",
"subnet_id": "2731a56e-a5c9-44be-80c2-02c57c594573"
}
],
"name_templates": [
"<string>"
],
"names": [
"<string>"
],
"volumes": [
{
"size": 1000,
"source": "new-volume",
"type_name": "standard"
}
]
}
'import requests
url = "https://api.gcore.com/cloud/v2/instances/{project_id}/{region_id}/check_limits"
payload = {
"flavor": "g1-standard-1-2",
"interfaces": [
{
"type": "subnet",
"floating_ip": {
"existing_floating_id": "c64e5db1-5f1f-43ec-a8d9-5090df85b82d",
"source": "existing"
},
"network_id": "ddc28e44-2acb-499b-985b-831f29432e1c",
"port_id": "ff83e13a-b256-4be2-ba5d-028d3f0ab450",
"subnet_id": "2731a56e-a5c9-44be-80c2-02c57c594573"
}
],
"name_templates": ["<string>"],
"names": ["<string>"],
"volumes": [
{
"size": 1000,
"source": "new-volume",
"type_name": "standard"
}
]
}
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({
flavor: 'g1-standard-1-2',
interfaces: [
{
type: 'subnet',
floating_ip: {
existing_floating_id: 'c64e5db1-5f1f-43ec-a8d9-5090df85b82d',
source: 'existing'
},
network_id: 'ddc28e44-2acb-499b-985b-831f29432e1c',
port_id: 'ff83e13a-b256-4be2-ba5d-028d3f0ab450',
subnet_id: '2731a56e-a5c9-44be-80c2-02c57c594573'
}
],
name_templates: ['<string>'],
names: ['<string>'],
volumes: [{size: 1000, source: 'new-volume', type_name: 'standard'}]
})
};
fetch('https://api.gcore.com/cloud/v2/instances/{project_id}/{region_id}/check_limits', 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/v2/instances/{project_id}/{region_id}/check_limits",
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([
'flavor' => 'g1-standard-1-2',
'interfaces' => [
[
'type' => 'subnet',
'floating_ip' => [
'existing_floating_id' => 'c64e5db1-5f1f-43ec-a8d9-5090df85b82d',
'source' => 'existing'
],
'network_id' => 'ddc28e44-2acb-499b-985b-831f29432e1c',
'port_id' => 'ff83e13a-b256-4be2-ba5d-028d3f0ab450',
'subnet_id' => '2731a56e-a5c9-44be-80c2-02c57c594573'
]
],
'name_templates' => [
'<string>'
],
'names' => [
'<string>'
],
'volumes' => [
[
'size' => 1000,
'source' => 'new-volume',
'type_name' => 'standard'
]
]
]),
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/v2/instances/{project_id}/{region_id}/check_limits"
payload := strings.NewReader("{\n \"flavor\": \"g1-standard-1-2\",\n \"interfaces\": [\n {\n \"type\": \"subnet\",\n \"floating_ip\": {\n \"existing_floating_id\": \"c64e5db1-5f1f-43ec-a8d9-5090df85b82d\",\n \"source\": \"existing\"\n },\n \"network_id\": \"ddc28e44-2acb-499b-985b-831f29432e1c\",\n \"port_id\": \"ff83e13a-b256-4be2-ba5d-028d3f0ab450\",\n \"subnet_id\": \"2731a56e-a5c9-44be-80c2-02c57c594573\"\n }\n ],\n \"name_templates\": [\n \"<string>\"\n ],\n \"names\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"size\": 1000,\n \"source\": \"new-volume\",\n \"type_name\": \"standard\"\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/v2/instances/{project_id}/{region_id}/check_limits")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flavor\": \"g1-standard-1-2\",\n \"interfaces\": [\n {\n \"type\": \"subnet\",\n \"floating_ip\": {\n \"existing_floating_id\": \"c64e5db1-5f1f-43ec-a8d9-5090df85b82d\",\n \"source\": \"existing\"\n },\n \"network_id\": \"ddc28e44-2acb-499b-985b-831f29432e1c\",\n \"port_id\": \"ff83e13a-b256-4be2-ba5d-028d3f0ab450\",\n \"subnet_id\": \"2731a56e-a5c9-44be-80c2-02c57c594573\"\n }\n ],\n \"name_templates\": [\n \"<string>\"\n ],\n \"names\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"size\": 1000,\n \"source\": \"new-volume\",\n \"type_name\": \"standard\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v2/instances/{project_id}/{region_id}/check_limits")
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 \"flavor\": \"g1-standard-1-2\",\n \"interfaces\": [\n {\n \"type\": \"subnet\",\n \"floating_ip\": {\n \"existing_floating_id\": \"c64e5db1-5f1f-43ec-a8d9-5090df85b82d\",\n \"source\": \"existing\"\n },\n \"network_id\": \"ddc28e44-2acb-499b-985b-831f29432e1c\",\n \"port_id\": \"ff83e13a-b256-4be2-ba5d-028d3f0ab450\",\n \"subnet_id\": \"2731a56e-a5c9-44be-80c2-02c57c594573\"\n }\n ],\n \"name_templates\": [\n \"<string>\"\n ],\n \"names\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"size\": 1000,\n \"source\": \"new-volume\",\n \"type_name\": \"standard\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"baremetal_basic_count_limit": 0,
"baremetal_basic_count_requested": 1,
"baremetal_basic_count_usage": 0,
"baremetal_gpu_a100_count_limit": 0,
"baremetal_gpu_a100_count_requested": 1,
"baremetal_gpu_a100_count_usage": 0,
"baremetal_gpu_b200_count_limit": 0,
"baremetal_gpu_b200_count_requested": 1,
"baremetal_gpu_b200_count_usage": 0,
"baremetal_gpu_h100_count_limit": 0,
"baremetal_gpu_h100_count_requested": 1,
"baremetal_gpu_h100_count_usage": 0,
"baremetal_gpu_h200_count_limit": 0,
"baremetal_gpu_h200_count_requested": 1,
"baremetal_gpu_h200_count_usage": 0,
"baremetal_gpu_l40s_count_limit": 0,
"baremetal_gpu_l40s_count_requested": 1,
"baremetal_gpu_l40s_count_usage": 0,
"baremetal_hf_count_limit": 0,
"baremetal_hf_count_requested": 1,
"baremetal_hf_count_usage": 0,
"baremetal_infrastructure_count_limit": 0,
"baremetal_infrastructure_count_requested": 1,
"baremetal_infrastructure_count_usage": 0,
"baremetal_network_count_limit": 0,
"baremetal_network_count_requested": 1,
"baremetal_network_count_usage": 0,
"baremetal_storage_count_limit": 0,
"baremetal_storage_count_requested": 1,
"baremetal_storage_count_usage": 0,
"caas_container_count_limit": 0,
"caas_container_count_requested": 1,
"caas_container_count_usage": 0,
"caas_cpu_count_limit": 0,
"caas_cpu_count_requested": 1,
"caas_cpu_count_usage": 0,
"caas_gpu_count_limit": 0,
"caas_gpu_count_requested": 1,
"caas_gpu_count_usage": 0,
"caas_ram_size_limit": 0,
"caas_ram_size_requested": 1,
"caas_ram_size_usage": 0,
"cluster_count_limit": 0,
"cluster_count_requested": 1,
"cluster_count_usage": 0,
"cpu_count_limit": 0,
"cpu_count_requested": 1,
"cpu_count_usage": 0,
"dbaas_postgres_cluster_count_limit": 0,
"dbaas_postgres_cluster_count_requested": 1,
"dbaas_postgres_cluster_count_usage": 0,
"external_ip_count_limit": 0,
"external_ip_count_requested": 1,
"external_ip_count_usage": 0,
"faas_cpu_count_limit": 0,
"faas_cpu_count_requested": 1,
"faas_cpu_count_usage": 0,
"faas_function_count_limit": 0,
"faas_function_count_requested": 1,
"faas_function_count_usage": 0,
"faas_namespace_count_limit": 0,
"faas_namespace_count_requested": 1,
"faas_namespace_count_usage": 0,
"faas_ram_size_limit": 0,
"faas_ram_size_requested": 1,
"faas_ram_size_usage": 0,
"firewall_count_limit": 0,
"firewall_count_requested": 1,
"firewall_count_usage": 0,
"floating_count_limit": 0,
"floating_count_requested": 1,
"floating_count_usage": 0,
"gpu_count_limit": 0,
"gpu_count_requested": 1,
"gpu_count_usage": 0,
"gpu_virtual_a100_count_limit": 0,
"gpu_virtual_a100_count_requested": 1,
"gpu_virtual_a100_count_usage": 0,
"gpu_virtual_h100_count_limit": 0,
"gpu_virtual_h100_count_requested": 1,
"gpu_virtual_h100_count_usage": 0,
"gpu_virtual_h200_count_limit": 0,
"gpu_virtual_h200_count_requested": 1,
"gpu_virtual_h200_count_usage": 0,
"gpu_virtual_l40s_count_limit": 0,
"gpu_virtual_l40s_count_requested": 1,
"gpu_virtual_l40s_count_usage": 0,
"image_count_limit": 0,
"image_count_requested": 1,
"image_count_usage": 0,
"image_size_limit": 0,
"image_size_requested": 1,
"image_size_usage": 0,
"ipu_count_limit": 0,
"ipu_count_requested": 1,
"ipu_count_usage": 0,
"laas_topic_count_limit": 0,
"laas_topic_count_requested": 1,
"laas_topic_count_usage": 0,
"loadbalancer_count_limit": 0,
"loadbalancer_count_requested": 1,
"loadbalancer_count_usage": 0,
"network_count_limit": 0,
"network_count_requested": 1,
"network_count_usage": 0,
"ram_limit": 0,
"ram_requested": 1,
"ram_usage": 0,
"registry_count_limit": 0,
"registry_count_requested": 1,
"registry_count_usage": 0,
"registry_storage_limit": 0,
"registry_storage_requested": 1,
"registry_storage_usage": 0,
"router_count_limit": 0,
"router_count_requested": 1,
"router_count_usage": 0,
"secret_count_limit": 0,
"secret_count_requested": 1,
"secret_count_usage": 0,
"servergroup_count_limit": 0,
"servergroup_count_requested": 1,
"servergroup_count_usage": 0,
"sfs_count_limit": 0,
"sfs_count_requested": 1,
"sfs_count_usage": 0,
"sfs_size_limit": 0,
"sfs_size_requested": 1,
"sfs_size_usage": 0,
"shared_vm_count_limit": 0,
"shared_vm_count_requested": 1,
"shared_vm_count_usage": 0,
"slurm_cluster_count_limit": 0,
"slurm_cluster_count_requested": 1,
"slurm_cluster_count_usage": 0,
"snapshot_schedule_count_limit": 0,
"snapshot_schedule_count_requested": 1,
"snapshot_schedule_count_usage": 0,
"subnet_count_limit": 0,
"subnet_count_requested": 1,
"subnet_count_usage": 0,
"vm_count_limit": 0,
"vm_count_requested": 1,
"vm_count_usage": 0,
"volume_count_limit": 0,
"volume_count_requested": 1,
"volume_count_usage": 0,
"volume_size_limit": 0,
"volume_size_requested": 1,
"volume_size_usage": 0,
"volume_snapshots_count_limit": 0,
"volume_snapshots_count_requested": 1,
"volume_snapshots_count_usage": 0,
"volume_snapshots_size_limit": 0,
"volume_snapshots_size_requested": 1,
"volume_snapshots_size_usage": 0
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}Instances
Check instance quota
Use POST /v1/projects//instances with ?dry_run=true instead. This route continues to work. Later, we will deprecate it and then remove it. We will tell you in advance.
Check if regional quota is exceeded for instance creation. If exceeded, calculate additional quotas needed.
POST
/
cloud
/
v2
/
instances
/
{project_id}
/
{region_id}
/
check_limits
Check instance quota
curl --request POST \
--url https://api.gcore.com/cloud/v2/instances/{project_id}/{region_id}/check_limits \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"flavor": "g1-standard-1-2",
"interfaces": [
{
"type": "subnet",
"floating_ip": {
"existing_floating_id": "c64e5db1-5f1f-43ec-a8d9-5090df85b82d",
"source": "existing"
},
"network_id": "ddc28e44-2acb-499b-985b-831f29432e1c",
"port_id": "ff83e13a-b256-4be2-ba5d-028d3f0ab450",
"subnet_id": "2731a56e-a5c9-44be-80c2-02c57c594573"
}
],
"name_templates": [
"<string>"
],
"names": [
"<string>"
],
"volumes": [
{
"size": 1000,
"source": "new-volume",
"type_name": "standard"
}
]
}
'import requests
url = "https://api.gcore.com/cloud/v2/instances/{project_id}/{region_id}/check_limits"
payload = {
"flavor": "g1-standard-1-2",
"interfaces": [
{
"type": "subnet",
"floating_ip": {
"existing_floating_id": "c64e5db1-5f1f-43ec-a8d9-5090df85b82d",
"source": "existing"
},
"network_id": "ddc28e44-2acb-499b-985b-831f29432e1c",
"port_id": "ff83e13a-b256-4be2-ba5d-028d3f0ab450",
"subnet_id": "2731a56e-a5c9-44be-80c2-02c57c594573"
}
],
"name_templates": ["<string>"],
"names": ["<string>"],
"volumes": [
{
"size": 1000,
"source": "new-volume",
"type_name": "standard"
}
]
}
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({
flavor: 'g1-standard-1-2',
interfaces: [
{
type: 'subnet',
floating_ip: {
existing_floating_id: 'c64e5db1-5f1f-43ec-a8d9-5090df85b82d',
source: 'existing'
},
network_id: 'ddc28e44-2acb-499b-985b-831f29432e1c',
port_id: 'ff83e13a-b256-4be2-ba5d-028d3f0ab450',
subnet_id: '2731a56e-a5c9-44be-80c2-02c57c594573'
}
],
name_templates: ['<string>'],
names: ['<string>'],
volumes: [{size: 1000, source: 'new-volume', type_name: 'standard'}]
})
};
fetch('https://api.gcore.com/cloud/v2/instances/{project_id}/{region_id}/check_limits', 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/v2/instances/{project_id}/{region_id}/check_limits",
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([
'flavor' => 'g1-standard-1-2',
'interfaces' => [
[
'type' => 'subnet',
'floating_ip' => [
'existing_floating_id' => 'c64e5db1-5f1f-43ec-a8d9-5090df85b82d',
'source' => 'existing'
],
'network_id' => 'ddc28e44-2acb-499b-985b-831f29432e1c',
'port_id' => 'ff83e13a-b256-4be2-ba5d-028d3f0ab450',
'subnet_id' => '2731a56e-a5c9-44be-80c2-02c57c594573'
]
],
'name_templates' => [
'<string>'
],
'names' => [
'<string>'
],
'volumes' => [
[
'size' => 1000,
'source' => 'new-volume',
'type_name' => 'standard'
]
]
]),
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/v2/instances/{project_id}/{region_id}/check_limits"
payload := strings.NewReader("{\n \"flavor\": \"g1-standard-1-2\",\n \"interfaces\": [\n {\n \"type\": \"subnet\",\n \"floating_ip\": {\n \"existing_floating_id\": \"c64e5db1-5f1f-43ec-a8d9-5090df85b82d\",\n \"source\": \"existing\"\n },\n \"network_id\": \"ddc28e44-2acb-499b-985b-831f29432e1c\",\n \"port_id\": \"ff83e13a-b256-4be2-ba5d-028d3f0ab450\",\n \"subnet_id\": \"2731a56e-a5c9-44be-80c2-02c57c594573\"\n }\n ],\n \"name_templates\": [\n \"<string>\"\n ],\n \"names\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"size\": 1000,\n \"source\": \"new-volume\",\n \"type_name\": \"standard\"\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/v2/instances/{project_id}/{region_id}/check_limits")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flavor\": \"g1-standard-1-2\",\n \"interfaces\": [\n {\n \"type\": \"subnet\",\n \"floating_ip\": {\n \"existing_floating_id\": \"c64e5db1-5f1f-43ec-a8d9-5090df85b82d\",\n \"source\": \"existing\"\n },\n \"network_id\": \"ddc28e44-2acb-499b-985b-831f29432e1c\",\n \"port_id\": \"ff83e13a-b256-4be2-ba5d-028d3f0ab450\",\n \"subnet_id\": \"2731a56e-a5c9-44be-80c2-02c57c594573\"\n }\n ],\n \"name_templates\": [\n \"<string>\"\n ],\n \"names\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"size\": 1000,\n \"source\": \"new-volume\",\n \"type_name\": \"standard\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v2/instances/{project_id}/{region_id}/check_limits")
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 \"flavor\": \"g1-standard-1-2\",\n \"interfaces\": [\n {\n \"type\": \"subnet\",\n \"floating_ip\": {\n \"existing_floating_id\": \"c64e5db1-5f1f-43ec-a8d9-5090df85b82d\",\n \"source\": \"existing\"\n },\n \"network_id\": \"ddc28e44-2acb-499b-985b-831f29432e1c\",\n \"port_id\": \"ff83e13a-b256-4be2-ba5d-028d3f0ab450\",\n \"subnet_id\": \"2731a56e-a5c9-44be-80c2-02c57c594573\"\n }\n ],\n \"name_templates\": [\n \"<string>\"\n ],\n \"names\": [\n \"<string>\"\n ],\n \"volumes\": [\n {\n \"size\": 1000,\n \"source\": \"new-volume\",\n \"type_name\": \"standard\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"baremetal_basic_count_limit": 0,
"baremetal_basic_count_requested": 1,
"baremetal_basic_count_usage": 0,
"baremetal_gpu_a100_count_limit": 0,
"baremetal_gpu_a100_count_requested": 1,
"baremetal_gpu_a100_count_usage": 0,
"baremetal_gpu_b200_count_limit": 0,
"baremetal_gpu_b200_count_requested": 1,
"baremetal_gpu_b200_count_usage": 0,
"baremetal_gpu_h100_count_limit": 0,
"baremetal_gpu_h100_count_requested": 1,
"baremetal_gpu_h100_count_usage": 0,
"baremetal_gpu_h200_count_limit": 0,
"baremetal_gpu_h200_count_requested": 1,
"baremetal_gpu_h200_count_usage": 0,
"baremetal_gpu_l40s_count_limit": 0,
"baremetal_gpu_l40s_count_requested": 1,
"baremetal_gpu_l40s_count_usage": 0,
"baremetal_hf_count_limit": 0,
"baremetal_hf_count_requested": 1,
"baremetal_hf_count_usage": 0,
"baremetal_infrastructure_count_limit": 0,
"baremetal_infrastructure_count_requested": 1,
"baremetal_infrastructure_count_usage": 0,
"baremetal_network_count_limit": 0,
"baremetal_network_count_requested": 1,
"baremetal_network_count_usage": 0,
"baremetal_storage_count_limit": 0,
"baremetal_storage_count_requested": 1,
"baremetal_storage_count_usage": 0,
"caas_container_count_limit": 0,
"caas_container_count_requested": 1,
"caas_container_count_usage": 0,
"caas_cpu_count_limit": 0,
"caas_cpu_count_requested": 1,
"caas_cpu_count_usage": 0,
"caas_gpu_count_limit": 0,
"caas_gpu_count_requested": 1,
"caas_gpu_count_usage": 0,
"caas_ram_size_limit": 0,
"caas_ram_size_requested": 1,
"caas_ram_size_usage": 0,
"cluster_count_limit": 0,
"cluster_count_requested": 1,
"cluster_count_usage": 0,
"cpu_count_limit": 0,
"cpu_count_requested": 1,
"cpu_count_usage": 0,
"dbaas_postgres_cluster_count_limit": 0,
"dbaas_postgres_cluster_count_requested": 1,
"dbaas_postgres_cluster_count_usage": 0,
"external_ip_count_limit": 0,
"external_ip_count_requested": 1,
"external_ip_count_usage": 0,
"faas_cpu_count_limit": 0,
"faas_cpu_count_requested": 1,
"faas_cpu_count_usage": 0,
"faas_function_count_limit": 0,
"faas_function_count_requested": 1,
"faas_function_count_usage": 0,
"faas_namespace_count_limit": 0,
"faas_namespace_count_requested": 1,
"faas_namespace_count_usage": 0,
"faas_ram_size_limit": 0,
"faas_ram_size_requested": 1,
"faas_ram_size_usage": 0,
"firewall_count_limit": 0,
"firewall_count_requested": 1,
"firewall_count_usage": 0,
"floating_count_limit": 0,
"floating_count_requested": 1,
"floating_count_usage": 0,
"gpu_count_limit": 0,
"gpu_count_requested": 1,
"gpu_count_usage": 0,
"gpu_virtual_a100_count_limit": 0,
"gpu_virtual_a100_count_requested": 1,
"gpu_virtual_a100_count_usage": 0,
"gpu_virtual_h100_count_limit": 0,
"gpu_virtual_h100_count_requested": 1,
"gpu_virtual_h100_count_usage": 0,
"gpu_virtual_h200_count_limit": 0,
"gpu_virtual_h200_count_requested": 1,
"gpu_virtual_h200_count_usage": 0,
"gpu_virtual_l40s_count_limit": 0,
"gpu_virtual_l40s_count_requested": 1,
"gpu_virtual_l40s_count_usage": 0,
"image_count_limit": 0,
"image_count_requested": 1,
"image_count_usage": 0,
"image_size_limit": 0,
"image_size_requested": 1,
"image_size_usage": 0,
"ipu_count_limit": 0,
"ipu_count_requested": 1,
"ipu_count_usage": 0,
"laas_topic_count_limit": 0,
"laas_topic_count_requested": 1,
"laas_topic_count_usage": 0,
"loadbalancer_count_limit": 0,
"loadbalancer_count_requested": 1,
"loadbalancer_count_usage": 0,
"network_count_limit": 0,
"network_count_requested": 1,
"network_count_usage": 0,
"ram_limit": 0,
"ram_requested": 1,
"ram_usage": 0,
"registry_count_limit": 0,
"registry_count_requested": 1,
"registry_count_usage": 0,
"registry_storage_limit": 0,
"registry_storage_requested": 1,
"registry_storage_usage": 0,
"router_count_limit": 0,
"router_count_requested": 1,
"router_count_usage": 0,
"secret_count_limit": 0,
"secret_count_requested": 1,
"secret_count_usage": 0,
"servergroup_count_limit": 0,
"servergroup_count_requested": 1,
"servergroup_count_usage": 0,
"sfs_count_limit": 0,
"sfs_count_requested": 1,
"sfs_count_usage": 0,
"sfs_size_limit": 0,
"sfs_size_requested": 1,
"sfs_size_usage": 0,
"shared_vm_count_limit": 0,
"shared_vm_count_requested": 1,
"shared_vm_count_usage": 0,
"slurm_cluster_count_limit": 0,
"slurm_cluster_count_requested": 1,
"slurm_cluster_count_usage": 0,
"snapshot_schedule_count_limit": 0,
"snapshot_schedule_count_requested": 1,
"snapshot_schedule_count_usage": 0,
"subnet_count_limit": 0,
"subnet_count_requested": 1,
"subnet_count_usage": 0,
"vm_count_limit": 0,
"vm_count_requested": 1,
"vm_count_usage": 0,
"volume_count_limit": 0,
"volume_count_requested": 1,
"volume_count_usage": 0,
"volume_size_limit": 0,
"volume_size_requested": 1,
"volume_size_usage": 0,
"volume_snapshots_count_limit": 0,
"volume_snapshots_count_requested": 1,
"volume_snapshots_count_usage": 0,
"volume_snapshots_size_limit": 0,
"volume_snapshots_size_requested": 1,
"volume_snapshots_size_usage": 0
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}Authorizations
Path Parameters
Body
application/json
Response
OK
Was this page helpful?