16.4. Monitoring

Monitoring REST API allows developers to query a Pegasus workflow's STAMPEDE database.

16.4.1. Resource Definition

16.4.1.1. Root Workflow

{
    "wf_id"             : <int:wf_id>,
    "wf_uuid"           : <string:wf_uuid>,
    "submit_hostname"   : <string:submit_hostname>,
    "submit_dir"        : <string:submit_dir>,
    "planner_arguments" : <string:planner_arguments>,
    "planner_version"   : <string:planner_version>,
    "user"              : <string:user>,
    "grid_dn"           : <string:grid_dn>,
    "dax_label"         : <string:dax_label>,
    "dax_version"       : <string:dax_version>,
    "dax_file"          : <string:dax_file>,
    "dag_file_name"     : <string:dag_file_name>,
    "timestamp"         : <int:timestamp>,
    "workflow_state"    : <object:workflow_state>,
    "_links"            : {
        "workflow" : <href:workflow>
    }
}

16.4.1.2. Workflow

{
    "wf_id"             : <int:wf_id>,
    "root_wf_id"        : <int:root_wf_id>,
    "parent_wf_id"      : <int:parent_wf_id>,
    "wf_uuid"           : <string:wf_uuid>,
    "submit_hostname"   : <string:submit_hostname>,
    "submit_dir"        : <string:submit_dir>,
    "planner_arguments" : <string:planner_arguments>,
    "planner_version"   : <string:planner_version>,
    "user"              : <string:user>,
    "grid_dn"           : <string:grid_dn>,
    "dax_label"         : <string:dax_label>,
    "dax_version"       : <string:dax_version>,
    "dax_file"          : <string:dax_file>,
    "dag_file_name"     : <string:dag_file_name>,
    "timestamp"         : <int:timestamp>,
    "_links"            : {
        "workflow_meta"  : <href:workflow_meta>,
        "workflow_state" : <href:workflow_state>,
        "job"            : <href:job>,
        "task"           : <href:task>,
        "host"           : <href:host>,
        "invocation"     : <href:invocation>
    }
}

16.4.1.3. Workflow Metadata

{
    "key"    : <string:key>,
    "value"  : <string:value>,
    "_links" : {
        "workflow" : <href:workflow>
    }
}

16.4.1.4. Workflow Files

{
    "wf_id"  : <int:wf_id>,
    "lfn_id" : <string:lfn_id>,
    "lfn"    : <string:lfn>,
    "pfns"   : [
         {
            "pfn_id" : <int:pfn_id>,
            "pfn"    : <string:pfn>,
            "site"   : <string:site>
         }
    ],
    "meta" : [
         {
            "meta_id" : <int:meta_id>,
            "key"     : <string:key>,
            "value"   : <string:value>
         }
    ],
    "_links"      : {
        "workflow" : <href:workflow>
    }
}

16.4.1.5. Workflow State

{
    "wf_id"         : int:wf_id,
    "state"         : <string:state>,
    "status"        : <int:status>,
    "restart_count" : <int:restart_count>,
    "timestamp"     : <datetime:timestamp>,
    "_links"        : {
        "workflow" : "<href:workflow>"
    }
}

16.4.1.6. Job

{
    "job_id"      : <int: job_id>,
    "exec_job_id" : <string: exec_job_id>,
    "submit_file" : <string: submit_file>,
    "type_desc"   : <string: type_desc>,
    "max_retries" : <int: max_retries>,
    "clustered"   : <bool: clustered>,
    "task_count"  : <int: task_count>,
    "executable"  : <string: executable>,
    "argv"        : <string: argv>,
    "task_count"  : <int:task_count>,
    "_links"      : {
        "workflow"     : <href:workflow>,
        "task"         : <href:task>,
        "job_instance" : <href:job_instance>
    }
}

16.4.1.7. Host

{
    "host_id"      : <int:host_id>,
    "site_name"    : <string:site_name>,
    "hostname"     : <string:hostname>,
    "ip"           : <string:ip>,
    "uname"        : <string:uname>,
    "total_memory" : <string:total_memory>,
    "_links"       : {
        "workflow" : <href:workflow>
    }
}

