import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
task_id_list = client.cloud.networks.subnets.create(
project_id=1,
region_id=1,
cidr="192.168.10.0/24",
name="my subnet",
network_id="ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
)
print(task_id_list.tasks)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
taskIDList, err := client.Cloud.Networks.Subnets.New(context.TODO(), cloud.NetworkSubnetNewParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(1),
Cidr: "192.168.10.0/24",
Name: "my subnet",
NetworkID: "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", taskIDList.Tasks)
}
curl --request POST \
--url https://api.gcore.com/cloud/v1/subnets/{project_id}/{region_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cidr": "192.168.10.0/24",
"name": "my subnet",
"network_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"connect_to_network_router": true,
"dns_nameservers": [
"8.8.4.4",
"1.1.1.1"
],
"enable_dhcp": true,
"gateway_ip": "192.168.10.1",
"host_routes": [
{
"destination": "10.0.3.0/24",
"nexthop": "10.0.0.13"
}
],
"ip_version": 4,
"router_id_to_connect": "00000000-0000-4000-8000-000000000000",
"tags": {
"my-tag": "my-tag-value"
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cidr: '192.168.10.0/24',
name: 'my subnet',
network_id: 'ee2402d0-f0cd-4503-9b75-69be1d11c5f1',
connect_to_network_router: true,
dns_nameservers: ['8.8.4.4', '1.1.1.1'],
enable_dhcp: true,
gateway_ip: '192.168.10.1',
host_routes: [{destination: '10.0.3.0/24', nexthop: '10.0.0.13'}],
ip_version: 4,
router_id_to_connect: '00000000-0000-4000-8000-000000000000',
tags: {'my-tag': 'my-tag-value'}
})
};
fetch('https://api.gcore.com/cloud/v1/subnets/{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/subnets/{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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cidr' => '192.168.10.0/24',
'name' => 'my subnet',
'network_id' => 'ee2402d0-f0cd-4503-9b75-69be1d11c5f1',
'connect_to_network_router' => true,
'dns_nameservers' => [
'8.8.4.4',
'1.1.1.1'
],
'enable_dhcp' => true,
'gateway_ip' => '192.168.10.1',
'host_routes' => [
[
'destination' => '10.0.3.0/24',
'nexthop' => '10.0.0.13'
]
],
'ip_version' => 4,
'router_id_to_connect' => '00000000-0000-4000-8000-000000000000',
'tags' => [
'my-tag' => 'my-tag-value'
]
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v1/subnets/{project_id}/{region_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cidr\": \"192.168.10.0/24\",\n \"name\": \"my subnet\",\n \"network_id\": \"ee2402d0-f0cd-4503-9b75-69be1d11c5f1\",\n \"connect_to_network_router\": true,\n \"dns_nameservers\": [\n \"8.8.4.4\",\n \"1.1.1.1\"\n ],\n \"enable_dhcp\": true,\n \"gateway_ip\": \"192.168.10.1\",\n \"host_routes\": [\n {\n \"destination\": \"10.0.3.0/24\",\n \"nexthop\": \"10.0.0.13\"\n }\n ],\n \"ip_version\": 4,\n \"router_id_to_connect\": \"00000000-0000-4000-8000-000000000000\",\n \"tags\": {\n \"my-tag\": \"my-tag-value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/subnets/{project_id}/{region_id}")
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 \"cidr\": \"192.168.10.0/24\",\n \"name\": \"my subnet\",\n \"network_id\": \"ee2402d0-f0cd-4503-9b75-69be1d11c5f1\",\n \"connect_to_network_router\": true,\n \"dns_nameservers\": [\n \"8.8.4.4\",\n \"1.1.1.1\"\n ],\n \"enable_dhcp\": true,\n \"gateway_ip\": \"192.168.10.1\",\n \"host_routes\": [\n {\n \"destination\": \"10.0.3.0/24\",\n \"nexthop\": \"10.0.0.13\"\n }\n ],\n \"ip_version\": 4,\n \"router_id_to_connect\": \"00000000-0000-4000-8000-000000000000\",\n \"tags\": {\n \"my-tag\": \"my-tag-value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}{
"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
}Create subnet
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
task_id_list = client.cloud.networks.subnets.create(
project_id=1,
region_id=1,
cidr="192.168.10.0/24",
name="my subnet",
network_id="ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
)
print(task_id_list.tasks)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
taskIDList, err := client.Cloud.Networks.Subnets.New(context.TODO(), cloud.NetworkSubnetNewParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(1),
Cidr: "192.168.10.0/24",
Name: "my subnet",
NetworkID: "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", taskIDList.Tasks)
}
curl --request POST \
--url https://api.gcore.com/cloud/v1/subnets/{project_id}/{region_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"cidr": "192.168.10.0/24",
"name": "my subnet",
"network_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"connect_to_network_router": true,
"dns_nameservers": [
"8.8.4.4",
"1.1.1.1"
],
"enable_dhcp": true,
"gateway_ip": "192.168.10.1",
"host_routes": [
{
"destination": "10.0.3.0/24",
"nexthop": "10.0.0.13"
}
],
"ip_version": 4,
"router_id_to_connect": "00000000-0000-4000-8000-000000000000",
"tags": {
"my-tag": "my-tag-value"
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cidr: '192.168.10.0/24',
name: 'my subnet',
network_id: 'ee2402d0-f0cd-4503-9b75-69be1d11c5f1',
connect_to_network_router: true,
dns_nameservers: ['8.8.4.4', '1.1.1.1'],
enable_dhcp: true,
gateway_ip: '192.168.10.1',
host_routes: [{destination: '10.0.3.0/24', nexthop: '10.0.0.13'}],
ip_version: 4,
router_id_to_connect: '00000000-0000-4000-8000-000000000000',
tags: {'my-tag': 'my-tag-value'}
})
};
fetch('https://api.gcore.com/cloud/v1/subnets/{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/subnets/{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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cidr' => '192.168.10.0/24',
'name' => 'my subnet',
'network_id' => 'ee2402d0-f0cd-4503-9b75-69be1d11c5f1',
'connect_to_network_router' => true,
'dns_nameservers' => [
'8.8.4.4',
'1.1.1.1'
],
'enable_dhcp' => true,
'gateway_ip' => '192.168.10.1',
'host_routes' => [
[
'destination' => '10.0.3.0/24',
'nexthop' => '10.0.0.13'
]
],
'ip_version' => 4,
'router_id_to_connect' => '00000000-0000-4000-8000-000000000000',
'tags' => [
'my-tag' => 'my-tag-value'
]
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v1/subnets/{project_id}/{region_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cidr\": \"192.168.10.0/24\",\n \"name\": \"my subnet\",\n \"network_id\": \"ee2402d0-f0cd-4503-9b75-69be1d11c5f1\",\n \"connect_to_network_router\": true,\n \"dns_nameservers\": [\n \"8.8.4.4\",\n \"1.1.1.1\"\n ],\n \"enable_dhcp\": true,\n \"gateway_ip\": \"192.168.10.1\",\n \"host_routes\": [\n {\n \"destination\": \"10.0.3.0/24\",\n \"nexthop\": \"10.0.0.13\"\n }\n ],\n \"ip_version\": 4,\n \"router_id_to_connect\": \"00000000-0000-4000-8000-000000000000\",\n \"tags\": {\n \"my-tag\": \"my-tag-value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/subnets/{project_id}/{region_id}")
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 \"cidr\": \"192.168.10.0/24\",\n \"name\": \"my subnet\",\n \"network_id\": \"ee2402d0-f0cd-4503-9b75-69be1d11c5f1\",\n \"connect_to_network_router\": true,\n \"dns_nameservers\": [\n \"8.8.4.4\",\n \"1.1.1.1\"\n ],\n \"enable_dhcp\": true,\n \"gateway_ip\": \"192.168.10.1\",\n \"host_routes\": [\n {\n \"destination\": \"10.0.3.0/24\",\n \"nexthop\": \"10.0.0.13\"\n }\n ],\n \"ip_version\": 4,\n \"router_id_to_connect\": \"00000000-0000-4000-8000-000000000000\",\n \"tags\": {\n \"my-tag\": \"my-tag-value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}{
"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
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
1
Region ID
1
Body
CIDR
"192.168.10.0/24"
Subnet name
^[a-zA-Z0-9][a-zA-Z 0-9._\-]{1,61}[a-zA-Z0-9._]$"my subnet"
Network ID
"ee2402d0-f0cd-4503-9b75-69be1d11c5f1"
True if the network's router should get a gateway in this subnet. Must be explicitly 'false' when gateway_ip is null.
true
List IP addresses of DNS servers to advertise via DHCP.
["8.8.4.4", "1.1.1.1"]
True if DHCP should be enabled
true
Default GW IPv4 address to advertise in DHCP routes in this subnet. Omit this field to let the cloud backend allocate it automatically. Set to null if no gateway must be advertised by this subnet's DHCP (useful when attaching instances to multiple subnets in order to prevent default route conflicts).
"192.168.10.1"
List of custom static routes to advertise via DHCP.
Show child attributes
Show child attributes
[
{
"destination": "10.0.3.0/24",
"nexthop": "10.0.0.13"
}
]
IP version
4, 6 4
ID of the router to connect to. Requires connect_to_network_router set to true. If not specified, attempts to find a router created during network creation.
"00000000-0000-4000-8000-000000000000"
Key-value tags to associate 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. Both tag keys and values have a maximum length of 255 characters. Tag keys and values cannot contain characters from U+0080 to U+00FF. 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.
Show child attributes
Show child attributes
{ "my-tag": "my-tag-value" }
Response
Task IDs
List of task IDs representing asynchronous operations. Use these IDs to monitor operation progress:
GET /v1/tasks/{task_id}- Check individual task status and details Poll task status until completion (FINISHED/ERROR) before proceeding with dependent operations.
["d478ae29-dedc-4869-82f0-96104425f565"]
Was this page helpful?