Get
Returns the payload of the specified secret.
To get the list of all available secrets, make a SecretService.List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetPayloadRequest = cloudApi.lockbox.payload_service.GetPayloadRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.PayloadServiceClient);
const result = await client.get(
GetPayloadRequest.fromPartial({
secretId: "secretId",
// versionId: "versionId"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.lockbox.v1.payload_service_pb2 import GetPayloadRequest
from yandex.cloud.lockbox.v1.payload_service_pb2_grpc import PayloadServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(PayloadServiceStub)
response = service.Get(
GetPayloadRequest(
secret_id="secretId",
# version_id = "versionId"
)
)
print(response)
GetPayloadRequest
secretId
: string
ID of the secret.
versionId
: string
Optional ID of the version.
Payload
A payload.
Entry
key
: string
Non-confidential key of the entry.
One of value
Confidential value of the entry.
versionId
: string
ID of the version that the payload belongs to.
entries
: Entry
Payload entries.
Entry
key
: string
Non-confidential key of the entry.