16.4.1.8. Job State

{
    "job_instance_id"     : <int:job_instance_id>,
    "state"               : <string:state>,
    "jobstate_submit_seq" : <int:jobstate_submit_seq>,
    "timestamp"           : <int:timestamp>,
    "_links"              : {
        "job_instance" : "href:job_instance"
    }
}

16.4.1.9. Task

{
    "task_id"        : <int:task_id>,
    "abs_task_id"    : <string:abs_task_id>,
    "type_desc"      : <string: type_desc>,
    "transformation" : <string:transformation>,
    "argv"           : <string:argv>,
    "_links"         : {
        "workflow"  : <href:workflow>,
        "job"       : <href:job>,
        "task_meta" : <href:task_meta>
    }
}

16.4.1.10. Task Metadata

{
    "key"    : <string:key>,
    "value"  : <string:value>,
    "_links" : {
        "task" : <href:task>
    }
}

16.4.1.11. Job Instance

{
    "job_instance_id"   : <int:job_instance_id>,
    "host_id"           : <int:host_id>,
    "job_submit_seq"    : <int:job_submit_seq>,
    "sched_id"          : <string:sched_id>,
    "site_name"         : <string:site_name>,
    "user"              : <string:user>,
    "work_dir"          : <string:work_dir>,
    "cluster_start"     : <int:cluster_start>,
    "cluster_duration"  : <int:cluster_duration>,
    "local_duration"    : <int:local_duration>,
    "subwf_id"          : <int:subwf_id>,
    "stdout_text"       : <string:stdout_text>,
    "stderr_text"       : <string:stderr_text>,
    "stdin_file"        : <string:stdin_file>,
    "stdout_file"       : <string:stdout_file>,
    "stderr_file"       : <string:stderr_file>,
    "multiplier_factor" : <int:multiplier_factor>,
    "exitcode"          : <int:exitcode>,
    "_links"            : {
        "job_state"  : <href:job_state>,
        "host"       : <href:host>,
        "invocation" : <href:invocation>,
        "job"        : <href:job>
    }
}

16.4.1.12. Invocation

{
    "invocation_id"   : <int:invocation_id>,
    "job_instance_id" : <int:job_instance_id>,
    "abs_task_id"     : <string:abs_task_id>,
    "task_submit_seq" : <int:task_submit_seq>,
    "start_time"      : <int:start_time>,
    "remote_duration" : <int:remote_duration>,
    "remote_cpu_time" : <int:remote_cpu_time>,
    "exitcode"        : <int:exitcode>,
    "transformation"  : <string:transformation>,
    "executable"      : <string:executable>,
    "argv"            : <string:argv>,
    "_links"          : {
        "workflow"     : <href:workflow>,
        "job_instance" : <href:job_instance>
    }
}

16.4.1.13. RC LFN

{
    "lfn_id" : <int:pfn_id>,
    "lfn"    : <string:pfn>
}

16.4.1.14. RC PFN

{
    "pfn_id" : <int:pfn_id>,
    "pfn"    : <string:pfn>,
    "site"   : <string:site>
}
16.4.1.14.1. RC Metadata
{
    "meta_id" : <int:meta_id>,
    "key"     : <string:key>,
    "value"   : <string:value>
}

16.4.2. Endpoints

All URIs are prefixed by/api/v1/user/<string:user>.

All endpoints return response with content-type as application/json.

All endpoints support `pretty-print` query argument, to return a formatted JSON response.

All endpoints return status code 401 forAuthentication failure.

All endpoints return status code 403 forAuthorization failure.

16.4.2.1. GET /root OR POST /root/query

Returns a collection of the Root Workflow resource.

Table 16.5. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.6. Returns

Status Code Description
200 OK
204 No content; when no workflows found.
400 Bad request


16.4.2.2. GET /root/<m_wf_id>

Returns a Root Workflow resource identified by m_wf_id.

Table 16.7. Returns

