curl --request GET \
--url https://api.gcore.com/cloud/v1/availablenetworks/{project_id}/{region_id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.gcore.com/cloud/v1/availablenetworks/{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/availablenetworks/{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/availablenetworks/{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/availablenetworks/{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/availablenetworks/{project_id}/{region_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/availablenetworks/{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": [
{
"created_at": "2019-06-18T11:56:16+0000",
"creator_task_id": "fd50fdd1-0482-4c9b-b847-fc9924665af6",
"default": true,
"external": true,
"id": "eed97610-708d-43a5-a9a5-caebd2b7b4ee",
"mtu": 1500,
"name": "public",
"port_security_enabled": true,
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"segmentation_id": 9,
"shared": false,
"subnets": [
{
"available_ips": 65432,
"cidr": "10.0.0.0/16",
"created_at": "2019-07-18T12:07:00+0000",
"description": "example description",
"enable_dhcp": true,
"id": "80bfcb8e-1709-4bb2-99d4-3fa1332571de",
"ip_version": 4,
"name": "test 2",
"network_id": "162091db-33cc-45d5-a375-964509af4813",
"project_id": 1,
"region": "Luxembourg 1",
"region_id": 1,
"tags": [
{
"key": "key1",
"read_only": false,
"value": "value1"
}
],
"total_ips": 65536,
"updated_at": "2019-07-22T10:55:45+0000"
},
{
"available_ips": 232,
"cidr": "192.168.192.0/24",
"created_at": "2019-07-22T15:15:05+0000",
"description": "{\"task_id\": \"cc9a5445-189e-48de-a01f-5e10641a6915\"}",
"enable_dhcp": true,
"id": "94196a6a-c2ce-4f0d-8dc7-d9e0e722aea0",
"ip_version": 4,
"name": "string",
"network_id": "162091db-33cc-45d5-a375-964509af4813",
"project_id": 1,
"region": "Luxembourg 1",
"region_id": 1,
"tags": [
{
"key": "key1",
"read_only": false,
"value": "value1"
}
],
"total_ips": 256,
"updated_at": "2019-07-22T15:15:05+0000"
}
],
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": null,
"type": "vlan",
"updated_at": "2019-06-18T11:57:00+0000"
}
]
}List networks with subnets details
Retrieve the list of directly-attachable networks with subnet details. Returned entities may or may not be owned by the project.
Deprecated: Use GET /v1/networks/{project_id}/{region_id}?owned_by=any instead.
curl --request GET \
--url https://api.gcore.com/cloud/v1/availablenetworks/{project_id}/{region_id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.gcore.com/cloud/v1/availablenetworks/{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/availablenetworks/{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/availablenetworks/{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/availablenetworks/{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/availablenetworks/{project_id}/{region_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/availablenetworks/{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": [
{
"created_at": "2019-06-18T11:56:16+0000",
"creator_task_id": "fd50fdd1-0482-4c9b-b847-fc9924665af6",
"default": true,
"external": true,
"id": "eed97610-708d-43a5-a9a5-caebd2b7b4ee",
"mtu": 1500,
"name": "public",
"port_security_enabled": true,
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"segmentation_id": 9,
"shared": false,
"subnets": [
{
"available_ips": 65432,
"cidr": "10.0.0.0/16",
"created_at": "2019-07-18T12:07:00+0000",
"description": "example description",
"enable_dhcp": true,
"id": "80bfcb8e-1709-4bb2-99d4-3fa1332571de",
"ip_version": 4,
"name": "test 2",
"network_id": "162091db-33cc-45d5-a375-964509af4813",
"project_id": 1,
"region": "Luxembourg 1",
"region_id": 1,
"tags": [
{
"key": "key1",
"read_only": false,
"value": "value1"
}
],
"total_ips": 65536,
"updated_at": "2019-07-22T10:55:45+0000"
},
{
"available_ips": 232,
"cidr": "192.168.192.0/24",
"created_at": "2019-07-22T15:15:05+0000",
"description": "{\"task_id\": \"cc9a5445-189e-48de-a01f-5e10641a6915\"}",
"enable_dhcp": true,
"id": "94196a6a-c2ce-4f0d-8dc7-d9e0e722aea0",
"ip_version": 4,
"name": "string",
"network_id": "162091db-33cc-45d5-a375-964509af4813",
"project_id": 1,
"region": "Luxembourg 1",
"region_id": 1,
"tags": [
{
"key": "key1",
"read_only": false,
"value": "value1"
}
],
"total_ips": 256,
"updated_at": "2019-07-22T15:15:05+0000"
}
],
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": null,
"type": "vlan",
"updated_at": "2019-06-18T11:57:00+0000"
}
]
}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
Query Parameters
Filter by external network status
true
Optional. Limit the number of returned items
x <= 10001000
Filter networks by name
61"my-network"
Optional. Can be used to only show subnets of the specific network
"123e4567-e89b-12d3-a456-426614174000"
Filter by network type (vlan or vxlan)
vlan, vxlan "vlan"
Optional. Offset value is used to exclude the first set of records from the result
x >= 00
Ordering networks list result by name, created_at or priority fields and directions (e.g. created_at.desc).
created_at.asc, created_at.desc, name.asc, name.desc, priority.desc "created_at.desc"
Filter by shared state
true
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.
1 - 255^[^\s=]+$["key1", "key2"]
Optional. Filter by tag key-value pairs.
{ "key": "value" }
Was this page helpful?