Skip to main content

GetUsed

Returns the specified network used in serverless resources.

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);
})();

GetUsedNetworkRequest

networkId : string

ID of the network to return.

UsedNetwork

A VPC network used in serverless resources.

Status

  • STATUS_UNSPECIFIED

  • CREATING

    Network is connecting to its first serverless resource.

  • ACTIVE

    Network is already being used by some serverless resources.

  • OBSOLETE

    Network 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.