Status Code Description
200 OK
404 Not found


16.4.2.3. GET /root/<m_wf_id>/workflow OR POST /root/<m_wf_id>/workflow/query

Returns a collection of the Workflow resource.

Table 16.8. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.9. Returns

Status Code Description
200 OK
204 No content; when no workflows found.
400 Bad request


16.4.2.4. GET /root/<m_wf_id>/workflow/<wf_id>

Returns a Workflow resource identified by m_wf_id, wf_id.

Table 16.10. Returns

Status Code Description
200 OK
404 Not found


16.4.2.5. GET /root/<m_wf_id>/workflow/<wf_id>/meta OR POST /root/<m_wf_id>/workflow/<wf_id>/meta/query

Returns a collection of the WorkflowMetadata resource.

Table 16.11. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.12. Returns

Status Code Description
200 OK
204 No content; when no workflows found.
400 Bad request


16.4.2.6. GET /root/<m_wf_id>/workflow/<wf_id>/files OR POST /root/<m_wf_id>/workflow/<wf_id>/files/query

Returns a collection of the WorkflowFiles resource.

Table 16.13. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.14. Returns

Status Code Description
200 OK
204 No content; when no workflows found.
400 Bad request


16.4.2.7. GET /root/<m_wf_id>/workflow/<wf_id>/state[;recent=true] OR POST /root/<m_wf_id>/workflow/<wf_id>/state[;recent=true]/query

Returns a collection of the Workflow State resource.

Table 16.15. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.
recent Get most recent results. See Recent.


Table 16.16. Returns

Status Code Description
200 OK
204 No content; when no workflow-state found.
400 Bad request


16.4.2.8. GET /root/<m_wf_id>/workflow/<wf_id>/host OR POST /root/<m_wf_id>/workflow/<wf_id>/host/query

Returns a collection of the Host resource.

Table 16.17. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.18. Returns

Status Code Description
200 OK
204 No content; when no hosts found.
400 Bad request


16.4.2.9. GET /root/<m_wf_id>/workflow/<wf_id>/host/<host_id>

Returns a Host resource identified by m_wf_id, wf_id, host_id.

Table 16.19. Returns

Status Code Description
200 OK
404 Not found


16.4.2.10. GET /root/<m_wf_id>/workflow/<wf_id>/task OR POST /root/<m_wf_id>/workflow/<wf_id>/task/query

Returns a collection of the Task resource.

Table 16.20. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.21. Returns

Status Code Description
200 OK
204 No content; when no tasks found.
400 Bad request


16.4.2.11. GET /root/<m_wf_id>/workflow/<wf_id>/task/<task_id>

Returns a Task resource identified by m_wf_id, wf_id, task_id.

Table 16.22. Returns

Status Code Description
200 OK
404 Not found


16.4.2.12. GET /root/<m_wf_id>/workflow/<wf_id>/task/<task_id>/meta OR POST /root/<m_wf_id>/workflow/<wf_id>/task/<task_id>/meta/query

Returns a collection of the TaskMetadata resource.

Table 16.23. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.24. Returns

Status Code Description
200 OK
204 No content; when no workflows found.
400 Bad request


16.4.2.13. GET /root/<m_wf_id>/workflow/<wf_id>/invocation OR POST /root/<m_wf_id>/workflow/<wf_id>/invocation/query

Returns a collection of the Invocation resource.

Table 16.25. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.26. Returns

Status Code Description
200 OK
204 No content; when no invocations found.
400 Bad request


16.4.2.14. GET /root/<m_wf_id>/workflow/<wf_id>/invocation/<invocation_id>

Returns a Invocation resource identified by m_wf_id, wf_id, invocation_id.

Table 16.27. Returns

Status Code Description
200 OK
404 Not found


16.4.2.15. GET /root/<m_wf_id>/workflow/<wf_id>/job OR POST /root/<m_wf_id>/workflow/<wf_id>/job/query

Returns a collection of the Job resource.

Table 16.28. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.29. Returns

