ListUsed
Retrieves the list of networks in the specified scope that are used in serverless resources.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListUsedNetworksRequest =
cloudApi.serverless.functions_network_service.ListUsedNetworksRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.NetworkServiceClient);
const result = await client.listUsed(
ListUsedNetworksRequest.fromPartial({
// pageSize: 0,
// pageToken: "pageToken",
// cloudId: "cloudId",
// folderId: "folderId"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.serverless.functions.v1.network_service_pb2 import ListUsedNetworksRequest
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.ListUsed(
ListUsedNetworksRequest(
# page_size = 0,
# page_token = "pageToken",
# cloud_id = "cloudId",
# folder_id = "folderId"
)
)
print(response)
ListUsedNetworksRequest
pageSize : int64
The maximum number of results per page to return. If the number of available
results is larger than pageSize, the service returns a ListUsedNetworksResponse.next_page_token
that can be used to get the next page of results in subsequent list requests.
Default value: 100.
pageToken : string
Page token. To get the next page of results, set pageToken to the
ListUsedNetworksResponse.next_page_token returned by a previous list request.
One of scope
cloudId: stringID of the cloud to list used networks in.
folderId: stringID of the folder to list used networks in.
ListUsedNetworksResponse
networks : UsedNetwork
List of used networks in the specified scope.
nextPageToken : string
Token for getting the next page of the list. If the number of results is greater than
the specified ListUsedNetworksRequest.page_size, use nextPageToken as the value
for the ListUsedNetworksRequest.page_token parameter in the next list request.
Each subsequent page will have its own nextPageToken to continue paging through the results.
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.