Get
Returns the specified NetworkLoadBalancer resource.
Get the list of available NetworkLoadBalancer resources by making a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetNetworkLoadBalancerRequest =
cloudApi.loadbalancer.network_load_balancer_service
.GetNetworkLoadBalancerRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(
serviceClients.NetworkLoadBalancerServiceClient
);
const result = await client.get(
GetNetworkLoadBalancerRequest.fromPartial({
// networkLoadBalancerId: "networkLoadBalancerId"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.loadbalancer.v1.network_load_balancer_service_pb2 import (
GetNetworkLoadBalancerRequest,
)
from yandex.cloud.loadbalancer.v1.network_load_balancer_service_pb2_grpc import (
NetworkLoadBalancerServiceStub,
)
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(NetworkLoadBalancerServiceStub)
response = service.Get(
GetNetworkLoadBalancerRequest(
# network_load_balancer_id = "networkLoadBalancerId"
)
)
print(response)
GetNetworkLoadBalancerRequest
networkLoadBalancerId
: string
ID of the NetworkLoadBalancer resource to return. To get the network load balancer ID, use a NetworkLoadBalancerService.List request.
NetworkLoadBalancer
A NetworkLoadBalancer resource. For more information, see Network Load Balancer.
Status
STATUS_UNSPECIFIED
CREATING
Network load balancer is being created.
STARTING
Network load balancer is being started.
ACTIVE
Network load balancer is active and sends traffic to the targets.
STOPPING
Network load balancer is being stopped.
STOPPED
Network load balancer is stopped and doesn't send traffic to the targets.
DELETING
Network load balancer is being deleted.
INACTIVE
The load balancer doesn't have any listeners or target groups, or attached target groups are empty. The load balancer doesn't perform any health checks or send traffic in this state.
Type
TYPE_UNSPECIFIED
EXTERNAL
External network load balancer.
INTERNAL
Internal network load balancer.
SessionAffinity
Type of session affinity. Only 5-tuple affinity is currently available. For more information, see Load Balancer concepts.
SESSION_AFFINITY_UNSPECIFIED
Type of session affinity. Only 5-tuple affinity is currently available. For more information, see Load Balancer concepts.
CLIENT_IP_PORT_PROTO
5-tuple affinity.
id
: string
ID of the network load balancer.
folderId
: string
ID of the folder that the network load balancer belongs to.
createdAt
: google.protobuf.Timestamp
Creation timestamp in RFC3339 text format.
name
: string
Name of the network load balancer. The name is unique within the folder. 3-63 characters long.
description
: string
Optional description of the network load balancer. 0-256 characters long.
labels
: string
Resource labels as key:value
pairs. Maximum of 64 per resource.
regionId
: string
ID of the region that the network load balancer belongs to.
status
: Status
Status of the network load balancer.
type
: Type
Type of the network load balancer. Only external network load balancers are available now.
sessionAffinity
: SessionAffinity
Type of the session affinity. Only 5-tuple affinity is available now.
listeners
: Listener
List of listeners for the network load balancer.
attachedTargetGroups
: AttachedTargetGroup
List of target groups attached to the network load balancer.
deletionProtection
: bool
Specifies if network load balancer protected from deletion.
Listener
A Listener resource. For more information, see Listener
Protocol
Network protocol to use.
PROTOCOL_UNSPECIFIED
Network protocol to use.
TCP
Network protocol to use.
UDP
Network protocol to use.
name
: string
Name of the listener. The name must be unique for each listener on a single load balancer. 3-63 characters long.
address
: string
IP address for the listener.
port
: int64
Port.
protocol
: Protocol
Network protocol for incoming traffic.
targetPort
: int64
Port of a target.
subnetId
: string
ID of the subnet.
ipVersion
: IpVersion
IP version of the external address.
AttachedTargetGroup
An AttachedTargetGroup resource. For more information, see Targets and groups.
targetGroupId
: string
ID of the target group.
healthChecks
: HealthCheck
A health check to perform on the target group. For now we accept only one health check per AttachedTargetGroup.
HealthCheck
A HealthCheck resource. For more information, see Health check.
TcpOptions
Configuration option for a TCP health check.
port
: int64
Port to use for TCP health checks.
HttpOptions
Configuration option for an HTTP health check.
port
: int64
Port to use for HTTP health checks.
path
: string
URL path to set for health checking requests for every target in the target group.
For example /ping
. The default path is /
.
name
: string
Name of the health check. The name must be unique for each target group that attached to a single load balancer. 3-63 characters long.
interval
: google.protobuf.Duration
The interval between health checks. The default is 2 seconds.
timeout
: google.protobuf.Duration
Timeout for a target to return a response for the health check. The default is 1 second.
unhealthyThreshold
: int64
Number of failed health checks before changing the status to UNHEALTHY
. The default is 2.
healthyThreshold
: int64
Number of successful health checks required in order to set the HEALTHY
status for the target. The default is 2.
One of options
Protocol to use for the health check. Either TCP or HTTP.
tcpOptions
: TcpOptionsOptions for TCP health check.
httpOptions
: HttpOptionsOptions for HTTP health check.
TcpOptions
Configuration option for a TCP health check.
port
: int64
Port to use for TCP health checks.
HttpOptions
Configuration option for an HTTP health check.
port
: int64
Port to use for HTTP health checks.
path
: string
URL path to set for health checking requests for every target in the target group.
For example /ping
. The default path is /
.