Skip to main content

resource_credentials

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

Overview​

Nameresource_credentials
TypeResource
Idovh.okms.resource_credentials

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Unique identifier of the credential
namestringName of the credential
certificate_pemstringCertificate PEM of the credential (wire: certificatePEM)
certificate_typestringType of the certificate (ECDSA or RSA) (ECDSA, RSA) (wire: certificateType)
created_atstring (date-time)Creation time of the credential (wire: createdAt)
descriptionstringDescription of the credential
expired_atstring (date-time)Expiration time of the credential (wire: expiredAt)
from_csrbooleanIs the credential generated from CSR (wire: fromCSR)
identity_urnsarrayList of identity URNs associated with the credential (wire: identityURNs)
statusstringStatus of the credential (CREATING, DELETING, ERROR, EXPIRED, READY)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcredential_id, okms_idReturns the metadata and certificate of an access credential. The private key is returned only when the credential is created and can never be retrieved afterward.
listselectokms_idx_pagination_cursor, x_pagination_sizeReturns the access credentials of the service, with their identity, status and expiry. Private keys are never returned.
createinsertokms_id, identity_urns, nameIssues a certificate-based access credential bound to the given identity URNs.<br /><br />With a CSR, only the signed certificate is produced. Without one, a key pair is generated and the private key is returned in this response only. It can never be retrieved afterward.
deletedeletecredential_id, okms_idRevokes the credential and removes it. It can no longer be used to authenticate to the KMS.

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"}})
credential_idstring (uuid)Credential ID (wire: credentialId)
okms_idstring (uuid)Okms ID (wire: okmsId)
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns the metadata and certificate of an access credential. The private key is returned only when the credential is created and can never be retrieved afterward.

SELECT
id,
name,
certificate_pem,
certificate_type,
created_at,
description,
expired_at,
from_csr,
identity_urns,
status
FROM ovh.okms.resource_credentials
WHERE credential_id = '{{ credential_id }}' -- required
AND okms_id = '{{ okms_id }}' -- required
;

INSERT examples​

Issues a certificate-based access credential bound to the given identity URNs.<br /><br />With a CSR, only the signed certificate is produced. Without one, a key pair is generated and the private key is returned in this response only. It can never be retrieved afterward.

INSERT INTO ovh.okms.resource_credentials (
certificate_type,
csr,
description,
identity_urns,
name,
validity,
okms_id
)
SELECT
'{{ certificate_type }}',
'{{ csr }}',
'{{ description }}',
'{{ identity_urns }}' /* required */,
'{{ name }}' /* required */,
{{ validity }},
'{{ okms_id }}'
RETURNING
id,
name,
certificate_type,
created_at,
description,
expired_at,
from_csr,
identity_urns,
private_key_pem,
status
;

DELETE examples​

Revokes the credential and removes it. It can no longer be used to authenticate to the KMS.

DELETE FROM ovh.okms.resource_credentials
WHERE credential_id = '{{ credential_id }}' --required
AND okms_id = '{{ okms_id }}' --required
;