api_credentials
Creates, updates, deletes, gets or lists an api_credentials resource.
Overview​
| Name | api_credentials |
| Type | Resource |
| Id | ovh.me.api_credentials |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
application_id | integer | ID of associated API Application (wire: applicationId) |
credential_id | integer | ID of this credential (wire: credentialId) |
allowed_ips | array | If defined, list of ip blocks which are allowed to call API with this credential (wire: allowedIPs) |
creation | string (date-time) | Creation date of this credential |
expiration | string (date-time) | Expiration date of this credential |
last_use | string (date-time) | Last use date of this credential (wire: lastUse) |
ovh_support | boolean | States whether this credential has been created by yourself or by the OVH support team (wire: ovhSupport) |
rules | array | API routes allowed to this credential |
status | string | State of to this credential (expired, pendingValidation, refused, validated) |
API Credential
| Name | Datatype | Description |
|---|---|---|
application_id | integer | ID of associated API Application (wire: applicationId) |
credential_id | integer | ID of this credential (wire: credentialId) |
allowed_ips | array | If defined, list of ip blocks which are allowed to call API with this credential (wire: allowedIPs) |
creation | string (date-time) | Creation date of this credential |
expiration | string (date-time) | Expiration date of this credential |
last_use | string (date-time) | Last use date of this credential (wire: lastUse) |
ovh_support | boolean | States whether this credential has been created by yourself or by the OVH support team (wire: ovhSupport) |
rules | array | API routes allowed to this credential |
status | string | State of to this credential (expired, pendingValidation, refused, validated) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | credential_id | Retrieve information about a credential | |
list | select | application_id, status, x_pagination_mode | Retrieve all credentials | |
update | update | credential_id | Edit a credential | |
delete | delete | credential_id | Delete 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.
| 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"}}) |
credential_id | integer | Credential ID (wire: credentialId) |
application_id | integer | Filter by applicationId (wire: applicationId) |
status | string | Filter by status |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
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
;
Retrieve all credentials
SELECT
application_id,
credential_id,
allowed_ips,
creation,
expiration,
last_use,
ovh_support,
rules,
status
FROM ovh.me.api_credentials
WHERE application_id = '{{ application_id }}'
AND status = '{{ status }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
UPDATE examples​
- update
Edit a credential
UPDATE ovh.me.api_credentials
SET
allowed_ips = '{{ allowed_ips }}'
WHERE
credential_id = '{{ credential_id }}' --required;
DELETE examples​
- delete
Delete a credential
DELETE FROM ovh.me.api_credentials
WHERE credential_id = '{{ credential_id }}' --required
;