Skip to main content

ListVersions

Retrieves the list of versions of the specified secret.

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

const ListVersionsRequest =
cloudApi.certificatemanager.certificate_service.ListVersionsRequest;

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

const result = await client.listVersions(
ListVersionsRequest.fromPartial({
certificateId: "certificateId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();

ListVersionsRequest

secretId : string

ID of the secret to list versions for.

pageSize : int64

The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListVersionsRequest.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100.

pageToken : string

Page token. To get the next page of results, set page_token to the ListVersionsRequest.next_page_token returned by a previous list request.

ListVersionsResponse

versions : Version

List of versions for the specified secret.

nextPageToken : string

This token allows you to get the next page of results for list requests. If the number of results is greater than the specified ListVersionsRequest.page_size, use the next_page_token as the value for the ListVersionsRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.

Version

Status
  • STATUS_UNSPECIFIED

  • ACTIVE

    The version is active and the secret payload can be accessed.

  • SCHEDULED_FOR_DESTRUCTION

    The version is scheduled for destruction, the time when it will be destroyed is specified in the [Version.destroy_at][5] field.

  • DESTROYED

    The version is destroyed and cannot be recovered.

id : string

ID of the version.

secretId : string

ID of the secret that the version belongs to.

createdAt : google.protobuf.Timestamp

Time when the version was created.

destroyAt : google.protobuf.Timestamp

Time when the version is going to be destroyed. Empty unless the status is SCHEDULED_FOR_DESTRUCTION.

description : string

Description of the version.

status : Status

Status of the secret.

payloadEntryKeys : string

Keys of the entries contained in the version payload.

One of payloadSpecification

  • passwordPayloadSpecification : PasswordPayloadSpecification

PasswordPayloadSpecification

passwordKey : string

key of the entry to store generated password value

length : int64

password length; by default, a reasonable length will be decided

includeUppercase : google.protobuf.BoolValue

whether at least one A..Z character is included in the password, true by default

includeLowercase : google.protobuf.BoolValue

whether at least one a..z character is included in the password, true by default

includeDigits : google.protobuf.BoolValue

whether at least one 0..9 character is included in the password, true by default

includePunctuation : google.protobuf.BoolValue

whether at least one punctuation character is included in the password, true by default punctuation characters by default (there are 32): !"#$%&'()*+,-./:;<=>?@[]6^_`{|}~ to customize the punctuation characters, see included_punctuation and excluded_punctuation below

includedPunctuation : string

If include_punctuation is true, one of these two fields (not both) may be used optionally to customize the punctuation: a string of specific punctuation characters to use (at most, all the 32)

excludedPunctuation : string

a string of punctuation characters to exclude from the default (at most 31, it's not allowed to exclude all the 32)