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": [
{
"ca_secret_id": "<string>",
"creator_task_id": "d8334c12-2881-4c4a-84ad-1b21fea73ad1",
"crl_secret_id": "<string>",
"healthmonitor": {
"admin_state_up": true,
"delay": 1073741824,
"id": "<string>",
"max_retries": 5,
"max_retries_down": 5,
"operating_status": "DEGRADED",
"provisioning_status": "ACTIVE",
"timeout": 123,
"type": "HTTP",
"expected_codes": "200,301,302",
"http_method": "GET",
"url_path": "/"
},
"id": "<string>",
"lb_algorithm": "LEAST_CONNECTIONS",
"listeners": [
{
"id": "<string>"
}
],
"loadbalancers": [
{
"id": "<string>"
}
],
"members": [
{
"id": "<string>"
}
],
"name": "<string>",
"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": [
{
"ca_secret_id": "<string>",
"creator_task_id": "d8334c12-2881-4c4a-84ad-1b21fea73ad1",
"crl_secret_id": "<string>",
"healthmonitor": {
"admin_state_up": true,
"delay": 1073741824,
"id": "<string>",
"max_retries": 5,
"max_retries_down": 5,
"operating_status": "DEGRADED",
"provisioning_status": "ACTIVE",
"timeout": 123,
"type": "HTTP",
"expected_codes": "200,301,302",
"http_method": "GET",
"url_path": "/"
},
"id": "<string>",
"lb_algorithm": "LEAST_CONNECTIONS",
"listeners": [
{
"id": "<string>"
}
],
"loadbalancers": [
{
"id": "<string>"
}
],
"members": [
{
"id": "<string>"
}
],
"name": "<string>",
"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
Show members and Health Monitor details
Listener ID
Load Balancer ID
OK
Number of objects
x >= 0Objects
Show child attributes
Secret ID of CA certificate bundle
Task that created this entity
"d8334c12-2881-4c4a-84ad-1b21fea73ad1"
Secret ID of CA revocation list file
Health monitor parameters
Show child attributes
Administrative state of the resource. When set to true, the resource is enabled and operational. When set to false, the resource is disabled and will not process traffic. When null is passed, the value is skipped and defaults to true.
The time, in seconds, between sending probes to members
1 <= x <= 2147483647Health monitor ID
Number of successes before the member is switched to ONLINE state
1 <= x <= 10Number of failures before the member is switched to ERROR state
1 <= x <= 10Health Monitor operating status
DEGRADED, DRAINING, ERROR, NO_MONITOR, OFFLINE, ONLINE Health monitor lifecycle status
ACTIVE, DELETED, ERROR, PENDING_CREATE, PENDING_DELETE, PENDING_UPDATE The maximum time to connect. Must be less than the delay value
x <= 2147483Health monitor type. Once health monitor is created, cannot be changed.
HTTP, HTTPS, K8S, PING, TCP, TLS-HELLO, UDP-CONNECT Expected HTTP response codes. Can be a single code or a range of codes. Can only be used together with HTTP or HTTPS health monitor type. For example, 200,202,300-302,401,403,404,500-504. If not specified, the default is 200.
"200,301,302"
HTTP method
CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE "GET"
URL Path. Defaults to '/'
1"/"
Pool ID
Load balancer algorithm
LEAST_CONNECTIONS, ROUND_ROBIN, SOURCE_IP Pool name
Pool operating status
DEGRADED, DRAINING, ERROR, NO_MONITOR, OFFLINE, ONLINE Protocol
HTTP, HTTPS, PROXY, PROXYV2, TCP, UDP Pool lifecycle status
ACTIVE, DELETED, ERROR, PENDING_CREATE, PENDING_DELETE, PENDING_UPDATE Secret ID for TLS client authentication to the member servers
Session persistence parameters
Show child attributes
Session persistence type
APP_COOKIE, HTTP_COOKIE, SOURCE_IP Should be set if app cookie or http cookie is used
"cookie_name"
Subnet mask if source_ip is used. For UDP ports only
Session persistence timeout. For UDP ports only
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
Frontend client inactivity timeout in milliseconds
0 <= x <= 8640000050000
Backend member connection timeout in milliseconds
0 <= x <= 8640000050000
Backend member inactivity timeout in milliseconds
0 <= x <= 86400000null
Was this page helpful?