List
Retrieves the list of access keys for the specified service account.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListAccessKeysRequest =
cloudApi.iam.awscompatibility_access_key_service.ListAccessKeysRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.AccessKeyServiceClient);
const result = await client.list(
ListAccessKeysRequest.fromPartial({
// serviceAccountId: "serviceAccountId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
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 ListAccessKeysRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(AccessKeyServiceStub)
response = service.List(
ListAccessKeysRequest(
# service_account_id = "serviceAccountId",
# page_size = 0,
# page_token = "pageToken"
)
)
print(response)
ListAccessKeysRequest
serviceAccountId
: string
ID of the service account to list access keys for. To get the service account ID, use a yandex.cloud.iam.v1.ServiceAccountService.List request. If not specified, it defaults to the subject that made the request.
pageSize
: int64
The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListAccessKeysResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100.
pageToken
: string
Page token. To get the next page of results, set page_token to the ListAccessKeysResponse.next_page_token returned by a previous list request.
ListAccessKeysResponse
accessKeys
: AccessKey
List of access keys.
nextPageToken
: string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListAccessKeysRequest.page_size, use the next_page_token as the value for the ListAccessKeysRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.
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.