List
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListUserSshKeysRequest =
cloudApi.organizationmanager.user_ssh_key_service.ListUserSshKeysRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.UserSshKeyServiceClient);
const result = await client.list(
ListUserSshKeysRequest.fromPartial({
organizationId: "organizationId",
// subjectId: "subjectId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.organizationmanager.v1.user_ssh_key_service_pb2 import ListUserSshKeysRequest
from yandex.cloud.organizationmanager.v1.user_ssh_key_service_pb2_grpc import UserSshKeyServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(UserSshKeyServiceStub)
response = service.List(
ListUserSshKeysRequest(
organization_id="organizationId",
# subject_id = "subjectId",
# page_size = 0,
# page_token = "pageToken"
)
)
print(response)
ListUserSshKeysRequest
organizationId : string
subjectId : string
if empty, list all organization keys
pageSize : int64
pageToken : string
ListUserSshKeysResponse
sshKeys : UserSshKey
nextPageToken : string
UserSshKey
id : string
subjectId : string
data : string
name : string
fingerprint : string
organizationId : string
createdAt : google.protobuf.Timestamp
expiresAt : google.protobuf.Timestamp
Used for temporary keys, if empty the key doesn't expire