Skip to main content

secret_versions

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

Overview​

Namesecret_versions
TypeResource
Idoci.vault.secret_versions

Fields​

The following fields are returned by SELECT queries:

The specified secret version object.

NameDatatypeDescription
namestringThe name of the secret version. A name is unique across versions of a secret.
contentTypestringThe content type of the secret version's secret contents. (BASE64)
isContentAutoGeneratedbooleanBoolean flag indicating whether secret content for this secret version was auto-generated or not.
secretIdstringThe OCID of the secret.
stagesarrayA list of possible rotation states for the secret version. A secret version marked CURRENT is currently in use. A secret version marked PENDING is staged and available for use, but has not been applied on the target system and, therefore, has not been rotated into current, active use. The secret most recently uploaded to a vault is always marked LATEST. (The first version of a secret is always marked as both CURRENT and LATEST.) A secret version marked PREVIOUS is the secret version that was most recently marked CURRENT, before the last secret version rotation. A secret version marked DEPRECATED is neither current, pending, nor the previous one in use. Only secret versions marked DEPRECATED can be scheduled for deletion.
timeCreatedstring (date-time)A optional property indicating when the secret version was created, expressed in [RFC 3339](https:​//tools.ietf.org/html/rfc3339) timestamp format. Example: 2019-04-03T21:10:29.600Z
timeOfCurrentVersionExpirystring (date-time)An optional property indicating when the current secret version will expire, expressed in [RFC 3339](https:​//tools.ietf.org/html/rfc3339) timestamp format. Example: 2019-04-03T21:10:29.600Z
timeOfDeletionstring (date-time)An optional property indicating when to delete the secret version, expressed in [RFC 3339](https:​//tools.ietf.org/html/rfc3339) timestamp format. Example: 2019-04-03T21:10:29.600Z
versionNumberinteger (int64)The version number of the secret.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsecretId, secretVersionNumber, regionopc-request-idGets information about the specified version of a secret.<br />
listselectsecretId, regionlimit, page, opc-request-id, sortBy, sortOrderLists all secret versions for the specified secret.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
secretIdstringThe OCID of the secret.
secretVersionNumberinteger (int64)The version number of the secret.
limitintegerThe maximum number of items to return in a paginated "List" call.
opc-request-idstringUnique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.
pagestringThe value of the opc-next-page response header from the previous "List" call.
sortBystringThe field to sort by. Only one sort order may be provided. Time created is default ordered as descending. Display name is default ordered as ascending.
sortOrderstringThe sort order to use, either ascending (ASC) or descending (DESC).

SELECT examples​

Gets information about the specified version of a secret.<br />

SELECT
name,
contentType,
isContentAutoGenerated,
secretId,
stages,
timeCreated,
timeOfCurrentVersionExpiry,
timeOfDeletion,
versionNumber
FROM oci.vault.secret_versions
WHERE secretId = '{{ secretId }}' -- required
AND secretVersionNumber = '{{ secretVersionNumber }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;