Status Code Description
200 OK
204 No content; when no jobs found.
400 Bad request


16.4.2.16. GET /root/<m_wf_id>/workflow/<wf_id>/job/<job_id>

Returns a Job resource identified by m_wf_id, wf_id, job_id.

Table 16.30. Returns

Status Code Description
200 OK
404 Not foun


16.4.2.17. GET /root/<m_wf_id>/workflow/<wf_id>/job/<job_id>/task OR POST /root/<m_wf_id>/workflow/<wf_id>/job/<job_id>/task/query

Returns a collection of the Task resource.

Table 16.31. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.32. Returns

Status Code Description
200 OK
204 No content; when no tasks found.
400 Bad request


16.4.2.18. GET /root/<m_wf_id>/workflow/<wf_id>/job/<job_id>/job-instance[;recent=true] OR POST /root/<m_wf_id>/workflow/<wf_id>/job/<job_id>/job-instance[;recent=true]/query

Returns a collection of the Job Instance resource.

Table 16.33. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.
recent Get most recent results. See Recent.


Table 16.34. Returns

Status Code Description
200 OK
204 No content; when no job-instances found.
400 Bad request


16.4.2.19. GET /root/<m_wf_id>/workflow/<wf_id>/job/<job_id>/job-instance/<job_instance_id>

Returns a Job Instance resource identified by m_wf_id, wf_id, job_id, job_instance_id.

Table 16.35. Returns

Status Code Description
200 OK
404 Not found


16.4.2.20. GET /root/<m_wf_id>/workflow/<wf_id>/job/<job_id>/job-instance/<job_instance_id>/state[;recent=true] OR POST /root/<m_wf_id>/workflow/<wf_id>/job/<job_id>/job-instance/<job_instance_id>/state[;recent=true]/query

Returns a collection of the Job State resource.

Table 16.36. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.
recent Get most recent results. See Recent.


Table 16.37. Returns

Status Code Description
200 OK
204 No content; when no job-state found.
400 Bad request


16.4.2.21. GET /root/<m_wf_id>/workflow/<wf_id>/job/<job_id>/job-instance/<job_instance_id>/invocation OR POST /root/<m_wf_id>/workflow/<wf_id>/job/<job_id>/job-instance/<job_instance_id>/invocation/query

Returns a collection of the Invocation resource.

Table 16.38. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.39. Returns

Status Code Description
200 OK
204 No content; when no invocations found.
400 Bad request


16.4.2.22. POST /batch

Returns an array of responses; one entry for each request.

Batch Request

[
    {
        "method" : <string:method>,
        "path"   : <string:path>,
        "body"   : <dict:body>
    },
    {
        "method" : <string:method>,
        "path"   : <string:path>,
        "body"   : <dict:body>
    }
]

Batch Response

[
    {
        "status"   : <int:status_code>,
        "response" : <string:response>
    },
    {
        "status"   : <int:status_code>,
        "response" : <string:response>
    }
]

Table 16.40. Returns

Status Code Description
207 Multi status


16.4.2.23. GET /root/<m_wf_id>/workflow/<wf_id>/job/<[running|successful|failed|failing]> OR POST /root/<m_wf_id>/workflow/<wf_id>/job/<[running|successful|failed|failing]>/query

Returns a collection of running, successful, failed, or failing Job resource.

Note: Queries, Sorting can include fields from Job and JobInstance resource.

Table 16.41. Options

Argument Description
start-index Return results starting from record <start-index> (0 indexed)
max-results Return a maximum of <max-results> records
query Search criteria. See Querying.
order Order criteria. See Ordering.


Table 16.42. Returns

Status Code Description
200 OK
204 No content; when no jobs found.
400 Bad request


16.4.3. Querying

Querying is supported through query string argument `query`.

Querying is supported only on endpoints returning collections.

16.4.3.1. Syntax

