spares
Creates, updates, deletes, gets or lists a spares resource.
Overview​
| Name | spares |
| Type | Resource |
| Id | ovh.telephony.spares |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
brand | string | Phone brand model |
iam | object | IAM resource metadata |
mac_address | string | Mac address (wire: macAddress) |
protocol | string | Phone protocol (mgcp, sip) |
Spare properties
| Name | Datatype | Description |
|---|---|---|
brand | string | Phone brand model |
iam | object | IAM resource metadata |
mac_address | string | Mac address (wire: macAddress) |
protocol | string | Phone protocol (mgcp, sip) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | spare | Get a spare phone | |
list | select | iam_tags, x_pagination_mode | List spare phones | |
delete | delete | spare | Delete a spare phone | |
replace | exec | spare, domain, ip | Replace a phone with the spare |
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"}}) |
spare | string | The internal name of your spare |
iam_tags | object | Filter resources on IAM tags (wire: iamTags) |
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 a spare phone
SELECT
brand,
iam,
mac_address,
protocol
FROM ovh.telephony.spares
WHERE spare = '{{ spare }}' -- required
;
List spare phones
SELECT
brand,
iam,
mac_address,
protocol
FROM ovh.telephony.spares
WHERE iam_tags = '{{ iam_tags }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
DELETE examples​
- delete
Delete a spare phone
DELETE FROM ovh.telephony.spares
WHERE spare = '{{ spare }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- replace
Replace a phone with the spare
EXEC ovh.telephony.spares.replace
@spare='{{ spare }}' --required
@@json=
'{
"domain": "{{ domain }}",
"ip": "{{ ip }}"
}'
;