from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
load_balancer_metrics_list = client.cloud.load_balancers.metrics.list(
loadbalancer_id="loadbalancer_id",
project_id=0,
region_id=0,
time_interval=6,
time_unit="day",
)
print(load_balancer_metrics_list.count)
{
"count": 1,
"results": [
{
"cpu_util": 8,
"memory_util": 33.28411162695459,
"network_Bps_egress": 102,
"network_Bps_ingress": 102,
"network_pps_egress": 0.7,
"network_pps_ingress": 0.7,
"time": "2020-07-07T12:57:00Z"
}
]
}
Get load balancer metrics, including cpu, memory and network
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
load_balancer_metrics_list = client.cloud.load_balancers.metrics.list(
loadbalancer_id="loadbalancer_id",
project_id=0,
region_id=0,
time_interval=6,
time_unit="day",
)
print(load_balancer_metrics_list.count)
{
"count": 1,
"results": [
{
"cpu_util": 8,
"memory_util": 33.28411162695459,
"network_Bps_egress": 102,
"network_Bps_ingress": 102,
"network_pps_egress": 0.7,
"network_pps_ingress": 0.7,
"time": "2020-07-07T12:57:00Z"
}
]
}
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
Region ID
Loadbalancer ID
List of loadbalancer metrics
The response is of type object
.
Was this page helpful?