Query clauses are rudimentary and must follow some rules.

  • Supported comparators are =, !=, <, <=, >, >=, LIKE, IN.

  • Supported operators are AND, OR.

  • Comparision clauses must have the form <FIELDNAME> SPACE <COMPARATOR> SPACE <STRING LITERAL OR INTEGER LITERAL OR FLOAT LITERAL>

  • <FIELDNAME> must be prefixed with resource query prefix Example: r.wf_id is valid, but wf_id is not.

  • <FIELDNAMES> which can be used in a query caluse depends on the resource being queries. Example: For endpoint /api/v1/user/user-a/root/1/workflow/1/job/2/state query clause can only contain fields from the Job State resource.

  • Only exceptions for the previous rules are

    Querying Root Workflow where fields from both Root Workflow and Workflow State can be included.

    Querying the /api/v1/user/user-a/root/1/workflow/1/files where fields from RC LFN, RC PFN, an RC Metadata can be included.

    Views endpoint /api/v1/user/user-a/root/1/workflow/1/job/<[running|successful|failed|failing]> where fields from Job and JobInstance resource can be included.

Example

For Root Workflow https://www.domain.com/api/v1/user/user-a/root?query<QUERY>

Where QUERY can be( r.wf_id >= 5 AND r.planner_version LIKE '4.5%' ) OR ( r.wf_id IN ( 1, 2 ) )

16.4.3.2. Resource - Query Prefix

Table 16.43. Query Prefix

Query Prefix
Resource Query Prefix Example
Root Workflow r r.wf_id
Workflow w w.wf_uuid
Workflow Metadata wm wm.key
Workflow Files wf wf.lfn
Workflow State ws ws.state
Job j j.type_desc
Host h h.site
Job State js js.state
Task t t.abs_task_id
Task Metadata tm tm.value
Job Instance ji ji.exitcode
Job i i.argv
RC LFN l l.lfn
RC PFN p p.pfn
RC Metadata rm rm.key


16.4.3.3. Recent

Workflow State, Job State, and Job Instance resources have historical records.

For use cases where developers need to get the most recent record, we set path argument `recent` to true. Recent argument is always true when requesting for root-workflow's resource.

16.4.4. Ordering

Ordering is supported through query string argument `order`.

Ordering is supported only on endpoints returning collections.

Order clause can only contain fields which are part of the resource being returned. Fields may or may not be prefixed by the Resource Query Prefix

Example: Order clause for an endpoint returning a Workflow resource can only contain fields that are part of the Workflow resource.

16.4.4.1. Syntax

Order clause consists of one or more field names optionally followed by order direction (ASC or DESC), separated by commas.

https://www.domain.com/api/v1/user/user-a/root?order=r.submit_hostname ASC, wf_id DESC

16.4.5. Examples

16.4.5.1. Resource - Single

$ curl --request GET \
       --user user-a:user-a-password \
       https://www.domain.com/api/v1/user/user-a/root/1/workflow/1?pretty-print=true
                    

HTTP/1.1 200 OK

{
    "wf_id"             : 1,
    "root_wf_id"        : 1,
    "parent_wf_id"      : null,
    "wf_uuid"           : "7193de8c-a28d-4eca-b576-1b1c3c4f668b",
    "submit_hostname"   : "isis.isi.edu",
    "submit_dir"        : "/home/tutorial/submit/",
    "planner_arguments" : "--conf pegasusrc --sites condorpool --output-site local --dir dags --dax dax.xml --submit",
    "planner_version"   : "4.5.0dev",
    "user"              : "user-a",
    "grid_dn"           : null,
    "dax_label"         : "hello_world",
    "dax_version"       : "3.5",
    "dax_file"          : "/home/tutorial/hello-world.xml",
    "dag_file_name"     : "hello_world-0.dag",
    "timestamp"         : 1421432530.0,
    "_links"            : {
        "workflow_state" : "/user/user-a/root/1/workflow/1/state",
        "job"            : "/user/user-a/root/1/workflow/1/job",
        "task"           : "/user/user-a/root/1/workflow/1/task",
        "host"           : "/user/user-a/root/1/workflow/1/host",
        "invocation"     : "/user/user-a/root/1/workflow/1/job"
    }
}

