Skip to main content

Get

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const GetUserSshKeyRequest =
cloudApi.organizationmanager.user_ssh_key_service.GetUserSshKeyRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.UserSshKeyServiceClient);

const result = await client.get(
GetUserSshKeyRequest.fromPartial({
userSshKeyId: "userSshKeyId",
})
);
console.log(result);
})();

GetUserSshKeyRequest

userSshKeyId : 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