Skip to main content

tasks

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

Overview​

Nametasks
TypeResource
Idovh.dedicated_cloud.tasks

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringTask name
datacenter_idintegerdatacenterId of the associated dedicatedCloud.Datacenter object (wire: datacenterId)
filer_idintegerfilerId of the associated dedicatedCloud.Filer object (wire: filerId)
host_idintegerhostId of the associated dedicatedCloud.Host object (wire: hostId)
network_access_idintegernetworkAccessId of the associated dedicatedCloud.AllowedNetwork object (wire: networkAccessId)
order_idintegerorderId of the associated billing.Order object (wire: orderId)
parent_task_idintegertaskId of the parent dedicatedCloud.Task object (wire: parentTaskId)
task_idintegerTask id (wire: taskId)
user_idintegeruserId of the associated dedicatedCloud.User object (wire: userId)
vlan_idintegervlanId of the parent dedicatedCloud.Vlan object (wire: vlanId)
created_bystringCreator of the task (wire: createdBy)
created_fromstringOrigin of the task (wire: createdFrom)
descriptionstringCurrent progress description
end_datestring (date-time)Task end date (wire: endDate)
execution_datestring (date-time)Task execution date (wire: executionDate)
last_modification_datestring (date-time)Task last modification date (wire: lastModificationDate)
maintenance_date_fromstring (date-time)Maintenance task min allowed execution date (wire: maintenanceDateFrom)
maintenance_date_tostring (date-time)Maintenance task max allowed execution date (wire: maintenanceDateTo)
networkstringnetwork of the associated dedicatedCloud.Ip object
progressintegerCurrent progress
statestringCurrent Task state (canceled, doing, done, error, fixing, toCancel, toCreate, todo, unknown, waitingForChilds, waitingTodo)
typestringTask type

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_name, task_idGet a task
listselectservice_nameexecution_date, name, state, x_pagination_modeList tasks. Returns the IDs of the tasks of the service. Filter by name, state or minimum execution date.
change_maintenance_execution_dateexecserviceName, taskId, executionDateReschedule a maintenance task. Changes the execution date of a maintenance task. Choose a date between the maintenanceDateFrom and maintenanceDateTo of the task.
reset_task_stateexecserviceName, taskId, reasonRetry a failed task

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"}})
serviceNamestringDomain of the service
service_namestringDomain of the service (wire: serviceName)
taskIdintegerTask id
task_idintegerTask id (wire: taskId)
execution_datestring (date-time)Filter the value of executionDate property (>=) (wire: executionDate)
namestringFilter the value of name property (like)
statestringFilter the value of state 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​

Get a task

SELECT
name,
datacenter_id,
filer_id,
host_id,
network_access_id,
order_id,
parent_task_id,
task_id,
user_id,
vlan_id,
created_by,
created_from,
description,
end_date,
execution_date,
last_modification_date,
maintenance_date_from,
maintenance_date_to,
network,
progress,
state,
type
FROM ovh.dedicated_cloud.tasks
WHERE service_name = '{{ service_name }}' -- required
AND task_id = '{{ task_id }}' -- required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Reschedule a maintenance task. Changes the execution date of a maintenance task. Choose a date between the maintenanceDateFrom and maintenanceDateTo of the task.

EXEC ovh.dedicated_cloud.tasks.change_maintenance_execution_date
@serviceName='{{ serviceName }}' --required,
@taskId='{{ taskId }}' --required
@@json=
'{
"executionDate": "{{ executionDate }}"
}'
;