16.4.5.2. Resource - Collection

$ curl --request POST \
       --user user-a:user-a-password \
       --data 'pretty-print=true' \
       https://www.domain.com/api/v1/user/user-a/root/1/workflow/query
                    
HTTP/1.1 200 OK

{
    "records" : [
        {
            "wf_id"             : 1,
            "root_wf_id"        : 1,
            "parent_wf_id"      : null,
            "wf_uuid"           : "7193de8c-a28d-4eca-b576-1b1c3c4f668b",
            "submit_hostname"   : "isis.isi.edu",
            "submit_dir"        : "/home/tutorial/dags/20150116T102210-0800",
            "planner_arguments" : "--conf pegasusrc --sites condorpool --output-site local --dir dags  --dax dax.xml --submit",
            "planner_version"   : "4.5.0dev",
            "user"              : "user-a",
            "grid_dn"           : null,
            "dax_label"         : "hello_world",
            "dax_version"       : "3.5",
            "dax_file"          : "/home/tutorial/hello-world.xml",
            "dag_file_name"     : "hello_world-0.dag",
            "timestamp"         : 1421432530.0,
            "_links"            : {
                "workflow_state" : "/user/user-a/root/1/workflow/1/state",
                "job"            : "/user/user-a/root/1/workflow/1/job",
                "task"           : "/user/user-a/root/1/workflow/1/task",
                "host"           : "/user/user-a/root/1/workflow/1/host",
                "invocation"     : "/user/user-a/root/1/workflow/1/job"
            }
        },
        {
            "wf_id"             : 2,
            "root_wf_id"        : 2,
            "parent_wf_id"      : null,
            "wf_uuid"           : "41920a57-7882-4990-854e-658b7a797745",
            "submit_hostname"   : "isis.isi.edu",
            "submit_dir"        : "/home/tutorial/dags/20150330T165231-0700",
            "planner_arguments" : "--conf pegasusrc --sites condorpool --output-site local --dir dags --dax dax.xml --submit",
            "planner_version"   : "4.5.0dev",
            "user"              : "user-a",
            "grid_dn"           : null,
            "dax_label"         : "hello_world",
            "dax_version"       : "3.5",
            "dax_file"          : "/home/tutorial/hello-world.xml",
            "dag_file_name"     : "hello_world-0.dag",
            "timestamp"         : 1427759551.0,
            "_links"            : {
                "workflow_state" : "/user/user-a/root/2/workflow/1/state",
                "job"            : "/user/user-a/root/2/workflow/1/job",
                "task"           : "/user/user-a/root/2/workflow/1/task",
                "host"           : "/user/user-a/root/2/workflow/1/host",
                "invocation"     : "/user/user-a/root/2/workflow/1/job"
            }
        },
        {
            "wf_id"             : 3,
            "root_wf_id"        : 3,
            "parent_wf_id"      : null,
            "wf_uuid"           : "fce67b41-df67-4b3c-8fa4-d77e6e2b9769",
            "submit_hostname"   : "isis.isi.edu",
            "submit_dir"        : "/home/tutorial/dags/20150330T170228-0700",
            "planner_arguments" : "--conf pegasusrc --sites condorpool --output-site local --dir dags --dax dax.xml --submit",
            "planner_version"   : "4.5.0dev",
            "user"              : "user-a",
            "grid_dn"           : null,
            "dax_label"         : "hello_world",
            "dax_version"       : "3.5",
            "dax_file"          : "/home/tutorial/hello-world.xml",
            "dag_file_name"     : "hello_world-0.dag",
            "timestamp"         : 1427760148.0,
            "_links"            : {
                "workflow_state" : "/user/user-a/root/3/workflow/1/state",
                "job"            : "/user/user-a/root/3/workflow/1/job",
                "task"           : "/user/user-a/root/3/workflow/1/task",
                "host"           : "/user/user-a/root/3/workflow/1/host",
                "invocation"     : "/user/user-a/root/3/workflow/1/job"
            }

        }
    ],
    "_meta"   : {
        "records_total"    : 3,
        "records_filtered" : 3
    }
}

