resource_secret_versions
Creates, updates, deletes, gets or lists a resource_secret_versions resource.
Overview​
| Name | resource_secret_versions |
| Type | Resource |
| Id | ovh.okms.resource_secret_versions |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | Secret version |
created_at | string (date-time) | Time of creation of the secret version (wire: createdAt) |
data | | Secret version data (example: This is a content of any type !) |
deactivated_at | string (date-time) | Time of deactivation of the secret version (wire: deactivatedAt) |
state | string | State of the secret version (ACTIVE, DEACTIVATED, DELETED) |
An OKMS secret version
| Name | Datatype | Description |
|---|---|---|
id | integer | Secret version |
created_at | string (date-time) | Time of creation of the secret version (wire: createdAt) |
data | | Secret version data (example: This is a content of any type !) |
deactivated_at | string (date-time) | Time of deactivation of the secret version (wire: deactivatedAt) |
state | string | State of the secret version (ACTIVE, DEACTIVATED, DELETED) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | okms_id, path, version | include_data | Returns one version's metadata. Set includeData=true to also return the version data.<br /><br />Reading the data requires a specific IAM right. |
list | select | okms_id, path | x_pagination_cursor, x_pagination_size | Lists version numbers and states for the secret. Version data is not returned by this API. |
create | insert | okms_id, path, data | cas | Appends a new version of the secret data. Optional cas must match the current version or the write is rejected. |
update | update | okms_id, path, version, state | Changes the version state: activate, deactivate, or delete.<br /><br />To modify the secret data, create a new version. |
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 |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
okms_id | string (uuid) | Okms ID (wire: okmsId) |
path | string | Path |
version | integer | Version |
cas | integer | Current secret version number. When the cas (Check and set) is specified, the current version of the secret is verified before updating it. In order for a write to be successful,cas must be set to the current version of the secret. |
include_data | boolean | Secret version data (wire: includeData) |
x_pagination_cursor | string | Pagination cursor (wire: X-Pagination-Cursor) |
x_pagination_size | integer | Pagination size (wire: X-Pagination-Size) |
SELECT examples​
- get
- list
Returns one version's metadata. Set includeData=true to also return the version data.<br /><br />Reading the data requires a specific IAM right.
SELECT
id,
created_at,
data,
deactivated_at,
state
FROM ovh.okms.resource_secret_versions
WHERE okms_id = '{{ okms_id }}' -- required
AND path = '{{ path }}' -- required
AND version = '{{ version }}' -- required
AND include_data = '{{ include_data }}'
;
Lists version numbers and states for the secret. Version data is not returned by this API.
SELECT
id,
created_at,
data,
deactivated_at,
state
FROM ovh.okms.resource_secret_versions
WHERE okms_id = '{{ okms_id }}' -- required
AND path = '{{ path }}' -- required
AND x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
;
INSERT examples​
- create
- Manifest
Appends a new version of the secret data. Optional cas must match the current version or the write is rejected.
INSERT INTO ovh.okms.resource_secret_versions (
data,
okms_id,
path,
cas
)
SELECT
'{{ data }}' /* required */,
'{{ okms_id }}',
'{{ path }}',
'{{ cas }}'
RETURNING
id,
created_at,
data,
deactivated_at,
state
;
# Description fields are for documentation purposes
- name: resource_secret_versions
props:
- name: okms_id
value: "{{ okms_id }}"
description: Required parameter for the resource_secret_versions resource.
- name: path
value: "{{ path }}"
description: Required parameter for the resource_secret_versions resource.
- name: data
value: "{{ data }}"
description: |
Secret version data in key value json format
- name: cas
value: {{ cas }}
description: Current secret version number. When the `cas` (Check and set) is specified, the current version of the secret is verified before updating it. In order for a write to be successful,`cas` must be set to the current version of the secret.
description: Current secret version number. When the `cas` (Check and set) is specified, the current version of the secret is verified before updating it. In order for a write to be successful,`cas` must be set to the current version of the secret.
UPDATE examples​
- update
Changes the version state: activate, deactivate, or delete.<br /><br />To modify the secret data, create a new version.
UPDATE ovh.okms.resource_secret_versions
SET
state = '{{ state }}'
WHERE
okms_id = '{{ okms_id }}' --required
AND path = '{{ path }}' --required
AND version = '{{ version }}' --required
AND state = '{{ state }}' --required
RETURNING
id,
created_at,
deactivated_at,
state;