tasks
Creates, updates, deletes, gets or lists a tasks resource.
Overview​
| Name | tasks |
| Type | Resource |
| Id | ovh.dedicated_server.tasks |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
planned_intervention_id | integer | ID of the planned intervention for this task (wire: plannedInterventionId) |
task_id | integer | the id of the task (wire: taskId) |
change_uuid | string | UUID of the change linked to this task (wire: changeUuid) |
comment | string | Details of this task |
done_date | string (date-time) | Completion date (wire: doneDate) |
function | string | Function 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_update | string (date-time) | last update (wire: lastUpdate) |
need_schedule | boolean | Whether this task need to be scheduled or not (wire: needSchedule) |
note | string | Extra information about this task |
start_date | string (date-time) | Task Creation date (wire: startDate) |
status | string | Task status (cancelled, customerError, doing, done, init, ovhError, todo) |
tags | array | Task result tags output |
ticket_reference | string | Reference of the thread on the support tool (wire: ticketReference) |
Server tasks
| Name | Datatype | Description |
|---|---|---|
planned_intervention_id | integer | ID of the planned intervention for this task (wire: plannedInterventionId) |
task_id | integer | the id of the task (wire: taskId) |
change_uuid | string | UUID of the change linked to this task (wire: changeUuid) |
comment | string | Details of this task |
done_date | string (date-time) | Completion date (wire: doneDate) |
function | string | Function 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_update | string (date-time) | last update (wire: lastUpdate) |
need_schedule | boolean | Whether this task need to be scheduled or not (wire: needSchedule) |
note | string | Extra information about this task |
start_date | string (date-time) | Task Creation date (wire: startDate) |
status | string | Task status (cancelled, customerError, doing, done, init, ovhError, todo) |
tags | array | Task result tags output |
ticket_reference | string | Reference of the thread on the support tool (wire: ticketReference) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name, task_id | 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. | |
list | select | service_name | function, status, x_pagination_mode | List tasks. Returns the IDs of the tasks of the server, such as reboots, reinstallations and IP moves. Filter them by function or status. |
cancel | exec | serviceName, taskId | 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. | |
schedule | exec | serviceName, taskId, hasPerformedBackup, wantedBeginingDate | Schedule 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.
| 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"}}) |
serviceName | string | The internal name of your dedicated server |
service_name | string | The internal name of your dedicated server (wire: serviceName) |
taskId | integer | the id of the task |
task_id | integer | the id of the task (wire: taskId) |
function | string | Filter the value of function property (=) |
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
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
;
List tasks. Returns the IDs of the tasks of the server, such as reboots, reinstallations and IP moves. Filter them by function or status.
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 function = '{{ function }}'
AND status = '{{ status }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- cancel
- schedule
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
;
Schedule 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)
EXEC ovh.dedicated_server.tasks.schedule
@serviceName='{{ serviceName }}' --required,
@taskId='{{ taskId }}' --required
@@json=
'{
"hasPerformedBackup": {{ hasPerformedBackup }},
"wantedBeginingDate": "{{ wantedBeginingDate }}"
}'
;