Tasks API
Important: This document is being phased out and does not contain up-to-date information. For updated API documentation for Zerto versions 9.5 and later, see ZVM REST API - Swagger.
You can also access Swagger from the ZVM: click the menu button () on the top right and select APIs or navigate to https://<ZVM IP>:9669/swagger/index.html in a Windows ZVM or https://<ZVM IP>/management/api/swagger/index.html in ZVM Appliance.
/v1/tasks
returns information about tasks run on the site.
URL
All tasks | https://zvm_ip:port/v1/tasks
|
Filtered tasks |
|
Single task | https://zvm_ip:port/v1/tasks/{taskIdentifier} |
Valid task types | https://zvm_ip:port/v1/tasks/types |
Where:
zvm_ip | The IP address of the Zerto Virtual Manager where the API is run. | |
port | The port to access the Zerto Virtual Manager. The default port is 9669. | |
taskIdentifier | The identifier of the task for which information should be returned. The task identifier is the concatenation of the task and site identifiers, separated by a period. For example, 5e81d46e-c49e-4b2c-b65a-d742a4939192.d2da8a37-68f0-4464-a70c-abb19683fd01 | |
Filters | Filters are optional and any combination of filters is valid. When no filter is specified, all tasks are returned. Filters are not case-sensitive. | |
Filter |
Description |
|
startedBeforeDate | The date before which the tasks must have begun, supplied in the format yyyy-mm-dd. You can also specify a local time in the format: yyyy-mm-ddThh:mm:ss.fffZ. Adding Z to the end of the time sets the time to UTC. | |
startedAfterDate | The date after which the tasks must have begun, supplied in the format yyyy-mm-dd. You can also specify a local time in the format: yyyy-mm-ddThh:mm:ss.fffZ. Adding Z to the end of the time sets the time to UTC. | |
completedBeforeDate | The date before which the tasks must have ended, supplied in the format yyyy-mm-dd. You can also specify a local time in the format: yyyy-mm-ddThh:mm:ss.fffZ. Adding Z to the end of the time sets the time to UTC. | |
completedAfterDate | The date after which the tasks must have ended, supplied in the format yyyy-mm-dd. You can also specify a local time in the format: yyyy-mm-ddThh:mm:ss.fffZ. Adding Z to the end of the time sets the time to UTC. | |
type | The type of task. For the description of the tasks, refer to the Zerto documentation about monitoring tasks. Possible values are: 0 or FirstUnusedValue 1 or CreateProtectionGroup 2 or RemoveProtectionGroup 3 or FailOver 4 or FailOverTest 5 or StopFailOverTest 6 or Move 7 or GetCheckpointList 8 or ProtectVM 9 or UnprotectVM 10 or AddVMToProtectionGroup 11 or RemoveVMFromProtectionGroup |
|
12 or InstallVra 13 or UninstallVra 14 or GetVMSettings 15 or UpdateProtectionGroup 16 or InsertTaggedCP 17 or WaitForCP 18 or HandleMirrorPromotion 19 or ActivateAllMirrors 20 or LogCollection 21 or ClearCheckpoints 22 or ForceReconfigurationOfNewVM 23 or ClearSite 24 or ForceRemoveProtectionGroup 25 or ForceUpdateProtectionGroup 26 or ForceKillProtectionGroup |
||
27 or PrePostScript 28 or InitFullSync 29 or Pair 30 or Unpair 31 or AddPeerVraInfo 32 or RemovePeerVraInfo 33 or InstallCloudConnector 34 or UninstallCloudConnector 35 or HandleFirstSyncDone |
||
36 or Clone 37 or MoveBeforeCommit 38 or MoveRollback 39 or MoveCommit 40 or UpgradeVRA 41 or MaintainHost 42 or NotSupportedInThisVersion 43 or MoveProtectionGroupToManualOperationNeeded |
||
44 or FailoverBeforeCommit 45 or FailoverCommit 46 or FailoverRollback 47 or ChangeVraIpSettings 48 or PauseProtectionGroup 49 or ResumeProtectionGroup 50 or BulkUpgradeVras 51 or BulkUninstallVras 52 or ChangeVraPassword 53 or ChangeRecoveryHost 54 or ChangeRecoveryHostForProtectionGroup |
||
55 or VpgBackup 56 or RedeployCloudConnector 57 or RestoreVpg 58 or VpgDeleteBackup 59 or SubmitSupportTicket 60 or PreScript 61 or PostScript 62 or ChangeVraPasswordIpSettings 63 or FlrJournalMount 64 or FlrJournalUnmount 65 or StartVMsWithOrder 66 or HandleProtectedVmRemovedFromPlatform 67 or HandleProtectedVmAddedToPlatform 68 or SplitCommit |
||
status | The status of the task. Possible values are: 1 or InProgress 3 or Paused 4 or Failed 6 or Completed 7 or Cancelling |
HTTP Method
GET
Security
The API is exposed over HTTPS. Client code must use the x-zerto-session HTTP authorization header.
See Also
Starting a session: Session: POST
Return the details of the peer sites: Peer Sites API
Return the details of the local site: Local Site API
Format
Json, XML
Request Body Using Json Format
The request body is empty.
Response In Json Format
The following is an example response Json body for https://zvm_ip:port/v1/tasks and for https://zvm_ip:port/v1/tasks/{taskidentifier}
{
"CompleteReason": "",
"Completed": "/Date(1520423877045)/",
"InitiatedBy": "Administrator",
"IsCancellable": false,
"Link": {
"href": "https://172.20.99.9:9669/v1/tasks/0743-01d3-4c5-844b-b428b1.60d6-c090-4233-8b9a4c",
"identifier": "0c66b743-01d3-42c5-844b-bf5d4283ddb1.6b5b30d6-c090-4233-8466-5fe18bf39a4c",
"rel": null,
"type": "TaskApi"
},
"RelatedEntities": {
"Hosts":[],
"Sites":[
{
"href": "https://172.20.99.9:9669/v1/localsite",
"identifier": "736cfa4b-658b-41d5-91ea-33c2213db6ed",
"rel": null,
"type": "LocalSiteApi"
},
{
"href": "https://172.20.99.9:9669/v1/peersites/6b5b30d6-c090-4233-8466-5fe18bf39a4c",
"identifier": "6b5b30d6-c090-4233-8466-5fe18bf39a4c",
"rel": null,
"type": "PeerSiteApi"
}
],
"Vpgs":[
{
"href": "https://172.20.99.9:9669/v1/vpgs/b797d92a-a65a-4e00-9410-1a3aff93480b",
"identifier": "b797d92a-a65a-4e00-9410-1a3aff93480b",
"rel": null,
"type": "VpgApi"
}
]
"FlrSessions":[
{
"href": "https://172.20.99.9:9669/v1/flrs/e35fc247-5fe0-4e1c-ab9f-edc76d3aeda8",
"identifier": "e35fc247-5fe0-4e1c-ab9f-edc76d3aeda8",
"rel": null,
"type": "FlrSessionInformationApi"
}
]
},
"Started": "/Date(1520423876840)/",
"Status": {
"Progress":100,
"State": 6
},
"TaskIdentifier": "0c66b743-01d3-42c5-844b-bf5d4283ddb1.6b5b30d6-c090-4233-8466-5fe18bf39a4c",
"Type": "FlrJournalUnmount"
}
XML Response Format
For the XML response format, see Tasks API XML Response Format.
Response Values
Response values for https://zvm_ip:port/v1/tasks and for https://zvm_ip:port/v1/task/{taskidentifier}.
Parameter | Description |
CompleteReason | The reason the task completed. |
Completed | The date the task completed. The value can be converted to an understandable date using code similar to the following: var date = new Date(jsonDate); or code similar to the Perl code example, jsonDateToString($), in Managing vCD APIs. |
InitiatedBy | The name of the user who initiated the task. |
IsCancellable | True: The task can be canceled via user intervention. False: The task cannot be canceled via user intervention. |
Link | The link details. |
href |
The URL used. |
identifier |
The unique identifier of the task. |
rel |
The next path level for the API relative to the current path. |
type |
The API interface service. |
RelatedEntities | Entities possibly affected by the event. |
Hosts |
The hosts affected by the task. |
href |
The URL used to retrieve host information for each host affected by the event. |
identifier |
The unique internal identifier of the host where the API runs. |
rel |
The next path level for the API relative to the current path. |
type |
The API interface service. |
Sites |
The sites affected by the task. |
href |
The URL used to retrieve site information: peersites and localsite APIs. |
identifier |
The unique internal identifier of the site where the API runs. |
rel |
The next path level for the API relative to the current path. |
type |
The API interface service. |
Vpgs |
The VPGs affected by the task. |
href |
The URL used to retrieve VPG information for each VPG affected by the event. |
identifier |
The unique internal identifier of the VPG. |
rel |
The next path level for the API relative to the current path. |
type |
The API interface service. |
FlrSessions |
The file level restore sessions affected by the task. |
href |
The URL used to retrieve file level restore session information for each session affected by the event. |
identifier |
The unique internal identifier of the file level restore session. |
rel |
The next path level for the API relative to the current path. |
type |
The API interface service. |
Started | The date the task started. The value can be converted to an understandable date using code similar to the following: var date = new Date(jsonDate); or code similar to the Perl code example, jsonDateToString($), in Managing vCD APIs. |
Status | The status of the task. |
Progress |
The progress of the task. |
State |
The state of the task. Possible values are (Json/XML): 0/FirstUnusedValue 1/InProgress 2/WaitingForUserInput 3/Paused 4/Failed 5/Stopped 6/Completed7/Cancelling |
TaskIdentifier | The unique identifier of the task. |
Type | The type of task. For the description of the tasks, refer to the Zerto documentation about monitoring tasks. Possible values are: 0 or FirstUnusedValue 1 or CreateProtectionGroup 2 or RemoveProtectionGroup 3 or FailOver 4 or FailOverTest 5 or StopFailOverTest 6 or Move 7 or GetCheckpointList 8 or ProtectVM 9 or UnprotectVM 10 or AddVMToProtectionGroup 11 or RemoveVMFromProtectionGroup |
12 or InstallVra 13 or UninstallVra 14 or GetVMSettings 15 or UpdateProtectionGroup 16 or InsertTaggedCP 17 or WaitForCP 18 or HandleMirrorPromotion 19 or ActivateAllMirrors 20 or LogCollection 21 or ClearCheckpoints 22 or ForceReconfigurationOfNewVM 23 or ClearSite 24 or ForceRemoveProtectionGroup 25 or ForceUpdateProtectionGroup 26 or ForceKillProtectionGroup |
|
27 or PrePostScript 28 or InitFullSync 29 or Pair 30 or Unpair 31 or AddPeerVraInfo 32 or RemovePeerVraInfo 33 or InstallCloudConnector 34 or UninstallCloudConnector 35 or HandleFirstSyncDone |
|
36 or Clone 37 or MoveBeforeCommit 38 or MoveRollback 39 or MoveCommit 40 or UpgradeVRA 41 or MaintainHost 42 or NotSupportedInThisVersion 43 or MoveProtectionGroupToManualOperationNeeded |
|
44 or FailoverBeforeCommit 45 or FailoverCommit 46 or FailoverRollback 47 or ChangeVraIpSettings 48 or PauseProtectionGroup 49 or ResumeProtectionGroup 50 or BulkUpgradeVras 51 or BulkUninstallVras 52 or ChangeVraPassword 53 or ChangeRecoveryHost 54 or ChangeRecoveryHostForProtectionGroup |
|
55 or VpgBackup 56 or RedeployCloudConnector 57 or RestoreVpg 58 or VpgDeleteBackup 59 or SubmitSupportTicket 60 or PreScript 61 or PostScript 62 or ChangeVraPasswordIpSettings 63 or FlrJournalMount 64 or FlrJournalUnmount 65 or StartVMsWithOrder 66 or HandleProtectedVmRemovedFromPlatform 67 or HandleProtectedVmAddedToPlatform 68 or SplitCommit |
Response values for https://zvm_ip:port/v1/tasks/types.
Response: Description |
Task types: CreateProtectionGroup RemoveProtectionGroup FailOver FailOverTest StopFailOverTest Move GetCheckpointList ProtectVM UnprotectVM AddVMToProtectionGroup RemoveVMFromProtectionGroup |
InstallVra
UninstallVra GetVMSettings UpdateProtectionGroup InsertTaggedCP WaitForCP HandleMirrorPromotion ActivateAllMirrors LogCollection ClearCheckpoints ForceReconfigurationOfNewVM ClearSite ForceRemoveProtectionGroup ForceUpdateProtectionGroupForceKillProtectionGroup |
PrePostScript
InitFullSync Pair Unpair AddPeerVraInfo RemovePeerVraInfo InstallCloudConnector UninstallCloudConnector HandleFirstSyncDone |
Clone
MoveBeforeCommit MoveRollback MoveCommit UpgradeVra MaintainHost NotSupportedInThisVersion MoveProtectionGroupToManualOperationNeeded |
FailoverBeforeCommit
FailoverCommit FailoverRollback ChangeVraIpSettings PauseProtectionGroup ResumeProtectionGroup BulkUpgradeVras BulkUninstallVras ChangeVraPassword ChangeRecoveryHost ChangeRecoveryHostForProtectionGroup |
VpgBackup
RedeployCloudConnector RestoreVpg VpgDeleteBackup SubmitSupportTicket PreScript PostScript ChangeVraPasswordIpSettings FlrJournalMount FlrJournalUnmount StartVMsWithOrder HandleProtectedVmRemovedFromPlatform HandleProtectedVmAddedToPlatform SplitCommit |