ovh_accounts
Creates, updates, deletes, gets or lists an ovh_accounts resource.
Overview​
| Name | ovh_accounts |
| Type | Resource |
| Id | ovh.me.ovh_accounts |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
ovh_account_id | string | (wire: ovhAccountId) |
alert_threshold | integer | (wire: alertThreshold) |
available_after_credit | object | Price with its currency and textual representation (wire: availableAfterCredit) |
balance | object | Price with its currency and textual representation |
can_be_credited | boolean | (wire: canBeCredited) |
is_active | boolean | (wire: isActive) |
last_update | string (date-time) | (wire: lastUpdate) |
open_date | string (date-time) | (wire: openDate) |
retrievable_amount | object | Price with its currency and textual representation (wire: retrievableAmount) |
Details about an OVH account
| Name | Datatype | Description |
|---|---|---|
ovh_account_id | string | (wire: ovhAccountId) |
alert_threshold | integer | (wire: alertThreshold) |
available_after_credit | object | Price with its currency and textual representation (wire: availableAfterCredit) |
balance | object | Price with its currency and textual representation |
can_be_credited | boolean | (wire: canBeCredited) |
is_active | boolean | (wire: isActive) |
last_update | string (date-time) | (wire: lastUpdate) |
open_date | string (date-time) | (wire: openDate) |
retrievable_amount | object | Price with its currency and textual representation (wire: retrievableAmount) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | ovh_account_id | Get this object properties | |
list | select | x_pagination_mode | List of OVH accounts the logged account has | |
update | update | ovh_account_id | Alter this object properties | |
credit_order | exec | ovhAccountId, amount | Generate an order that can be paid in order to credit the OVH account | |
retrieve_money | exec | ovhAccountId, amount, bankAccountId | Transfer money from ovhAccount to your bank account |
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"}}) |
ovhAccountId | string | |
ovh_account_id | string | (wire: ovhAccountId) |
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
Get this object properties
SELECT
ovh_account_id,
alert_threshold,
available_after_credit,
balance,
can_be_credited,
is_active,
last_update,
open_date,
retrievable_amount
FROM ovh.me.ovh_accounts
WHERE ovh_account_id = '{{ ovh_account_id }}' -- required
;
List of OVH accounts the logged account has
SELECT
ovh_account_id,
alert_threshold,
available_after_credit,
balance,
can_be_credited,
is_active,
last_update,
open_date,
retrievable_amount
FROM ovh.me.ovh_accounts
WHERE x_pagination_mode = '{{ x_pagination_mode }}'
;
UPDATE examples​
- update
Alter this object properties
UPDATE ovh.me.ovh_accounts
SET
alert_threshold = {{ alert_threshold }}
WHERE
ovh_account_id = '{{ ovh_account_id }}' --required;
Lifecycle Methods​
EXEC variables use wire (API) names.
- credit_order
- retrieve_money
Generate an order that can be paid in order to credit the OVH account
EXEC ovh.me.ovh_accounts.credit_order
@ovhAccountId='{{ ovhAccountId }}' --required
@@json=
'{
"amount": {{ amount }}
}'
;
Transfer money from ovhAccount to your bank account
EXEC ovh.me.ovh_accounts.retrieve_money
@ovhAccountId='{{ ovhAccountId }}' --required
@@json=
'{
"amount": {{ amount }},
"bankAccountId": {{ bankAccountId }}
}'
;