Fetch the Output of a Work Order

Description:

This is a method to fetch the output of a work order (for example, step names and step variable names with the associated variable values). XML or JSON data representation can be returned in the response.

The inputs to this API method are a work order ID, step name, variable name (with the desired output), and authentication parameters (login and password). The user must have the correct group privileges to view the work order details.

The output of the API call is an XML structure that contains the details such as variable name, type, value, step name, and so on. It is possible that a workflow contains the same variable name in different steps. Use the step name input to drill down to the step you want to fetch the output variable from.

Another URL parameter allows the user to obtain a variable value rather than the long-form XML wrapper around the variable. Spaces used in variable names (such as step_name) are accepted in the URL. Single or double quotes (used to surround variable names) are not accepted.

Usage for a request with an XML long-form response (either is acceptable):
http://Orchestrator_IP_address/aspera/orchestrator/api/work_order_output?login=admin&password=aspera&work order_id=work_order_id&step_name=<step_name >&variable_name=variable_name
http://Orchestrator_IP_address/ aspera/orchestrator/api/work_order_output/work_order_id.xml?login=admin&password=aspera&step_name=<step_name >&variable_name=<variable_name>
The required input parameters are the following:
  • work order_id=work order_id
  • step_name=step_name
  • variable_name=variable_name (This parameter specifies the variable name within a step).
Example 1: Find an output for a given step and a given variable.
http://localhost/aspera/orchestrator/api/work_order_output?work order_id=11081&step_name=Test2&variable_name=Count_of_ContentFiles&login=admin&password=aspera
Response example (XML):
<?xml version="1.0"?>
<work_order_output time="2014-03-14 04:50:56 UTC" action="output">
   <variable id="29039" name="Test2:Count_of_ContentFiles">
      <work order_id>11081</work order_id>
      <step_name>Test2</step_name>
      <variable_name>Count_of_ContentFiles</variable_name>
      <value_type>int</value_type>
      <value>3</value>
      <variable_type>OUTPUT</variable_type>
   </variable>
</work_order_output>
Example 2: Find the output for a specific variable.
http://localhost/aspera/orchestrator/api/work_order_output?work order_id=1106&variable_name=FileName&login=admin&password=aspera
Response example (XML):
<?xml version="1.0"?>
<work_order_output time="2014-03-14 02:19:41 UTC" action="output">
   <variable id="28785" name="Update failure:FileName">
      <work order_id>11068</work order_id>
      <step_name>Update failure</step_name>
      <variable_name>FileName</variable_name>
      <value_type>string</value_type>
      <value>FileName</value>
      <variable_type>OUTPUT</variable_type>
   </variable>
   <variable id="28788" name="Update success:FileName">
      <work order_id>11068</work order_id>
      <step_name>Update success</step_name>
      <variable_name>FileName</variable_name>
      <value_type>string</value_type>
      <value/>
      <variable_type>OUTPUT</variable_type>
   </variable>
   <variable id="28789" name="Scan for incoming files:FileName">
      <work order_id>11068</work order_id>
      <step_name>Scan for incoming files</step_name>
      <variable_name>FileName</variable_name>
      <value_type>string</value_type>
      <value>/demo/comcast/to_disney/wall_e_5.avi</value>
      <variable_type>OUTPUT</variable_type>
   </variable>
</work_order_output>
Example 3: Find all of the output for a particular work order.
http://localhost/aspera/orchestrator/api/work_order_output?work order_id=1106&login=admin&password=aspera
Response example (XML):
<?xml version="1.0"?>
<work_order_output time="2014-03-24 21:25:47 UTC" action="output">
   <variable id="29629" name="Successful ingest notification:FullMessage">
      <work order_id>11109</work order_id>        
      <step_name>Successful ingest notification</step_name>
	<variable_name>FullMessage</variable_name>
      <value_type>string</value_type>   <value>&lt;MessageDefinition&gt;&lt;Destinations&gt;&lt;To&gt;pavan+support@asperasoft.com&lt;/To&gt;&lt;/Destinations&gt;&lt;Subject&gt;Ingest successful of wall_e_12.avi for Turner&lt;/Subject&gt;&lt;/MessageDefinition&gt;
