billing_purchase_orders
Creates, updates, deletes, gets or lists a billing_purchase_orders resource.
Overview​
| Name | billing_purchase_orders |
| Type | Resource |
| Id | ovh.me.billing_purchase_orders |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | Purchase Order identifier |
billing_group_id | integer | Billing Group identifier (wire: billingGroupId) |
active | boolean | Active |
creation_date | string (date-time) | Creation date (wire: creationDate) |
description | string | Description |
end_date | string (date) | End date (wire: endDate) |
last_update | string (date-time) | Last update date (wire: lastUpdate) |
reference | string | Reference |
start_date | string (date) | Start date (wire: startDate) |
status | string | Status (CREATED, DELETED) |
type | string | Type of a purchase order (PURCHASE_ORDER, REFERENCE_ORDER) |
Purchase Order
| Name | Datatype | Description |
|---|---|---|
id | integer | Purchase Order identifier |
billing_group_id | integer | Billing Group identifier (wire: billingGroupId) |
active | boolean | Active |
creation_date | string (date-time) | Creation date (wire: creationDate) |
description | string | Description |
end_date | string (date) | End date (wire: endDate) |
last_update | string (date-time) | Last update date (wire: lastUpdate) |
reference | string | Reference |
start_date | string (date) | Start date (wire: startDate) |
status | string | Status (CREATED, DELETED) |
type | string | Type of a purchase order (PURCHASE_ORDER, REFERENCE_ORDER) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id | Retrieve information about a purchase order (Beta version) | |
list | select | billing_group_id, x_pagination_mode | Retrieve all purchase orders (Beta version) | |
create | insert | reference, start_date, type | Create a purchase order (Beta version) | |
update | update | id | Update a purchase order (Beta version) | |
delete | delete | id | Delete a purchase 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"}}) |
id | integer | Id |
billing_group_id | integer | Billing Group Identifier (wire: billingGroupId) |
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 purchase order (Beta version)
SELECT
id,
billing_group_id,
active,
creation_date,
description,
end_date,
last_update,
reference,
start_date,
status,
type
FROM ovh.me.billing_purchase_orders
WHERE id = '{{ id }}' -- required
;
Retrieve all purchase orders (Beta version)
SELECT
id,
billing_group_id,
active,
creation_date,
description,
end_date,
last_update,
reference,
start_date,
status,
type
FROM ovh.me.billing_purchase_orders
WHERE billing_group_id = '{{ billing_group_id }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Create a purchase order (Beta version)
INSERT INTO ovh.me.billing_purchase_orders (
active,
billing_group_id,
description,
end_date,
reference,
start_date,
type
)
SELECT
{{ active }},
{{ billing_group_id }},
'{{ description }}',
'{{ end_date }}',
'{{ reference }}' /* required */,
'{{ start_date }}' /* required */,
'{{ type }}' /* required */
RETURNING
id,
billing_group_id,
active,
creation_date,
description,
end_date,
last_update,
reference,
start_date,
status,
type
;
# Description fields are for documentation purposes
- name: billing_purchase_orders
props:
- name: active
value: {{ active }}
description: |
Active
- name: billing_group_id
value: {{ billing_group_id }}
description: |
Billing Group identifier
- name: description
value: "{{ description }}"
description: |
Description
- name: end_date
value: "{{ end_date }}"
description: |
End date
- name: reference
value: "{{ reference }}"
description: |
Reference
- name: start_date
value: "{{ start_date }}"
description: |
Start date
- name: type
value: "{{ type }}"
description: |
Type of a purchase order
valid_values: ['PURCHASE_ORDER', 'REFERENCE_ORDER']
UPDATE examples​
- update
Update a purchase order (Beta version)
UPDATE ovh.me.billing_purchase_orders
SET
active = {{ active }},
billing_group_id = {{ billing_group_id }},
description = '{{ description }}',
end_date = '{{ end_date }}',
reference = '{{ reference }}',
start_date = '{{ start_date }}',
type = '{{ type }}'
WHERE
id = '{{ id }}' --required;
DELETE examples​
- delete
Delete a purchase order (Beta version)
DELETE FROM ovh.me.billing_purchase_orders
WHERE id = '{{ id }}' --required
;