Skip to main content

subscriptions

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

Overview​

Namesubscriptions
TypeResource
Idovh.saas_csp2.subscriptions

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerSubscription's unique identifier
license_idintegerLicense's type id (wire: licenseId)
task_pending_idintegerPending task's unique identifier (wire: taskPendingId)
creation_datestring (date-time)Creation date (wire: creationDate)
last_updatestring (date-time)Last update date (wire: lastUpdate)
quantityintegerNumber of available licenses
statusstringSubscription's status

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, service_nameReturns the license ID, number of licenses, status, and creation and last update dates of the subscription. (Alpha version)
listselectservice_namex_pagination_modeReturns the IDs of the subscriptions of the tenant. (Alpha version)
createinsertservice_name, license_id, quantityCreates a subscription for quantity licenses of the license licenseId, and returns the task. Get the license IDs from orderableLicenses. (Alpha version)
deletedeleteid, service_nameDeletes the subscription from the tenant and returns the task. (Alpha version)
change_quantityexecid, serviceName, quantitySets the number of seats of the subscription to quantity, and returns the task. (Alpha version)
order_addonexecid, serviceName, licenseId, quantityCreates an add-on subscription for the subscription, with quantity seats of the license licenseId, and returns the task. Get the license IDs from availableAddonLicenses. (Alpha 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.

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"}})
idintegerId
serviceNamestringService name
service_namestringService name (wire: serviceName)
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​

Returns the license ID, number of licenses, status, and creation and last update dates of the subscription. (Alpha version)

SELECT
id,
license_id,
task_pending_id,
creation_date,
last_update,
quantity,
status
FROM ovh.saas_csp2.subscriptions
WHERE id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Creates a subscription for quantity licenses of the license licenseId, and returns the task. Get the license IDs from orderableLicenses. (Alpha version)

INSERT INTO ovh.saas_csp2.subscriptions (
license_id,
quantity,
service_name
)
SELECT
{{ license_id }} /* required */,
{{ quantity }} /* required */,
'{{ service_name }}'
RETURNING
id,
finish_date,
function,
status,
todo_date
;

DELETE examples​

Deletes the subscription from the tenant and returns the task. (Alpha version)

DELETE FROM ovh.saas_csp2.subscriptions
WHERE id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Sets the number of seats of the subscription to quantity, and returns the task. (Alpha version)

EXEC ovh.saas_csp2.subscriptions.change_quantity
@id='{{ id }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"quantity": {{ quantity }}
}'
;