Skip to main content

tasks

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

Overview​

Nametasks
TypeResource
Idovh.dedicated_server.tasks

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
planned_intervention_idintegerID of the planned intervention for this task (wire: plannedInterventionId)
task_idintegerthe id of the task (wire: taskId)
change_uuidstringUUID of the change linked to this task (wire: changeUuid)
commentstringDetails of this task
done_datestring (date-time)Completion date (wire: doneDate)
functionstringFunction name (INFRA_002_VirtualNetworkInterface, INFRA_002_VirtualNetworkInterface_group, INFRA_002_VirtualNetworkInterface_ungroup, INFRA_ONE_NETWORK_ONEAPI_VirtualNetworkInterface_group, INFRA_ONE_NETWORK_ONEAPI_VirtualNetworkInterface_ungroup, INFRA_ONE_NETWORK_VirtualNetworkInterface_group, INFRA_ONE_NETWORK_VirtualNetworkInterface_ungroup, addVirtualMac, addWindowSplaFromExistingSerial, applyBackupFtpAcls, applyBackupFtpQuota, bypassAntiDDosGame, changePasswordBackupFTP, changeRipeOrg, checkAndReleaseIp, createBackupFTP, createOrUpdateRipeOrg, createPrivateNetwork, disableFirewall, enableFirewall, genericMoveFloatingIp, hardReboot, hardware_update, ipmi/configureSGX, migrateBackupFTP, moveFloatingIp, moveVirtualMac, reagregateBlock, rebootPower8To, reinstallServer, releaseIp, removeBackupFTP, removeVirtualMac, requestAccessIPMI, resetIPMI, resetIPMISession, testIPMIhttp, testIPMIpassword, testIPMIping, virtualMacAdd, virtualMacDelete)
last_updatestring (date-time)last update (wire: lastUpdate)
need_schedulebooleanWhether this task need to be scheduled or not (wire: needSchedule)
notestringExtra information about this task
start_datestring (date-time)Task Creation date (wire: startDate)
statusstringTask status (cancelled, customerError, doing, done, init, ovhError, todo)
tagsarrayTask result tags output
ticket_referencestringReference of the thread on the support tool (wire: ticketReference)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_name, task_idGet a task. Returns the function, status and dates of a task of the server. needSchedule tells whether the task must be scheduled, and plannedInterventionId links it to a planned intervention.
listselectservice_namefunction, status, x_pagination_modeList tasks. Returns the IDs of the tasks of the server, such as reboots, reinstallations and IP moves. Filter them by function or status.
cancelexecserviceName, taskIdCancel a task. Stops the progression of a task of the server, if possible. Not every task can be canceled: a task that is already done returns an error.
scheduleexecserviceName, taskId, hasPerformedBackup, wantedBeginingDateSchedule an intervention. Schedules the intervention linked to a task at the wanted start date. The body must also state whether a backup of the data has been made. A task whose needSchedule is false cannot be scheduled. (Beta 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"}})
serviceNamestringThe internal name of your dedicated server
service_namestringThe internal name of your dedicated server (wire: serviceName)
taskIdintegerthe id of the task
task_idintegerthe id of the task (wire: taskId)
functionstringFilter the value of function property (=)
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​

Get a task. Returns the function, status and dates of a task of the server. needSchedule tells whether the task must be scheduled, and plannedInterventionId links it to a planned intervention.

SELECT
planned_intervention_id,
task_id,
change_uuid,
comment,
done_date,
function,
last_update,
need_schedule,
note,
start_date,
status,
tags,
ticket_reference
FROM ovh.dedicated_server.tasks
WHERE service_name = '{{ service_name }}' -- required
AND task_id = '{{ task_id }}' -- required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Cancel a task. Stops the progression of a task of the server, if possible. Not every task can be canceled: a task that is already done returns an error.

EXEC ovh.dedicated_server.tasks.cancel
@serviceName='{{ serviceName }}' --required,
@taskId='{{ taskId }}' --required
;