16.4.5.3. Querying

$ curl --request GET \
       --get \
       --data-urlencode "pretty-print=true" \
       --data-urlencode "query=w.wf_uuid = '41920a57-7882-4990-854e-658b7a797745'" \
       --user user-a:user-a-password \
       https://www.domain.com/api/v1/user/user-a/root/1/workflow
                    
HTTP/1.1 200 OK

{
    "records" : [
        {
            "wf_id"             : 2,
            "root_wf_id"        : 2,
            "parent_wf_id"      : null,
            "wf_uuid"           : "41920a57-7882-4990-854e-658b7a797745",
            "submit_hostname"   : "isis.isi.edu",
            "submit_dir"        : "/home/tutorial/dags/20150330T165231-0700",
            "planner_arguments" : "--conf pegasusrc --sites condorpool --output-site local --dir dags --dax dax.xml --submit",
            "planner_version"   : "4.5.0dev",
            "user"              : "user-a",
            "grid_dn"           : null,
            "dax_label"         : "hello_world",
            "dax_version"       : "3.5",
            "dax_file"          : "/home/tutorial/hello-world.xml",
            "dag_file_name"     : "hello_world-0.dag",
            "timestamp"         : 1427759551.0,
            "_links"            : {
                "workflow_state" : "/user/user-a/root/2/workflow/1/state",
                "job"            : "/user/user-a/root/2/workflow/1/job",
                "task"           : "/user/user-a/root/2/workflow/1/task",
                "host"           : "/user/user-a/root/2/workflow/1/host",
                "invocation"     : "/user/user-a/root/2/workflow/1/job"
            }
        }
    ],
    "_meta"   : {
        "records_total"    : 3,
        "records_filtered" : 1
    }
}

16.4.5.4. Ordering

$ curl --request GET \
       --user user-a:user-a-password \
       https://www.domain.com/api/v1/user/user-a/root/1/workflow?pretty-print=true&order=wf_id desc
                    
HTTP/1.1 200 OK

{
    "records" : [
        {
            "wf_id"             : 3,
            "root_wf_id"        : 3,
            "parent_wf_id"      : null,
            "wf_uuid"           : "fce67b41-df67-4b3c-8fa4-d77e6e2b9769",
            "submit_hostname"   : "isis.isi.edu",
            "submit_dir"        : "/home/tutorial/dags/20150330T170228-0700",
            "planner_arguments" : "--conf pegasusrc --sites condorpool --output-site local --dir dags --dax dax.xml --submit",
            "planner_version"   : "4.5.0dev",
            "user"              : "user-a",
            "grid_dn"           : null,
            "dax_label"         : "hello_world",
            "dax_version"       : "3.5",
            "dax_file"          : "/home/tutorial/hello-world.xml",
            "dag_file_name"     : "hello_world-0.dag",
            "timestamp"         : 1427760148.0,
            "_links"            : {
                "workflow_state" : "/user/user-a/root/3/workflow/1/state",
                "job"            : "/user/user-a/root/3/workflow/1/job",
                "task"           : "/user/user-a/root/3/workflow/1/task",
                "host"           : "/user/user-a/root/3/workflow/1/host",
                "invocation"     : "/user/user-a/root/3/workflow/1/job"
            }
        },
        {
            "wf_id"             : 2,
            "root_wf_id"        : 2,
            "parent_wf_id"      : null,
            "wf_uuid"           : "41920a57-7882-4990-854e-658b7a797745",
            "submit_hostname"   : "isis.isi.edu",
            "submit_dir"        : "/home/tutorial/dags/20150330T165231-0700",
            "planner_arguments" : "--conf pegasusrc --sites condorpool --output-site local --dir dags --dax dax.xml --submit",
            "planner_version"   : "4.5.0dev",
            "user"              : "user-a",
            "grid_dn"           : null,
            "dax_label"         : "hello_world",
            "dax_version"       : "3.5",
            "dax_file"          : "/home/tutorial/hello-world.xml",
            "dag_file_name"     : "hello_world-0.dag",
            "timestamp"         : 1427759551.0,
            "_links"            : {
                "workflow_state" : "/user/user-a/root/2/workflow/1/state",
                "job"            : "/user/user-a/root/2/workflow/1/job",
                "task"           : "/user/user-a/root/2/workflow/1/task",
                "host"           : "/user/user-a/root/2/workflow/1/host",
                "invocation"     : "/user/user-a/root/2/workflow/1/job"
            }
        },
        {
            "wf_id"             : 1,
            "root_wf_id"        : 1,
            "parent_wf_id"      : null,
            "wf_uuid"           : "7193de8c-a28d-4eca-b576-1b1c3c4f668b",
            "submit_hostname"   : "isis.isi.edu",
            "submit_dir"        : "/home/tutorial/dags/20150116T102210-0800",
            "planner_arguments" : "--conf pegasusrc --sites condorpool --output-site local --dir dags  --dax dax.xml --submit",
            "planner_version"   : "4.5.0dev",
            "user"              : "user-a",
            "grid_dn"           : null,
            "dax_label"         : "hello_world",
            "dax_version"       : "3.5",
            "dax_file"          : "/home/tutorial/hello-world.xml",
            "dag_file_name"     : "hello_world-0.dag",
            "timestamp"         : 1421432530.0,
            "_links"            : {
                "workflow_state" : "/user/user-a/root/1/workflow/1/state",
                "job"            : "/user/user-a/root/1/workflow/1/job",
                "task"           : "/user/user-a/root/1/workflow/1/task",
                "host"           : "/user/user-a/root/1/workflow/1/host",
                "invocation"     : "/user/user-a/root/1/workflow/1/job"
            }
        }
    ],
    "_meta"   : {
        "records_total"    : 3,
        "records_filtered" : 3
    }
}

