Get
Returns the specified access key.
To get the list of available access keys, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetAccessKeyRequest =
cloudApi.iam.awscompatibility_access_key_service.GetAccessKeyRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.AccessKeyServiceClient);
const result = await client.get(
GetAccessKeyRequest.fromPartial({
accessKeyId: "accessKeyId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.iam.v1.awscompatibility.access_key_service_pb2_grpc import AccessKeyServiceStub
from yandex.cloud.iam.v1.awscompatibility.access_key_service_pb2 import GetAccessKeyRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(AccessKeyServiceStub)
response = service.Get(GetAccessKeyRequest(access_key_id="accessKeyId"))
print(response)
GetAccessKeyRequest
accessKeyId
: string
ID of the AccessKey resource to return. To get the access key ID, use a AccessKeyService.List request.
AccessKey
An access key. For more information, see AWS-compatible access keys.
id
: string
ID of the AccessKey resource. It is used to manage secret credentials: an access key ID and a secret access key.
serviceAccountId
: string
ID of the service account that the access key belongs to.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
description
: string
Description of the access key. 0-256 characters long.
keyId
: string
ID of the access key. The key is AWS compatible.
lastUsedAt
: google.protobuf.Timestamp
Timestamp for the last authentication using this Access key.