subscriptions
Creates, updates, deletes, gets or lists a subscriptions resource.
Overview​
| Name | subscriptions |
| Type | Resource |
| Id | ovh.saas_csp2.subscriptions |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | Subscription's unique identifier |
license_id | integer | License's type id (wire: licenseId) |
task_pending_id | integer | Pending task's unique identifier (wire: taskPendingId) |
creation_date | string (date-time) | Creation date (wire: creationDate) |
last_update | string (date-time) | Last update date (wire: lastUpdate) |
quantity | integer | Number of available licenses |
status | string | Subscription's status |
Office subscription
| Name | Datatype | Description |
|---|---|---|
id | integer | Subscription's unique identifier |
license_id | integer | License's type id (wire: licenseId) |
task_pending_id | integer | Pending task's unique identifier (wire: taskPendingId) |
creation_date | string (date-time) | Creation date (wire: creationDate) |
last_update | string (date-time) | Last update date (wire: lastUpdate) |
quantity | integer | Number of available licenses |
status | string | Subscription's status |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, service_name | Returns the license ID, number of licenses, status, and creation and last update dates of the subscription. (Alpha version) | |
list | select | service_name | x_pagination_mode | Returns the IDs of the subscriptions of the tenant. (Alpha version) |
create | insert | service_name, license_id, quantity | Creates a subscription for quantity licenses of the license licenseId, and returns the task. Get the license IDs from orderableLicenses. (Alpha version) | |
delete | delete | id, service_name | Deletes the subscription from the tenant and returns the task. (Alpha version) | |
change_quantity | exec | id, serviceName, quantity | Sets the number of seats of the subscription to quantity, and returns the task. (Alpha version) | |
order_addon | exec | id, serviceName, licenseId, quantity | Creates 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.
| 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 |
serviceName | string | Service name |
service_name | string | Service name (wire: serviceName) |
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
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
;
Returns the IDs of the subscriptions of the tenant. (Alpha version)
SELECT
id,
license_id,
task_pending_id,
creation_date,
last_update,
quantity,
status
FROM ovh.saas_csp2.subscriptions
WHERE service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: subscriptions
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the subscriptions resource.
- name: license_id
value: {{ license_id }}
description: |
License's type unique identifier
- name: quantity
value: {{ quantity }}
description: |
Quantity of licenses to order
DELETE examples​
- delete
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.
- change_quantity
- order_addon
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 }}
}'
;
Creates 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)
EXEC ovh.saas_csp2.subscriptions.order_addon
@id='{{ id }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"licenseId": {{ licenseId }},
"quantity": {{ quantity }}
}'
;