secret_versions
Creates, updates, deletes, gets or lists a secret_versions resource.
Overview​
| Name | secret_versions |
| Type | Resource |
| Id | oci.vault.secret_versions |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The specified secret version object.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the secret version. A name is unique across versions of a secret. |
contentType | string | The content type of the secret version's secret contents. (BASE64) |
isContentAutoGenerated | boolean | Boolean flag indicating whether secret content for this secret version was auto-generated or not. |
secretId | string | The OCID of the secret. |
stages | array | A 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. |
timeCreated | string (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 |
timeOfCurrentVersionExpiry | string (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 |
timeOfDeletion | string (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 |
versionNumber | integer (int64) | The version number of the secret. |
The secret version summary object, which doesn't include the contents of the secret.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the secret version. A name is unique across versions of a secret. |
contentType | string | The content type of the secret version's secret contents. (BASE64) |
isContentAutoGenerated | boolean | Boolean flag indicating whether secret content for this secret version was auto-generated or not. |
secretId | string | The OCID of the secret. |
stages | array | A 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. |
systemTags | object | System tags for this resource. Each key is predefined and scoped to a namespace. Example: {"orcl-cloud": {"free-tier-retained": "true"}} |
timeCreated | string (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 |
timeOfDeletion | string (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 |
timeOfExpiry | string (date-time) | An optional property indicating when the secret version will expire, expressed in [RFC 3339](https:​//tools.ietf.org/html/rfc3339) timestamp format. Example: 2019-04-03T21:10:29.600Z |
versionNumber | integer (int64) | The version number of the secret. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | secretId, secretVersionNumber, region | opc-request-id | Gets information about the specified version of a secret.<br /> |
list | select | secretId, region | limit, page, opc-request-id, sortBy, sortOrder | Lists 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.
| Name | Datatype | Description |
|---|---|---|
region | string | OCI 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) |
secretId | string | The OCID of the secret. |
secretVersionNumber | integer (int64) | The version number of the secret. |
limit | integer | The maximum number of items to return in a paginated "List" call. |
opc-request-id | string | Unique 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. |
page | string | The value of the opc-next-page response header from the previous "List" call. |
sortBy | string | The 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. |
sortOrder | string | The sort order to use, either ascending (ASC) or descending (DESC). |
SELECT examples​
- get
- list
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 }}'
;
Lists all secret versions for the specified secret.
SELECT
name,
contentType,
isContentAutoGenerated,
secretId,
stages,
systemTags,
timeCreated,
timeOfDeletion,
timeOfExpiry,
versionNumber
FROM oci.vault.secret_versions
WHERE secretId = '{{ secretId }}' -- required
AND region = '{{ region }}' -- required
AND limit = '{{ limit }}'
AND page = '{{ page }}'
AND opc-request-id = '{{ opc-request-id }}'
AND sortBy = '{{ sortBy }}'
AND sortOrder = '{{ sortOrder }}'
;