Skip to main content

Get

Returns the specified Role resource.

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

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

const GetRoleRequest = cloudApi.iam.role_service.GetRoleRequest;

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

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

GetRoleRequest

roleId : string

ID of the Role resource to return. To get the role ID, use a RoleService.List request.

Role

A Role resource. For more information, see Roles.

id : string

ID of the role.

description : string

Description of the role. 0-256 characters long.