Get
Returns the specified ServiceAccount resource.
To get the list of available ServiceAccount resources, make a List request.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.iam.v1.service_account_service_pb2 import GetServiceAccountRequest
from yandex.cloud.iam.v1.service_account_service_pb2_grpc import ServiceAccountServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ServiceAccountServiceStub)
response = service.Get(GetServiceAccountRequest(service_account_id="serviceAccountId"))
print(response)
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.