from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
network = client.cloud.networks.get(
network_id="b39792c3-3160-4356-912e-ba396c95cdcf",
project_id=1,
region_id=1,
)
print(network.id)
{
"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"
}
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
network = client.cloud.networks.get(
network_id="b39792c3-3160-4356-912e-ba396c95cdcf",
project_id=1,
region_id=1,
)
print(network.id)
{
"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"
}
API key for authentication. Make sure to include the word apikey
, followed by a single space and then your token.
Example: apikey 1234$abcdef
Project ID
1
Region ID
1
Network ID
"b39792c3-3160-4356-912e-ba396c95cdcf"
OK
The response is of type object
.
Was this page helpful?