tasks
Creates, updates, deletes, gets or lists a tasks resource.
Overview​
| Name | tasks |
| Type | Resource |
| Id | ovh.xdsl.tasks |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | |
done_date | string (date-time) | Date when the action was completed (wire: doneDate) |
function | string | |
is_archived | boolean | (wire: isArchived) |
status | string | Status of a task. (cancelled, doing, done, error, problem, todo) |
todo_date | string (date-time) | Date when the action will start (wire: todoDate) |
update_date | string (date-time) | (wire: updateDate) |
Describes the current status of a task
| Name | Datatype | Description |
|---|---|---|
id | integer | |
done_date | string (date-time) | Date when the action was completed (wire: doneDate) |
function | string | |
is_archived | boolean | (wire: isArchived) |
status | string | Status of a task. (cancelled, doing, done, error, problem, todo) |
todo_date | string (date-time) | Date when the action will start (wire: todoDate) |
update_date | string (date-time) | (wire: updateDate) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, service_name | Returns the function, status, archive flag and the planned, completion and last update dates of a task. | |
list | select | service_name | function, include_archived, limit, status, x_pagination_mode | Returns the IDs of the tasks scheduled on the access. Filter by function or status, and include archived tasks; 20 results by default, 50 at most. |
archive | exec | id, serviceName | Removes the task in problem state from the task results. Archived tasks are listed again with includeArchived. |
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) |
function | string | Filter the value of function property (=) |
include_archived | boolean | Include archived tasks (wire: includeArchived) |
limit | integer | Limit query result, default 20, max 50 |
status | string | Filter the value of status property (=) |
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 function, status, archive flag and the planned, completion and last update dates of a task.
SELECT
id,
done_date,
function,
is_archived,
status,
todo_date,
update_date
FROM ovh.xdsl.tasks
WHERE id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;
Returns the IDs of the tasks scheduled on the access. Filter by function or status, and include archived tasks; 20 results by default, 50 at most.
SELECT
id,
done_date,
function,
is_archived,
status,
todo_date,
update_date
FROM ovh.xdsl.tasks
WHERE service_name = '{{ service_name }}' -- required
AND function = '{{ function }}'
AND include_archived = '{{ include_archived }}'
AND limit = '{{ limit }}'
AND status = '{{ status }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- archive
Removes the task in problem state from the task results. Archived tasks are listed again with includeArchived.
EXEC ovh.xdsl.tasks.archive
@id='{{ id }}' --required,
@serviceName='{{ serviceName }}' --required
;