Skip to main content

resource_secret_versions

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

Overview​

Nameresource_secret_versions
TypeResource
Idovh.okms.resource_secret_versions

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerSecret version
created_atstring (date-time)Time of creation of the secret version (wire: createdAt)
dataSecret version data (example: This is a content of any type !)
deactivated_atstring (date-time)Time of deactivation of the secret version (wire: deactivatedAt)
statestringState of the secret version (ACTIVE, DEACTIVATED, DELETED)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectokms_id, path, versioninclude_dataReturns one version's metadata. Set includeData=true to also return the version data.<br /><br />Reading the data requires a specific IAM right.
listselectokms_id, pathx_pagination_cursor, x_pagination_sizeLists version numbers and states for the secret. Version data is not returned by this API.
createinsertokms_id, path, datacasAppends a new version of the secret data. Optional cas must match the current version or the write is rejected.
updateupdateokms_id, path, version, stateChanges 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.

NameDatatypeDescription
api_hoststringThe 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_idstring (uuid)Okms ID (wire: okmsId)
pathstringPath
versionintegerVersion
casintegerCurrent 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_databooleanSecret version data (wire: includeData)
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

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 }}'
;

INSERT examples​

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
;

UPDATE examples​

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;