Skip to main content

api_credentials

Creates, updates, deletes, gets or lists an api_credentials resource.

Overview​

Nameapi_credentials
TypeResource
Idovh.me.api_credentials

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
application_idintegerID of associated API Application (wire: applicationId)
credential_idintegerID of this credential (wire: credentialId)
allowed_ipsarrayIf defined, list of ip blocks which are allowed to call API with this credential (wire: allowedIPs)
creationstring (date-time)Creation date of this credential
expirationstring (date-time)Expiration date of this credential
last_usestring (date-time)Last use date of this credential (wire: lastUse)
ovh_supportbooleanStates whether this credential has been created by yourself or by the OVH support team (wire: ovhSupport)
rulesarrayAPI routes allowed to this credential
statusstringState of to this credential (expired, pendingValidation, refused, validated)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcredential_idRetrieve information about a credential
listselectapplication_id, status, x_pagination_modeRetrieve all credentials
updateupdatecredential_idEdit a credential
deletedeletecredential_idDelete a credential

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_idintegerCredential ID (wire: credentialId)
application_idintegerFilter by applicationId (wire: applicationId)
statusstringFilter by status
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Retrieve information about a credential

SELECT
application_id,
credential_id,
allowed_ips,
creation,
expiration,
last_use,
ovh_support,
rules,
status
FROM ovh.me.api_credentials
WHERE credential_id = '{{ credential_id }}' -- required
;

UPDATE examples​

Edit a credential

UPDATE ovh.me.api_credentials
SET
allowed_ips = '{{ allowed_ips }}'
WHERE
credential_id = '{{ credential_id }}' --required;

DELETE examples​

Delete a credential

DELETE FROM ovh.me.api_credentials
WHERE credential_id = '{{ credential_id }}' --required
;