Get
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.organizationmanager.v1.user_ssh_key_service_pb2 import GetUserSshKeyRequest
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.Get(GetUserSshKeyRequest(user_ssh_key_id="userSshKeyId"))
print(response)
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