Skip to main content

Get

Returns the specified ServiceAccount resource.

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

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

const GetServiceAccountRequest =
cloudApi.iam.service_account_service.GetServiceAccountRequest;

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

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

GetServiceAccountRequest

serviceAccountId : string

ID of the ServiceAccount resource to return. To get the service account ID, use a ServiceAccountService.List request.

ServiceAccount

A ServiceAccount resource. For more information, see Service accounts.

id : string

ID of the service account.

folderId : string

ID of the folder that the service account belongs to.

createdAt : google.protobuf.Timestamp

Creation timestamp.

name : string

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

description : string

Description of the service account. 0-256 characters long.

labels : string

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

lastAuthenticatedAt : google.protobuf.Timestamp

Timestamp for the last authentication of this service account.