import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
page = client.cloud.reserved_fixed_ips.list(
project_id=0,
region_id=0,
)
page = page.results[0]
print(page.network_id){
"count": 1,
"results": [
{
"allowed_address_pairs": [
{
"ip_address": "<string>",
"mac_address": "<string>"
}
],
"attachments": [
{
"resource_id": "83ed4ea6-bcae-4100-9e4d-36e541ff919b",
"resource_type": "instance"
}
],
"created_at": "2023-11-07T05:31:56Z",
"is_external": true,
"is_vip": true,
"name": "<string>",
"network": {
"created_at": "2023-11-07T05:31:56Z",
"creator_task_id": "fd50fdd1-0482-4c9b-b847-fc9924665af6",
"default": true,
"external": true,
"id": "<string>",
"mtu": 123,
"name": "<string>",
"port_security_enabled": true,
"project_id": 1337,
"region": "<string>",
"region_id": 123,
"segmentation_id": 9,
"shared": true,
"subnets": [
"<string>"
],
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": null,
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"network_id": "<string>",
"port_id": "<string>",
"region": "<string>",
"region_id": 123,
"reservation": {
"resource_id": "83ed4ea6-bcae-4100-9e4d-36e541ff919b",
"resource_type": "instance",
"status": "attached"
},
"status": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"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
}
]
}List all reserved fixed IPs in the specified project and region.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
page = client.cloud.reserved_fixed_ips.list(
project_id=0,
region_id=0,
)
page = page.results[0]
print(page.network_id){
"count": 1,
"results": [
{
"allowed_address_pairs": [
{
"ip_address": "<string>",
"mac_address": "<string>"
}
],
"attachments": [
{
"resource_id": "83ed4ea6-bcae-4100-9e4d-36e541ff919b",
"resource_type": "instance"
}
],
"created_at": "2023-11-07T05:31:56Z",
"is_external": true,
"is_vip": true,
"name": "<string>",
"network": {
"created_at": "2023-11-07T05:31:56Z",
"creator_task_id": "fd50fdd1-0482-4c9b-b847-fc9924665af6",
"default": true,
"external": true,
"id": "<string>",
"mtu": 123,
"name": "<string>",
"port_security_enabled": true,
"project_id": 1337,
"region": "<string>",
"region_id": 123,
"segmentation_id": 9,
"shared": true,
"subnets": [
"<string>"
],
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": null,
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"network_id": "<string>",
"port_id": "<string>",
"region": "<string>",
"region_id": 123,
"reservation": {
"resource_id": "83ed4ea6-bcae-4100-9e4d-36e541ff919b",
"resource_type": "instance",
"status": "attached"
},
"status": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"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
}
]
}API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Set to true if the response should only list IP addresses that are not attached to any instance
Filter IPs by device ID it is attached to
Set to true if the response should only list public IP addresses
Set to true if the response should only list private IP addresses
An IPv4 address to filter results by. Regular expression allowed
Limit the number of returned IPs
Offset value is used to exclude the first set of records from the result
Ordering reserved fixed IP list result by name, status, updated_at, created_at or fixed_ip_address fields and directions (status.asc), default is "fixed_ip_address.asc"
Set to true if the response should only list VIPs
List of reserved fixed IPs
Number of objects
x >= 0Objects
Show child attributes
Group of subnet masks and/or IP addresses that share the current IP as VIP
Datetime when the reserved fixed IP was created
If reserved fixed IP belongs to a public network
If reserved fixed IP is a VIP
Reserved fixed IP name
Network details
Show child attributes
Datetime when the network was created
Task that created this entity
"fd50fdd1-0482-4c9b-b847-fc9924665af6"
True if network has is_default attribute
true
True if the network router:external attribute
Network ID
MTU (maximum transmission unit). Default value is 1450
Network name
Indicates port_security_enabled status of all newly created in the network ports.
Project ID
1337
Region name
Region ID
Id of network segment
9
True when the network is shared with your project by external owner
List of subnetworks
List of key-value tags associated 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. 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
Tag key. The maximum size for a key is 255 characters.
If true, the tag is read-only and cannot be modified by the user
Tag value. The maximum size for a value is 255 characters.
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
Network type (vlan, vxlan)
Datetime when the network was last updated
ID of the network the port is attached to
ID of the port underlying the reserved fixed IP
Region name
Region ID
Reserved fixed IP status with resource type and ID it is attached to
Show child attributes
ID of the instance or load balancer the IP is attached to
"83ed4ea6-bcae-4100-9e4d-36e541ff919b"
Resource type of the resource the IP is attached to
"instance"
IP reservation status
"attached"
Underlying port status
Datetime when the reserved fixed IP was last updated
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?