import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
load_balancer_pool_list = client.cloud.load_balancers.pools.list(
project_id=1,
region_id=1,
)
print(load_balancer_pool_list.count){
"count": 1,
"results": [
{
"admin_state_up": true,
"ca_secret_id": "<string>",
"creator_task_id": "d8334c12-2881-4c4a-84ad-1b21fea73ad1",
"crl_secret_id": "<string>",
"healthmonitor": {
"admin_state_up": true,
"delay": 10,
"domain_name": "example.com",
"http_method": "GET",
"http_version": "1.1",
"max_retries": 3,
"max_retries_down": 3,
"timeout": 5,
"type": "HTTP",
"url_path": "/"
},
"id": "9fccf0a3-c0de-441d-9afd-2b9b58b08b9f",
"lb_algorithm": "LEAST_CONNECTIONS",
"listeners": [
{
"id": "c63341da-ea44-4027-bbf6-1f1939c783da"
}
],
"loadbalancers": [
{
"id": "79943b39-5e67-47e1-8878-85044b39667a"
}
],
"members": [
{
"id": "a7e7e8d6-0bf7-4ac9-8170-831b47ee2ba9"
}
],
"name": "lbaas_test_pool",
"operating_status": "DEGRADED",
"protocol": "HTTP",
"provisioning_status": "ACTIVE",
"secret_id": "<string>",
"session_persistence": {
"type": "APP_COOKIE",
"cookie_name": "cookie_name",
"persistence_granularity": "<string>",
"persistence_timeout": 123
},
"task_id": null,
"timeout_client_data": 50000,
"timeout_member_connect": 50000,
"timeout_member_data": null
}
]
}import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
load_balancer_pool_list = client.cloud.load_balancers.pools.list(
project_id=1,
region_id=1,
)
print(load_balancer_pool_list.count){
"count": 1,
"results": [
{
"admin_state_up": true,
"ca_secret_id": "<string>",
"creator_task_id": "d8334c12-2881-4c4a-84ad-1b21fea73ad1",
"crl_secret_id": "<string>",
"healthmonitor": {
"admin_state_up": true,
"delay": 10,
"domain_name": "example.com",
"http_method": "GET",
"http_version": "1.1",
"max_retries": 3,
"max_retries_down": 3,
"timeout": 5,
"type": "HTTP",
"url_path": "/"
},
"id": "9fccf0a3-c0de-441d-9afd-2b9b58b08b9f",
"lb_algorithm": "LEAST_CONNECTIONS",
"listeners": [
{
"id": "c63341da-ea44-4027-bbf6-1f1939c783da"
}
],
"loadbalancers": [
{
"id": "79943b39-5e67-47e1-8878-85044b39667a"
}
],
"members": [
{
"id": "a7e7e8d6-0bf7-4ac9-8170-831b47ee2ba9"
}
],
"name": "lbaas_test_pool",
"operating_status": "DEGRADED",
"protocol": "HTTP",
"provisioning_status": "ACTIVE",
"secret_id": "<string>",
"session_persistence": {
"type": "APP_COOKIE",
"cookie_name": "cookie_name",
"persistence_granularity": "<string>",
"persistence_timeout": 123
},
"task_id": null,
"timeout_client_data": 50000,
"timeout_member_connect": 50000,
"timeout_member_data": 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
Project ID
1
Region ID
1
Show members and Health Monitor details
true
false
Listener ID
"00000000-0000-4000-8000-000000000000"
Load Balancer ID
"00000000-0000-4000-8000-000000000000"
Was this page helpful?