GetUsed
Returns the specified network used in serverless resources.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetUsedNetworkRequest =
cloudApi.serverless.functions_network_service.GetUsedNetworkRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.NetworkServiceClient);
const result = await client.getUsed(
GetUsedNetworkRequest.fromPartial({
networkId: "networkId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.functions.v1.network_service_pb2 import GetUsedNetworkRequest
from yandex.cloud.serverless.functions.v1.network_service_pb2_grpc import NetworkServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(NetworkServiceStub)
response = service.GetUsed(GetUsedNetworkRequest(network_id="networkId"))
print(response)
GetUsedNetworkRequest
networkId : string
ID of the network to return.
UsedNetwork
A VPC network used in serverless resources.
Status
STATUS_UNSPECIFIEDCREATINGNetwork is connecting to its first serverless resource.
ACTIVENetwork is already being used by some serverless resources.
OBSOLETENetwork is no longer used by any serverless resources. It will be cleaned-up after a while.
networkId : string
ID of the VPC network.
cloudId : string
ID of the cloud that the network belongs to.
folderId : string
ID of the folder that the network belongs to.
status : Status
Status of the network.
willBeCleanedUpAt : google.protobuf.Timestamp
Clean-up timestamp of the obsolete network.
connectionsCount : int64
Number of serverless resources connected to the network.