Get
Returns the specified Network resource.
Get the list of available Network resources by making a List request.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.vpc.v1.network_service_pb2 import GetNetworkRequest
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.Get(GetNetworkRequest(network_id="networkId"))
print(response)
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.