order_balances
Creates, updates, deletes, gets or lists an order_balances resource.
Overview​
| Name | order_balances |
| Type | Resource |
| Id | ovh.me.order_balances |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
balance_name | string | Credit balance name (wire: balanceName) |
amount | object | Amount applied from the balance |
Credit balance applied on an Order
| Name | Datatype | Description |
|---|---|---|
balance_name | string | Credit balance name (wire: balanceName) |
amount | object | Amount applied from the balance |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | balance_name, order_id | Get this object properties (Beta version) | |
list | select | order_id | x_pagination_mode | List credit balances applied on this Order (Beta version) |
create | insert | order_id, balance_name | Use a credit balance on this Order (Beta version) | |
delete | delete | balance_name, order_id | Remove a credit balance from this Order (Beta 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.
| 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"}}) |
balance_name | string | Credit balance name (wire: balanceName) |
order_id | integer | (wire: orderId) |
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 (Beta version)
SELECT
balance_name,
amount
FROM ovh.me.order_balances
WHERE balance_name = '{{ balance_name }}' -- required
AND order_id = '{{ order_id }}' -- required
;
List credit balances applied on this Order (Beta version)
SELECT
balance_name,
amount
FROM ovh.me.order_balances
WHERE order_id = '{{ order_id }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Use a credit balance on this Order (Beta version)
INSERT INTO ovh.me.order_balances (
balance_name,
order_id
)
SELECT
'{{ balance_name }}' /* required */,
'{{ order_id }}'
RETURNING
balance_name,
amount
;
# Description fields are for documentation purposes
- name: order_balances
props:
- name: order_id
value: {{ order_id }}
description: Required parameter for the order_balances resource.
- name: balance_name
value: "{{ balance_name }}"
description: |
Balance name to use on this Order
DELETE examples​
- delete
Remove a credit balance from this Order (Beta version)
DELETE FROM ovh.me.order_balances
WHERE balance_name = '{{ balance_name }}' --required
AND order_id = '{{ order_id }}' --required
;