Skip to main content

tasks

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

Overview​

Nametasks
TypeResource
Idovh.xdsl.tasks

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idinteger
done_datestring (date-time)Date when the action was completed (wire: doneDate)
functionstring
is_archivedboolean (wire: isArchived)
statusstringStatus of a task. (cancelled, doing, done, error, problem, todo)
todo_datestring (date-time)Date when the action will start (wire: todoDate)
update_datestring (date-time) (wire: updateDate)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, service_nameReturns the function, status, archive flag and the planned, completion and last update dates of a task.
listselectservice_namefunction, include_archived, limit, status, x_pagination_modeReturns 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.
archiveexecid, serviceNameRemoves 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.

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)
functionstringFilter the value of function property (=)
include_archivedbooleanInclude archived tasks (wire: includeArchived)
limitintegerLimit query result, default 20, max 50
statusstringFilter the value of status property (=)
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 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
;

Lifecycle Methods​

EXEC variables use wire (API) names.

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
;