Skip to main content

Get

Returns the payload of the specified secret.

To get the list of all available secrets, make a SecretService.List request.

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

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.

  • textValue : string​

    Text value.

  • binaryValue : bytes​

    Binary value.

versionId : string​

ID of the version that the payload belongs to.

entries : Entry​

Payload entries.

Entry​

key : string​

Non-confidential key of the entry.

  • textValue : string​

    Text value.

  • binaryValue : bytes​

    Binary value.