</value>
      <variable_type>OUTPUT</variable_type>
   </variable>
   <variable id="29630" name="Ingest failure:FullMessage">
      <work order_id>11109</work order_id>        
      <step_name>Ingest failure</step_name>
      <variable_name>FullMessage</variable_name>
      <value_type>string</value_type>
      <value></value>
      <variable_type>OUTPUT</variable_type>
   </variable>    
   <variable id="29631" name="Update failure:manifest">
      <work order_id>11109</work order_id>
      <step_name>Update failure</step_name>
      <variable_name>manifest</variable_name>
      <value_type>string</value_type>
      <value></value>
      <variable_type>OUTPUT</variable_type>
   </variable>  
   <variable id="29632" name="Update failure:manifest_id">
      <work order_id>11109</work order_id>        
      <step_name>Update failure</step_name>
      <variable_name>manifest_id</variable_name>
      <value_type>int</value_type>
      <value></value>
      <variable_type>OUTPUT</variable_type>
   </variable>    
   <variable id="29637" name="Scan for incoming files:FileName">
      <work order_id>11109</work order_id>
      <step_name>Scan for incoming files</step_name>
      <variable_name>FileName</variable_name>
      <value_type>string</value_type>
      <value>/demo/comcast/to_turner/wall_e_12.avi</value>
      <variable_type>OUTPUT</variable_type>
   </variable>
</work_order_output>
Example 4: Find all of the output for a single step in a workflow.
http://localhost/aspera/orchestrator/api/work_order_output?work order_id=1106&login=admin&password=aspera&step_name=test
Response example (XML):
<?xml version="1.0"?>
<work_order_output time="2014-03-24 19:07:15 UTC" action="output">
   <variable id="29638" name="Forward:Transferred_File_list">
      <work order_id>11109</work order_id>
      <step_name>Forward</step_name>
      <variable_name>Transferred_File_list</variable_name>
      <value_type>array</value_type>
      <value>["/demo/comcast/to_turner/wall_e_12.avi"]</value>
      <variable_type>OUTPUT</variable_type>
   </variable>
   <variable id="29639" name="Forward:Transfer_Stats">
      <work order_id>11109</work order_id>
      <step_name>Forward</step_name>
      <variable_name>Transfer_Stats</variable_name>
      <value_type>string</value_type>
      <value>{:FilesFailed=>0, :JobRetryCount=>0, :FilesTransferring=>0, :BytesWritten=>4830720, :BytesTransferred=>4830720, :sessionId=>["918b2456-095c-4ce5-9b33-af8551f4deb9"], :FilesComplete=>1}</value>
      <variable_type>OUTPUT</variable_type>
   </variable>
   <variable id="29640" name="Forward:Job_ID">
      <work order_id>11109</work order_id>
      <step_name>Forward</step_name>
      <variable_name>Job_ID</variable_name>
      <value_type>string</value_type>
      <value>f698d602-d6e6-45a4-b82a-df5f65621a2e</value>
      <variable_type>OUTPUT</variable_type>
   </variable>
   <variable id="29641" name="Forward:Transferred_Files_md5">
      <work order_id>11109</work order_id>
      <step_name>Forward</step_name>
      <variable_name>Transferred_Files_md5</variable_name>
      <value_type>hash</value_type>
      <value/>
      <variable_type>OUTPUT</variable_type>
   </variable>
</work_order_output>
Usage for a request with a value-only response:
http://Orchestrator_IP_address/api/work_order_output/work order_id.string?login=admin&password=aspera&step_name=step_name&variable_name=variable_name

For example:

http://localhost/aspera/orchestrator/api/work_order_output/11081.string?step_name=Test2&variable_name=Count_of_ContentFiles&login=admin&password=aspera
Response example (XML):
3

Error use case: A step name or variable name is incorrect.

This is returned:
<work_order_output time="2014-11-05 08:43:36 UTC" action="output"></work_order_output>

Error use case: The step has not yet been executed when the API request is made.

An XML structure without a value is returned, such as the following:
<?xml version="1.0"?>
<work_order_output time="2014-03-14 04:50:56 UTC" action="output">
   <variable id="29039" name="Test2:Count_of_ContentFiles">
      <work order_id>11081</work order_id>
      <step_name>Test2</step_name>
      <variable_name>Count_of_ContentFiles</variable_name>
      <value_type>int</value_type>
      <value/>
      <variable_type>OUTPUT</variable_type>
   </variable>
</work_order_output>
Usage for a request with a JSON response:
http://Orchestrator_IP_address/api/work_order_output/work order_id.json?login=admin&password=aspera&step_name=<step_name >&variable_name=<variable_name>
The JSON response holds only the value for the specified step and variable. For example:
http://localhost/aspera/orchestrator/api/work_order_output/11081.json?step_name=Test2&variable_name=Count_of_ContentFiles&login=admin&password=aspera
Response example (JSON):
"3"