Obter um balanceador de carga
curl --request GET \
--url https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{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://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{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: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"load_balancer": {
"desired_count": 2,
"min_count": 1,
"max_count": 5,
"id": "4e1f8c2a-9b3d-4f6e-8a1c-2d5e7f9a0b3c",
"crn": "crn:loadbalancer:sa-saopaulo-1:my-account:load-balancer/web-lb",
"account_id": "6f9619ff-8b86-4d01-b42d-00cf4fc964ff",
"name": "web-lb",
"type": "application",
"status": "active",
"faults": [],
"subnet": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod/subnet/prod-web",
"vpc": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod",
"name": "prod",
"cidr_ipv4": "10.0.0.0/16",
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "Production VPC for web and app tiers",
"cidr_ipv6": "2a13:9500:1a6:100::/60"
},
"route_table": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod/route-table/prod-private-rt",
"name": "prod-private-rt"
},
"name": "prod-web",
"cidr_ipv4": "10.0.1.0/24",
"gateway_ipv4": "10.0.1.1",
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "Public web-tier subnet",
"cidr_ipv6": "2a13:9500:1a6:100::/64",
"gateway_ipv6": "2a13:9500:1a6:100::1"
},
"flavor_id": "e5f6a7b8-c9d0-4123-e4f5-a6b7c8d9e0f1",
"replica_count": 2,
"floating_ips": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:floating-ip/<uuid>",
"family": "ipv6",
"attached_to": "crn:network:sa-saopaulo-1:my-account:vpc/prod/subnet/public/interface/eth0",
"members": [
{
"interface": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod/subnet/public/interface/eth0",
"instance": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:compute:sa-saopaulo-1:my-account:instance/web",
"name": "<string>"
}
},
"health": "unknown",
"reason": "unprobed",
"created_at": "2023-11-07T05:31:56Z",
"address_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"address": "212.66.52.71",
"visibility": "public",
"description": "Public IP for the web load balancer",
"health_check": {
"protocol": "http",
"port": 8080,
"interval_sec": 30,
"timeout_sec": 5,
"healthy_threshold": 3,
"unhealthy_threshold": 3,
"path": "/healthz",
"matcher": "200-299"
},
"subnet_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vpc_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"tags": {
"environment": "production",
"team": "backend"
},
"created_at": "2026-01-15T09:30:00Z",
"updated_at": "2026-01-15T09:30:00Z",
"rollout_surge": true,
"autoscaling": {
"enabled": true,
"metrics": [
{
"source": "telemetry",
"target_type": "average_value",
"target_value": 100,
"name": "queue_depth",
"labels": {
"queue": "orders"
},
"sample_aggregation": "last",
"series_aggregation": "sum",
"expected_series": 1,
"window_seconds": 120,
"max_age_seconds": 90
}
],
"warmup_seconds": 180,
"cooldown_seconds": 60,
"scale_down_stabilization_seconds": 300,
"max_scale_out_step": 4,
"max_scale_in_step": 1,
"drain_seconds": 120
},
"autoscaling_status": {
"status": "pending",
"reason": "waiting for sustained lower demand",
"history": [
{
"at": "2023-11-07T05:31:56Z",
"from": 1,
"to": 1,
"reason": "<string>"
}
],
"evaluated_at": "2023-11-07T05:31:56Z",
"last_scaled_at": "2023-11-07T05:31:56Z"
},
"internal_ipv4": "203.0.113.50",
"internal_ipv6": "2001:db8::32",
"public_ipv6": "2a13:9500:1a6:101::a",
"floating_ip_id": "f6a7b8c9-d0e1-4234-f5a6-b7c8d9e0f1a2",
"dns_name": "web-lb.my-account.lb.sa-saopaulo-1.basaltic.sh"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "ACCESS_DENIED",
"message": "You don't have permission to perform this action",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Balanceadores de carga
Obter um balanceador de carga
GET
/
v1
/
load-balancers
/
{id}
Obter um balanceador de carga
curl --request GET \
--url https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{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://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{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: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://loadbalancer.{region}.basaltic.sh/v1/load-balancers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"load_balancer": {
"desired_count": 2,
"min_count": 1,
"max_count": 5,
"id": "4e1f8c2a-9b3d-4f6e-8a1c-2d5e7f9a0b3c",
"crn": "crn:loadbalancer:sa-saopaulo-1:my-account:load-balancer/web-lb",
"account_id": "6f9619ff-8b86-4d01-b42d-00cf4fc964ff",
"name": "web-lb",
"type": "application",
"status": "active",
"faults": [],
"subnet": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod/subnet/prod-web",
"vpc": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod",
"name": "prod",
"cidr_ipv4": "10.0.0.0/16",
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "Production VPC for web and app tiers",
"cidr_ipv6": "2a13:9500:1a6:100::/60"
},
"route_table": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod/route-table/prod-private-rt",
"name": "prod-private-rt"
},
"name": "prod-web",
"cidr_ipv4": "10.0.1.0/24",
"gateway_ipv4": "10.0.1.1",
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "Public web-tier subnet",
"cidr_ipv6": "2a13:9500:1a6:100::/64",
"gateway_ipv6": "2a13:9500:1a6:100::1"
},
"flavor_id": "e5f6a7b8-c9d0-4123-e4f5-a6b7c8d9e0f1",
"replica_count": 2,
"floating_ips": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:floating-ip/<uuid>",
"family": "ipv6",
"attached_to": "crn:network:sa-saopaulo-1:my-account:vpc/prod/subnet/public/interface/eth0",
"members": [
{
"interface": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod/subnet/public/interface/eth0",
"instance": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:compute:sa-saopaulo-1:my-account:instance/web",
"name": "<string>"
}
},
"health": "unknown",
"reason": "unprobed",
"created_at": "2023-11-07T05:31:56Z",
"address_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"address": "212.66.52.71",
"visibility": "public",
"description": "Public IP for the web load balancer",
"health_check": {
"protocol": "http",
"port": 8080,
"interval_sec": 30,
"timeout_sec": 5,
"healthy_threshold": 3,
"unhealthy_threshold": 3,
"path": "/healthz",
"matcher": "200-299"
},
"subnet_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"vpc_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"tags": {
"environment": "production",
"team": "backend"
},
"created_at": "2026-01-15T09:30:00Z",
"updated_at": "2026-01-15T09:30:00Z",
"rollout_surge": true,
"autoscaling": {
"enabled": true,
"metrics": [
{
"source": "telemetry",
"target_type": "average_value",
"target_value": 100,
"name": "queue_depth",
"labels": {
"queue": "orders"
},
"sample_aggregation": "last",
"series_aggregation": "sum",
"expected_series": 1,
"window_seconds": 120,
"max_age_seconds": 90
}
],
"warmup_seconds": 180,
"cooldown_seconds": 60,
"scale_down_stabilization_seconds": 300,
"max_scale_out_step": 4,
"max_scale_in_step": 1,
"drain_seconds": 120
},
"autoscaling_status": {
"status": "pending",
"reason": "waiting for sustained lower demand",
"history": [
{
"at": "2023-11-07T05:31:56Z",
"from": 1,
"to": 1,
"reason": "<string>"
}
],
"evaluated_at": "2023-11-07T05:31:56Z",
"last_scaled_at": "2023-11-07T05:31:56Z"
},
"internal_ipv4": "203.0.113.50",
"internal_ipv6": "2001:db8::32",
"public_ipv6": "2a13:9500:1a6:101::a",
"floating_ip_id": "f6a7b8c9-d0e1-4234-f5a6-b7c8d9e0f1a2",
"dns_name": "web-lb.my-account.lb.sa-saopaulo-1.basaltic.sh"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "ACCESS_DENIED",
"message": "You don't have permission to perform this action",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Requer a ação do IAM
loadbalancer:GetLoadBalancer. Consulte permissões de balanceadores de carga para obter a lista completa, o que cada uma abrange e um exemplo de política.Autorizações
Um token bearer OAuth 2.0, enviado como Authorization: Bearer <token>. Esta é a forma recomendada de autenticação.
Obtenha o token trocando o par de chaves de acesso de uma conta de serviço em POST /v1/oauth/token com grant_type=client_credentials. Esse é o fluxo padrão de credenciais de cliente; bibliotecas compatíveis com OAuth podem obter e renovar o token para você.
curl -s -u "$KEY_ID:$SECRET" -d grant_type=client_credentials \
https://iam.basaltic.sh/v1/oauth/token
Os tokens duram uma hora por padrão. O mesmo par de chaves de acesso também serve como credencial AWS SigV4 para o endpoint de objetos compatível com S3, que aceita somente esse método de autenticação.
Parâmetros de caminho
Exemplo:
"4e1f8c2a-9b3d-4f6e-8a1c-2d5e7f9a0b3c"
Resposta
OK
Show child attributes
Show child attributes

