Skip to main content

Get

Returns the specified Network resource.

Get the list of available Network resources by making a List request.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const GetNetworkRequest = cloudApi.vpc.network_service.GetNetworkRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.NetworkServiceClient);

const result = await client.get(
GetNetworkRequest.fromPartial({
networkId: "networkId",
})
);
console.log(result);
})();

GetNetworkRequest

networkId : string

ID of the Network resource to return. To get the network ID, use a NetworkService.List request.

Network

A Network resource. For more information, see Networks.

id : string

ID of the network.

folderId : string

ID of the folder that the network belongs to.

createdAt : google.protobuf.Timestamp

Creation timestamp in RFC3339 text format.

name : string

Name of the network. The name is unique within the folder. Value must match the regular expression \|[a-zA-Z]([-_a-zA-Z0-9]{0,61}[a-zA-Z0-9])?.

description : string

Optional description of the network. 0-256 characters long.

labels : string

Resource labels as key:value pairs. No more than 64 per resource. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z]*. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]*.

defaultSecurityGroupId : string

ID of default security group for network.