Python
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)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
loadBalancerPoolList, err := client.Cloud.LoadBalancers.Pools.List(context.TODO(), cloud.LoadBalancerPoolListParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(1),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", loadBalancerPoolList.Count)
}curl --request GET \
--url https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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",
"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",
"secret_id": "<string>",
"session_persistence": {
"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
}
]
}Load Balancers
List load balancer pools
GET
/
cloud
/
v1
/
lbpools
/
{project_id}
/
{region_id}
Python
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)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
loadBalancerPoolList, err := client.Cloud.LoadBalancers.Pools.List(context.TODO(), cloud.LoadBalancerPoolListParams{
ProjectID: gcore.Int(1),
RegionID: gcore.Int(1),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", loadBalancerPoolList.Count)
}curl --request GET \
--url https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"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",
"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",
"secret_id": "<string>",
"session_persistence": {
"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
}
]
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Path Parameters
Project ID
Example:
1
Region ID
Example:
1
Query Parameters
Show members and Health Monitor details
Examples:
true
false
Optional. Limit the number of returned items
Required range:
x <= 1000Example:
1000
Listener ID
Example:
"00000000-0000-4000-8000-000000000000"
Load Balancer ID
Example:
"00000000-0000-4000-8000-000000000000"
Filter by name
Example:
"lb-pool-name"
Optional. Offset value is used to exclude the first set of records from the result
Required range:
x >= 0Example:
0
Was this page helpful?
⌘I