Skip to main content

List

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);
})();

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