Get
Returns the specified backend group.
To get the list of all available backend groups, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetBackendGroupRequest =
cloudApi.apploadbalancer.backend_group_service.GetBackendGroupRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.BackendGroupServiceClient);
const result = await client.get(
GetBackendGroupRequest.fromPartial({
backendGroupId: "backendGroupId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.apploadbalancer.v1.backend_group_service_pb2_grpc import BackendGroupServiceStub
from yandex.cloud.apploadbalancer.v1.backend_group_service_pb2 import GetBackendGroupRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(BackendGroupServiceStub)
response = service.Get(GetBackendGroupRequest(backend_group_id="backendGroupId"))
print(response)
GetBackendGroupRequest
backendGroupId
: string
ID of the backend group to return.
To get the backend group ID, make a BackendGroupService.List request.
BackendGroup
A backend group resource. For details about the concept, see documentation.
id
: string
ID of the backend group. Generated at creation time.
name
: string
Name of the backend group. The name is unique within the folder. The string length in characters is 3-63.
description
: string
Description of the backend group. The string is 0-256 characters long.
folderId
: string
ID of the folder that the backend group belongs to.
labels
: string
Backend group labels as key:value
pairs.
For details about the concept, see documentation.
The maximum number of labels is 64.
One of backend
Backends that the backend group consists of.
http
: HttpBackendGroupList of HTTP backends that the backend group consists of.
grpc
: GrpcBackendGroupList of gRPC backends that the backend group consists of.
stream
: StreamBackendGroupList of stream (TCP) backends that the backend group consists of.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
HttpBackendGroup
An HTTP backend group resource.
backends
: HttpBackend
List of HTTP backends.
One of sessionAffinity
Session affinity configuration for the backend group.
For details about the concept, see documentation.
If session affinity is configured, the backend group should contain exactly one active backend (i.e. with positive
HttpBackend.backend_weight), its HttpBackend.backend_type should be TargetGroupsBackend, and its
LoadBalancingConfig.load_balancing_mode should be MAGLEV_HASH
. If any of these conditions are not met, session
affinity will not work.
connection
: ConnectionSessionAffinityConnection-based session affinity configuration.
For now, a connection is defined only by an IP address of the client.
header
: HeaderSessionAffinityHTTP-header-field-based session affinity configuration.
cookie
: CookieSessionAffinityCookie-based session affinity configuration.
GrpcBackendGroup
A gRPC backend group resource.
backends
: GrpcBackend
List of gRPC backends.
connection
: ConnectionSessionAffinityConnection-based session affinity configuration.
For now, a connection is defined only by an IP address of the client.
header
: HeaderSessionAffinityHTTP-header-field-based session affinity configuration.
cookie
: CookieSessionAffinityCookie-based session affinity configuration.
StreamBackendGroup
A stream (TCP) backend group resource.
backends
: StreamBackend
List of stream (TCP) backends.
connection
: ConnectionSessionAffinityConnection-based session affinity configuration.
For now, a connection is defined only by an IP address of the client.
HttpBackend
An HTTP backend resource.
name
: string
Name of the backend.
backendWeight
: google.protobuf.Int64Value
Backend weight. Traffic is distributed between backends of a backend group according to their weights.
Weights must be set either for all backends in a group or for none of them. Setting no weights is the same as setting equal non-zero weights for all backends.
If the weight is non-positive, traffic is not sent to the backend.
loadBalancingConfig
: LoadBalancingConfig
Load balancing configuration for the backend.
port
: int64
Port used by all targets to receive traffic.
One of backendType
Reference to targets that belong to the backend.
A backend may be a set of target groups or an Object Storage bucket. For details about backend types, see documentation.
targetGroups
: TargetGroupsBackendTarget groups that belong to the backend. For details about target groups, see
storageBucket
: StorageBucketBackendObject Storage bucket to use as the backend. For details about buckets, see
If a bucket is used as a backend, the list of bucket objects and the objects themselves must be publicly accessible. For instructions, see documentation.
healthchecks
: HealthCheck
Health checks to perform on targets from target groups. For details about health checking, see documentation.
If no health checks are specified, active health checking is not performed.
tls
: BackendTls
Settings for TLS connections between load balancer nodes and backend targets.
If specified, the load balancer establishes HTTPS (HTTP over TLS) connections with targets and compares received certificates with the one specified in BackendTls.validation_context. If not specified, the load balancer establishes unencrypted HTTP connections with targets.
useHttp2
: bool
Enables HTTP/2 usage in connections between load balancer nodes and backend targets.
Default value: false
, HTTP/1.1 is used.
ConnectionSessionAffinity
A resource for connection-based session affinity configuration.
sourceIp
: bool
Specifies whether an IP address of the client is used to define a connection for session affinity.
HeaderSessionAffinity
A resource for HTTP-header-field-based session affinity configuration.
headerName
: string
Name of the HTTP header field that is used for session affinity.
CookieSessionAffinity
A resource for cookie-based session affinity configuration.
name
: string
Name of the cookie that is used for session affinity.
ttl
: google.protobuf.Duration
Maximum age of cookies that are generated for sessions.
If set to 0
, session cookies are used, which are stored by clients in temporary memory and are deleted
on client restarts.
If not set, the balancer does not generate cookies and only uses incoming ones for establishing session affinity.
GrpcBackend
A gRPC backend resource.
name
: string
Name of the backend.
backendWeight
: google.protobuf.Int64Value
Backend weight. Traffic is distributed between backends of a backend group according to their weights.
Weights must be set either for all backends of a group or for none of them. Setting no weights is the same as setting equal non-zero weights for all backends.
If the weight is non-positive, traffic is not sent to the backend.
loadBalancingConfig
: LoadBalancingConfig
Load balancing configuration for the backend.
port
: int64
Port used by all targets to receive traffic.
targetGroups
: TargetGroupsBackendTarget groups that belong to the backend.
healthchecks
: HealthCheck
Health checks to perform on targets from target groups. For details about health checking, see documentation.
If no health checks are specified, active health checking is not performed.
tls
: BackendTls
Settings for TLS connections between load balancer nodes and backend targets.
If specified, the load balancer establishes HTTPS (HTTP over TLS) connections with targets and compares received certificates with the one specified in BackendTls.validation_context. If not specified, the load balancer establishes unencrypted HTTP connections with targets.
StreamBackend
A stream (TCP) backend resource.
name
: string
Name of the backend.
backendWeight
: google.protobuf.Int64Value
Backend weight. Traffic is distributed between backends of a backend group according to their weights.
Weights must be set either for all backends in a group or for none of them. Setting no weights is the same as setting equal non-zero weights for all backends.
If the weight is non-positive, traffic is not sent to the backend.
loadBalancingConfig
: LoadBalancingConfig
Load balancing configuration for the backend.
port
: int64
Port used by all targets to receive traffic.
targetGroups
: TargetGroupsBackendTarget groups that belong to the backend. For details about target groups, see
healthchecks
: HealthCheck
Health checks to perform on targets from target groups. For details about health checking, see documentation.
If no health checks are specified, active health checking is not performed.
tls
: BackendTls
Settings for TLS connections between load balancer nodes and backend targets.
If specified, the load balancer establishes TLS-encrypted TCP connections with targets and compares received certificates with the one specified in BackendTls.validation_context. If not specified, the load balancer establishes unencrypted TCP connections with targets.
enableProxyProtocol
: bool
If set, proxy protocol will be enabled for this backend.
LoadBalancingConfig
A load balancing configuration resource.
panicThreshold
: int64
Threshold for panic mode.
If percentage of healthy backends in the group drops below threshold, panic mode will be activated and traffic will be routed to all backends, regardless of their health check status. This helps to avoid overloading healthy backends. For details about panic mode, see documentation.
If the value is 0
, panic mode will never be activated and traffic is routed only to healthy backends at all times.
Default value: 0
.
localityAwareRoutingPercent
: int64
Percentage of traffic that a load balancer node sends to healthy backends in its availability zone. The rest is divided equally between other zones. For details about zone-aware routing, see documentation.
If there are no healthy backends in an availability zone, all the traffic is divided between other zones.
If strict_locality is true
, the specified value is ignored.
A load balancer node sends all the traffic within its availability zone, regardless of backends' health.
Default value: 0
.
strictLocality
: bool
Specifies whether a load balancer node should only send traffic to backends in its availability zone, regardless of their health, and ignore backends in other zones.
If set to true
and there are no healthy backends in the zone, the node in this zone will respond
to incoming traffic with errors.
For details about strict locality, see documentation.
If strict_locality
is true
, the value specified in locality_aware_routing_percent is ignored.
Default value: false
.
mode
: LoadBalancingMode
Load balancing mode for the backend.
For details about load balancing modes, see documentation.
TargetGroupsBackend
A resource for target groups that belong to the backend.
targetGroupIds
: string
List of ID's of target groups that belong to the backend.
To get the ID's of all available target groups, make a TargetGroupService.List request.
StorageBucketBackend
A resource for Object Storage bucket used as a backend. For details about the concept, see documentation.
bucket
: string
Name of the bucket.
HealthCheck
A health check resource. For details about the concept, see documentation.
StreamHealthCheck
A resource for TCP stream health check settings.
send
: Payload
Message sent to targets during TCP data transfer.
If not specified, no data is sent to the target.
receive
: Payload
Data that must be contained in the messages received from targets for a successful health check.
If not specified, no messages are expected from targets, and those that are received are not checked.
HttpHealthCheck
A resource for HTTP health check settings.
host
: string
Value for the HTTP/1.1 Host
header or the HTTP/2 :authority
pseudo-header used in requests to targets.
path
: string
HTTP path used in requests to targets: request URI for HTTP/1.1 request line
or value for the HTTP/2 :path
pseudo-header.
useHttp2
: bool
Enables HTTP/2 usage in health checks.
Default value: false
, HTTP/1.1 is used.
GrpcHealthCheck
A resource for gRPC health check settings.
serviceName
: string
Name of the gRPC service to be checked.
If not specified, overall health is checked.
For details about the concept, see GRPC Health Checking Protocol.
timeout
: google.protobuf.Duration
Health check timeout.
The timeout is the time allowed for the target to respond to a check. If the target doesn't respond in time, the check is considered failed.
interval
: google.protobuf.Duration
Base interval between consecutive health checks.
intervalJitterPercent
: double
healthyThreshold
: int64
Number of consecutive successful health checks required to mark an unhealthy target as healthy.
Both 0
and 1
values amount to one successful check required.
The value is ignored when a load balancer is initialized; a target is marked healthy after one successful check.
Default value: 0
.
unhealthyThreshold
: int64
Number of consecutive failed health checks required to mark a healthy target as unhealthy.
Both 0
and 1
values amount to one unsuccessful check required.
The value is ignored if a health check is failed due to an HTTP 503 Service Unavailable
response from the target
(not applicable to TCP stream health checks). The target is immediately marked unhealthy.
Default value: 0
.
healthcheckPort
: int64
Port used for health checks.
If not specified, the backend port (HttpBackend.port or GrpcBackend.port) is used for health checks.
One of healthcheck
Protocol-specific health check settings.
The protocols of the backend and of its health check may differ, e.g. a gRPC health check may be specified for an HTTP backend.
stream
: StreamHealthCheckTCP stream health check settings.
http
: HttpHealthCheckHTTP health check settings.
grpc
: GrpcHealthCheckgRPC health check settings.
One of transportSettings
Optional transport protocol for health checks. When not set, health checks use the same protocol as the proxied traffic. Use this when health checks' protocol settings differ from their backend, e.g. plaintext health checks for a TLS backend.
plaintext
: PlaintextTransportSettings
tls
: SecureTransportSettings
BackendTls
A resource for backend TLS settings.
sni
: string
Server Name Indication (SNI) string for TLS connections.
validationContext
: ValidationContext
Validation context for TLS connections.
Payload
A health check payload resource.
One of payload
Payload.
text
: stringPayload text.
StreamHealthCheck
A resource for TCP stream health check settings.
send
: Payload
Message sent to targets during TCP data transfer.
If not specified, no data is sent to the target.
receive
: Payload
Data that must be contained in the messages received from targets for a successful health check.
If not specified, no messages are expected from targets, and those that are received are not checked.
HttpHealthCheck
A resource for HTTP health check settings.
host
: string
Value for the HTTP/1.1 Host
header or the HTTP/2 :authority
pseudo-header used in requests to targets.
path
: string
HTTP path used in requests to targets: request URI for HTTP/1.1 request line
or value for the HTTP/2 :path
pseudo-header.
useHttp2
: bool
Enables HTTP/2 usage in health checks.
Default value: false
, HTTP/1.1 is used.
GrpcHealthCheck
A resource for gRPC health check settings.
serviceName
: string
Name of the gRPC service to be checked.
If not specified, overall health is checked.
For details about the concept, see GRPC Health Checking Protocol.
PlaintextTransportSettings
Transport settings to be used instead of the settings configured per-cluster
SecureTransportSettings
Transport settings to be used instead of the settings configured per-cluster
sni
: string
SNI string for TLS connections.
validationContext
: ValidationContext
Validation context for backend TLS connections.
ValidationContext
A TLS validation context resource.
One of trustedCa
TLS certificate issued by a trusted certificate authority (CA).
trustedCaId
: string
trustedCaBytes
: stringX.509 certificate contents in PEM format.