Skip to main content

versions

Creates, updates, deletes, gets or lists a versions resource.

Overview

Nameversions
TypeResource
Idgoogle.secretmanager.versions

Fields

NameDatatypeDescription
namestringOutput only. The resource name of the SecretVersion in the format projects/*/secrets/*/versions/*. SecretVersion IDs in a Secret start at 1 and are incremented for each subsequent version of the secret.
clientSpecifiedPayloadChecksumbooleanOutput only. True if payload checksum specified in SecretPayload object has been received by SecretManagerService on SecretManagerService.AddSecretVersion.
createTimestringOutput only. The time at which the SecretVersion was created.
customerManagedEncryptionobjectDescribes the status of customer-managed encryption.
destroyTimestringOutput only. The time this SecretVersion was destroyed. Only present if state is DESTROYED.
etagstringOutput only. Etag of the currently stored SecretVersion.
replicationStatusobjectThe replication status of a SecretVersion.
scheduledDestroyTimestringOptional. Output only. Scheduled destroy time for secret version. This is a part of the Delayed secret version destroy feature. For a Secret with a valid version destroy TTL, when a secert version is destroyed, version is moved to disabled state and it is scheduled for destruction Version is destroyed only after the scheduled_destroy_time.
statestringOutput only. The current state of the SecretVersion.

Methods

NameAccessible byRequired ParamsDescription
getSELECTprojectsId, secretsId, versionsIdGets metadata for a SecretVersion. projects/*/secrets/*/versions/latest is an alias to the most recently created SecretVersion.
listSELECTprojectsId, secretsIdLists SecretVersions. This call does not return secret data.
destroyDELETEprojectsId, secretsId, versionsIdDestroys a SecretVersion. Sets the state of the SecretVersion to DESTROYED and irrevocably destroys the secret data.
accessEXECprojectsId, secretsId, versionsIdAccesses a SecretVersion. This call returns the secret data. projects/*/secrets/*/versions/latest is an alias to the most recently created SecretVersion.
disableEXECprojectsId, secretsId, versionsIdDisables a SecretVersion. Sets the state of the SecretVersion to DISABLED.
enableEXECprojectsId, secretsId, versionsIdEnables a SecretVersion. Sets the state of the SecretVersion to ENABLED.

SELECT examples

Lists SecretVersions. This call does not return secret data.

SELECT
name,
clientSpecifiedPayloadChecksum,
createTime,
customerManagedEncryption,
destroyTime,
etag,
replicationStatus,
scheduledDestroyTime,
state
FROM google.secretmanager.versions
WHERE projectsId = '{{ projectsId }}'
AND secretsId = '{{ secretsId }}';

DELETE example

Deletes the specified versions resource.

/*+ delete */
DELETE FROM google.secretmanager.versions
WHERE projectsId = '{{ projectsId }}'
AND secretsId = '{{ secretsId }}'
AND versionsId = '{{ versionsId }}';