Skip to main content

spares

Creates, updates, deletes, gets or lists a spares resource.

Overview​

Namespares
TypeResource
Idovh.telephony.spares

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
brandstringPhone brand model
iamobjectIAM resource metadata
mac_addressstringMac address (wire: macAddress)
protocolstringPhone protocol (mgcp, sip)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectspareGet a spare phone
listselectiam_tags, x_pagination_modeList spare phones
deletedeletespareDelete a spare phone
replaceexecspare, domain, ipReplace 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.

NameDatatypeDescription
api_hoststringThe 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"}})
sparestringThe internal name of your spare
iam_tagsobjectFilter resources on IAM tags (wire: iamTags)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get a spare phone

SELECT
brand,
iam,
mac_address,
protocol
FROM ovh.telephony.spares
WHERE spare = '{{ spare }}' -- required
;

DELETE examples​

Delete a spare phone

DELETE FROM ovh.telephony.spares
WHERE spare = '{{ spare }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Replace a phone with the spare

EXEC ovh.telephony.spares.replace
@spare='{{ spare }}' --required
@@json=
'{
"domain": "{{ domain }}",
"ip": "{{ ip }}"
}'
;