Query Tasks

Query Tasks

This request returns information about the tasks.

Request
URI
GET
https://{api_host}//tasks
COPY
Query Parameters
string
site
Optional

Optional site to retrieve the task from. Could be a remote site or the local one.

site example
site2
string
ids
Optional

If present, the returned tasks' IDs will be in the given list. Comma-separated task IDs are expected.

ids example
2bfb7696-3aa1-49d3-bb40-d9e97df1baba,107102e0-e03b-404e-8e17-0688c657a74b
string
user
Optional

If present, applies equals filtering by username. Available only to admins.

user example
org2@site2
string
sourceOrg
Optional

Optional case sensitive filtering field.

sourceOrg example
org1
string
destinationOrg
Optional

Optional case sensitive filtering field, available only to admins. If present, filtering by user is not supported.

destinationOrg example
org2
state
Optional

If present, applies equals filtering by state. Available values: [RUNNING, SUCCEEDED, FAILED]

state example
RUNNING
integer
startTimeBefore
Optional

If present, applies less-than filtering by startTime.

startTimeBefore example
1499929548951
integer
startTimeAfter
Optional

If present, applies greater-than filtering by startTime.

startTimeAfter example
1499928548623
integer
endTimeBefore
Optional

If present, applies less-than filtering by endTime.

endTimeBefore example
1499929599999
integer
endTimeAfter
Optional

If present, applies greater-than filtering by endTime.

endTimeAfter example
1499929500000
string
type
Optional

If present, applies equals filtering by workflowinfo.type.

type example
failover
string
resourceId
Optional

If present, applies equals filtering by workflowinfo.resourceId.

resourceId example
C4-ec991bd5-af9d-446a-8599-5b693842c4a3
string
resourceName
Optional

If present, applies equals filtering by workflowinfo.resourceName.

resourceName example
VM-001
string of array
resourceType
Optional

If present, applies equals filtering by workflowinfo.resourceType.

resourceType example
vmReplication,vappReplication
string
sort
Optional

Optional list of comma-separated fields, used to sort the result. The default sorting direction is ascending. If one of the fields ends with a hyphen, the direction for this field will be descending. If this field is omitted, the result is sorted by start time in descending order.

sort example
startTime, state, endTime, user-
integer
limit
Optional

Query limit - maximum number of items this query should retrieve. If omitted or higher than the server's limits, defaults to 100.

limit example
10
integer
offset
Optional

Query offset - how much items to skip, before retrieving the actual items. If omitted, defaults to 0.

offset example
10
Header Parameters
string
operationID
Optional

Operation ID for correlating logs across multiple services


Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns QueryResult_of_C4ApiTask_of_object of type(s) application/vnd.vmware.h4-v4.5+json;charset=UTF-8
{
    "items": [
        {
            "endTime": 1499929558827,
            "error": {
                "args": [],
                "code": "Forbidden",
                "msg": "Permission denied.",
                "stacktrace": "com.vmware.h4.api.error.exceptions.PermissionDeniedException: Permission denied."
            },
            "id": "f61d60d2-698a-46dc-a266-88df27644956",
            "lastUpdated": 1499929558827,
            "progress": 100,
            "resultType": "string",
            "site": "site2",
            "startTime": 1499929548951,
            "state": "string",
            "user": "root",
            "warnings": [],
            "workflowInfo": {}
        }
    ],
    "limit": 100,
    "offset": 0,
    "total": 3
}
items
Optional

A list of tasks.

integer As int32 As int32
limit
Optional

Maximum number of items that this query could retrieve.

integer As int32 As int32
offset
Optional

How much items were skipped, before retrieving the actual items.

integer As int64 As int64
total
Optional

The total number of items.


400

The returned error codes include (but are not limited to): BadRequest, BadUserInput, UnsupportedSortingField

Returns ApiError of type(s) application/vnd.vmware.h4-v4.5+json;charset=UTF-8
{
    "args": [],
    "code": "Forbidden",
    "msg": "Permission denied.",
    "stacktrace": "com.vmware.h4.api.error.exceptions.PermissionDeniedException: Permission denied."
}
array of string
args
Optional

Positional arguments.

string
code
Optional

Specific error code.

string
msg
Optional

Detailed error message.

string
stacktrace
Optional

Exception stacktrace.


401

The returned error codes include (but are not limited to): NotAuthenticated, RemoteAuthenticationFailure

Returns ApiError of type(s) application/vnd.vmware.h4-v4.5+json;charset=UTF-8
{
    "args": [],
    "code": "Forbidden",
    "msg": "Permission denied.",
    "stacktrace": "com.vmware.h4.api.error.exceptions.PermissionDeniedException: Permission denied."
}
array of string
args
Optional

Positional arguments.

string
code
Optional

Specific error code.

string
msg
Optional

Detailed error message.

string
stacktrace
Optional

Exception stacktrace.


404

The returned error codes include (but are not limited to): SiteNotFound, TaskNotFound

Returns ApiError of type(s) application/vnd.vmware.h4-v4.5+json;charset=UTF-8
{
    "args": [],
    "code": "Forbidden",
    "msg": "Permission denied.",
    "stacktrace": "com.vmware.h4.api.error.exceptions.PermissionDeniedException: Permission denied."
}
array of string
args
Optional

Positional arguments.

string
code
Optional

Specific error code.

string
msg
Optional

Detailed error message.

string
stacktrace
Optional

Exception stacktrace.


500

The returned error codes include (but are not limited to): GeneralServerFailure

Returns ApiError of type(s) application/vnd.vmware.h4-v4.5+json;charset=UTF-8
{
    "args": [],
    "code": "Forbidden",
    "msg": "Permission denied.",
    "stacktrace": "com.vmware.h4.api.error.exceptions.PermissionDeniedException: Permission denied."
}
array of string
args
Optional

Positional arguments.

string
code
Optional

Specific error code.

string
msg
Optional

Detailed error message.

string
stacktrace
Optional

Exception stacktrace.