Get
Returns the specified connection info.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetConnectionRequest =
cloudApi.serverless.apigateway_websocket_connection_service
.GetConnectionRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ConnectionServiceClient);
const result = await client.get(
GetConnectionRequest.fromPartial({
connectionId: "connectionId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.apigateway.websocket.v1.connection_service_pb2_grpc import (
ConnectionServiceStub,
)
from yandex.cloud.serverless.apigateway.websocket.v1.connection_service_pb2 import (
GetConnectionRequest,
)
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ConnectionServiceStub)
response = service.Get(GetConnectionRequest(connection_id="connectionId"))
print(response)
GetConnectionRequest
connectionId
: string
ID of the connection to get.
Connection
id
: string
ID of the connection.
gatewayId
: string
ID of the API Gateway.
identity
: Identity
The information about the caller making the request to API Gateway.
connectedAt
: google.protobuf.Timestamp
The timestamp at which connection was established.
lastActiveAt
: google.protobuf.Timestamp
The timestamp at which connection was last accessed.
Identity
sourceIp
: string
The source IP address of the caller making the request to API Gateway.
userAgent
: string
The User Agent of the caller making the request to API Gateway.