import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
reserved_fixed_ip = client.cloud.reserved_fixed_ips.get(
port_id="ac177f1f-eb04-42c4-9864-e7d6486813af",
project_id=1,
region_id=4,
)
print(reserved_fixed_ip.network_id)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"),
)
reservedFixedIP, err := client.Cloud.ReservedFixedIPs.Get(
context.TODO(),
"ac177f1f-eb04-42c4-9864-e7d6486813af",
cloud.ReservedFixedIPGetParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(4),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", reservedFixedIP.NetworkID)
}
curl --request GET \
--url https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_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/reserved_fixed_ips/{project_id}/{region_id}/{port_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;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_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{
"allowed_address_pairs": [
{
"ip_address": "192.168.123.20",
"mac_address": "00:16:3e:f2:87:16"
},
{
"ip_address": "192.168.0.2",
"mac_address": "00:16:3e:f2:87:89"
}
],
"attachments": [
{
"resource_id": "e3c6ee77-48cb-416b-b204-11b492cc776e3",
"resource_type": "instance"
},
{
"resource_id": "e73a4dbd-da04-4b6e-8ef9-07e8742001b7",
"resource_type": "ai_cluster"
}
],
"created_at": "2019-06-18T11:56:16+0000",
"is_external": false,
"is_vip": false,
"name": "Reserved fixed ip 10.100.179.44",
"network": {
"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": [
"f00624ab-41bc-4d54-a723-1673ce32d997",
"41e0f698-4d39-483b-b77a-18eb070e4c09"
],
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": null,
"type": "vlan",
"updated_at": "2019-06-18T11:57:00+0000"
},
"network_id": "eed97610-708d-43a5-a9a5-caebd2b7b4ee",
"port_id": "817c8a3d-bb67-4b88-a0d1-aec980318ff1",
"region": "Luxembourg 1",
"region_id": 7,
"reservation": {
"resource_id": "83ed4ea6-bcae-4100-9e4d-36e541ff919b",
"resource_type": "instance",
"status": "attached"
},
"status": "DOWN",
"updated_at": "2019-06-18T11:57:00+0000",
"creator_task_id": "30378aea-9343-4ff6-be38-9756094e05da",
"fixed_ip_address": "10.100.179.44",
"fixed_ipv6_address": null,
"project_id": 1337,
"subnet_id": "747db04a-2aac-4fda-9492-d9b85a798c09",
"subnet_v6_id": null,
"task_id": null
}Get reserved fixed IP
Get detailed information about a specific reserved fixed IP.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
reserved_fixed_ip = client.cloud.reserved_fixed_ips.get(
port_id="ac177f1f-eb04-42c4-9864-e7d6486813af",
project_id=1,
region_id=4,
)
print(reserved_fixed_ip.network_id)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"),
)
reservedFixedIP, err := client.Cloud.ReservedFixedIPs.Get(
context.TODO(),
"ac177f1f-eb04-42c4-9864-e7d6486813af",
cloud.ReservedFixedIPGetParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(4),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", reservedFixedIP.NetworkID)
}
curl --request GET \
--url https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_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/reserved_fixed_ips/{project_id}/{region_id}/{port_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;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_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{
"allowed_address_pairs": [
{
"ip_address": "192.168.123.20",
"mac_address": "00:16:3e:f2:87:16"
},
{
"ip_address": "192.168.0.2",
"mac_address": "00:16:3e:f2:87:89"
}
],
"attachments": [
{
"resource_id": "e3c6ee77-48cb-416b-b204-11b492cc776e3",
"resource_type": "instance"
},
{
"resource_id": "e73a4dbd-da04-4b6e-8ef9-07e8742001b7",
"resource_type": "ai_cluster"
}
],
"created_at": "2019-06-18T11:56:16+0000",
"is_external": false,
"is_vip": false,
"name": "Reserved fixed ip 10.100.179.44",
"network": {
"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": [
"f00624ab-41bc-4d54-a723-1673ce32d997",
"41e0f698-4d39-483b-b77a-18eb070e4c09"
],
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": null,
"type": "vlan",
"updated_at": "2019-06-18T11:57:00+0000"
},
"network_id": "eed97610-708d-43a5-a9a5-caebd2b7b4ee",
"port_id": "817c8a3d-bb67-4b88-a0d1-aec980318ff1",
"region": "Luxembourg 1",
"region_id": 7,
"reservation": {
"resource_id": "83ed4ea6-bcae-4100-9e4d-36e541ff919b",
"resource_type": "instance",
"status": "attached"
},
"status": "DOWN",
"updated_at": "2019-06-18T11:57:00+0000",
"creator_task_id": "30378aea-9343-4ff6-be38-9756094e05da",
"fixed_ip_address": "10.100.179.44",
"fixed_ipv6_address": null,
"project_id": 1337,
"subnet_id": "747db04a-2aac-4fda-9492-d9b85a798c09",
"subnet_v6_id": null,
"task_id": 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
4
Port ID
"ac177f1f-eb04-42c4-9864-e7d6486813af"
Response
OK
Group of subnet masks and/or IP addresses that share the current IP as VIP
Show child attributes
Show child attributes
[ { "ip_address": "192.168.123.20", "mac_address": "00:16:3e:f2:87:16" }, { "ip_address": "192.168.0.2", "mac_address": "00:16:3e:f2:87:89" } ]
Reserved fixed IP attachment entities
Show child attributes
Show child attributes
[ { "resource_id": "e3c6ee77-48cb-416b-b204-11b492cc776e3", "resource_type": "instance" }, { "resource_id": "e73a4dbd-da04-4b6e-8ef9-07e8742001b7", "resource_type": "ai_cluster" } ]
Datetime when the reserved fixed IP was created
"2019-06-18T11:56:16+0000"
If reserved fixed IP belongs to a public network
false
If reserved fixed IP is a VIP
false
Reserved fixed IP name
"Reserved fixed ip 10.100.179.44"
Network details
Show child attributes
Show child attributes
ID of the network the port is attached to
"eed97610-708d-43a5-a9a5-caebd2b7b4ee"
ID of the port underlying the reserved fixed IP
"817c8a3d-bb67-4b88-a0d1-aec980318ff1"
Region name
"Luxembourg 1"
Region ID
7
Reserved fixed IP status with resource type and ID it is attached to
Show child attributes
Show child attributes
Underlying port status
"DOWN"
Datetime when the reserved fixed IP was last updated
"2019-06-18T11:57:00+0000"
Task that created this entity
"30378aea-9343-4ff6-be38-9756094e05da"
IPv4 address of the reserved fixed IP
"10.100.179.44"
IPv6 address of the reserved fixed IP
null
Project ID
1337
ID of the subnet that owns the IP address
"747db04a-2aac-4fda-9492-d9b85a798c09"
ID of the subnet that owns the IPv6 address
null
The UUID of the active task that currently holds a lock on the resource. This lock prevents concurrent modifications to ensure consistency. If null, the resource is not locked.
null
Was this page helpful?