Skip to main content

Get

Returns the specified Folder resource.

To get the list of available Folder resources, make a List request.

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

const GetFolderRequest =
cloudApi.resourcemanager.folder_service.GetFolderRequest;

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

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

GetFolderRequest

folderId : string

ID of the Folder resource to return. To get the folder ID, use a FolderService.List request.

Folder

A Folder resource. For more information, see Folder.

Status

  • STATUS_UNSPECIFIED

  • ACTIVE

    The folder is active.

  • DELETING

    The folder is being deleted.

  • PENDING_DELETION

    Stopping folder resources and waiting for the deletion start timestamp.

id : string

ID of the folder.

cloudId : string

ID of the cloud that the folder belongs to.

createdAt : google.protobuf.Timestamp

Creation timestamp.

name : string

Name of the folder. The name is unique within the cloud. 3-63 characters long.

description : string

Description of the folder. 0-256 characters long.

labels : string

Resource labels as key:value pairs. Maximum of 64 per resource.

status : Status

Status of the folder.