16.4.5.5. Recent

$ curl --request GET \
       --user user-a:user-a-password \
       https://www.domain.com/api/v1/user/user-a/root/1/workflow/1/state;recent=true?pretty-print=true
                    
HTTP/1.1 200 OK

{
    "records": [
        {
            "wf_id": 1,
            "state": "WORKFLOW_TERMINATED",
            "status": 1,
            "restart_count": 3,
            "timestamp": 1421885063.0,
            "_links": {
                "workflow": "/api/v1/user/user-a/root/1/workflow/1"
            }
        }
    ],
    "_meta": {
        "records_total": 8,
        "records_filtered": 1
    }
}

16.4.5.6. Batch Request

Example

$ curl --request POST \
       --user user-a:user-a-password \
       --header "Content-Type: application/json" \
       --data '[
            {
                "path"   : "/api/v1/user/user-a/root?query=r.wf_id = 1&pretty-print=True",
                "method" : "GET"
            },
            {
                "path"   : "/api/v1/user/user-a/root",
                "method" : "POST",
                "body"   : {
                    "query"        : "r.wf_id = 2",
                    "pretty-print" : "True"
                }
            }
       ]' \
       https://www.domain.com/api/v1/user/user-a/batch

[
    {
        "status"   : 200,
        "response" : {
            "records" : [
                {
                    "wf_id"             : 1,
                    "wf_uuid"           : "7193de8c-a28d-4eca-b576-1b1c3c4f668b",
                    ..
                    "_links"            : {
                        "workflow" : "/api/v1/user/user-a/root/1/workflow"
                    }
                }
            ],
            "_meta"   : {
                "records_total"    : 5,
                "records_filtered" : 1
            }
        }
    },
    {
        "status"   : 200,
        "response" : {
            "records" : [
                {
                    "wf_id"             : 2,
                    "wf_uuid"           : "41920a57-7882-4990-854e-658b7a797745",
                    ..
                    "_links"            : {
                        "workflow" : "/api/v1/user/user-a/root/2/workflow"
                    }
                }
            ],
            "_meta"   : {
                "records_total"    : 5,
                "records_filtered" : 1
            }
        }
    }
]