Active IQ Unified Manager Discussions

WADL Query to get the status of the Workflow execution and which step it failed during the exec

MAHESH1111111
2,803 Views

 Is there a WADL Query to get the status of the Workflow execution and which step it failed during the execution, we have a workflow for creating volumes, LUNs, Igroups etc, and wanting to know if we can use the WADL query to get the response from WFA.

3 REPLIES 3

sinhaa
2,727 Views

@MAHESH1111111

 

I can tell you how to get it done. I don't have a WADL, you need to make it yourself.

 

1. Query to get the status of the Workflow execution

 

-----

 

The API : 

/workflows/jobs/{jobId}'

shall give you the status of the given job. You would need to parse the result and extract the Job status

 

 

2.  which step it failed during the execution

 

There is not direct way to get to know this. But it can be done. See below

 

  • The API

 

/workflows/executions/{jobId}

Will get you the command-execution-arguments details of every command in this job. A sample is below:

 

 

<command-execution-arguments>
    <command-uuid>ba009c9c-44b9-4705-85a4-012da95b6df1</command-uuid>
    <command-name>Get a workflow using custom REST Path</command-name>
    <command-display-name>Get a workflow using custom REST Path</command-display-name>
    <command-string-representation>/waiting</command-string-representation>
    <command-type>STANDARD_COMMAND</command-type>
    <arguments>
      <argument key="Method" value="POST"/>
      <argument key="RestPath" value="/waiting"/>
    </arguments>
    <atom:link rel="log" href="http://localhost:90/rest/workflows/executions/5600/log/0"/>
  </command-execution-arguments>

 

 

 

Every command-execution-arguments will have a link to the command logs ( marked in RED ) . This API will give you the command execution logs. Sample:

 

 

<collection>
<log-message>
<level>INFO</level>
<date>1486030727342</date>
<message>
### Command 'Get a workflow using custom REST Path' in 'POWER_SHELL' ###
</message>
</log-message>
<log-message>
<level>INFO</level>
<date>1486030729879</date>
<message>Command completed, took 2537 milliseconds</message>
</log-message>
</collection>

 

If the last log message contains 'Command completed'. then this command passed in the workflow. 

 

For a failed command in a workflow, the last message will contain:  Workflow Execution Failed

 

 

Alternatively,

 

I can sugegst that If you do not want to get this list of command-execution-arguments and then find the links to command logs you can follow the below algorithm

 

i=0

try:
while( true)

call GET on /workflows/executions/{jobId}/log/{i}

Check for the last log message containg 'Command Completed'.

i=i+1

catch:

Catch happens when i goes above the last command in the workflow.
do nothing


Now you have found which command(s) has failed in your workflow.

 

 

 

 

sinhaa

 

 

 

 

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

MAHESH1111111
2,681 Views

Thanks so much Sinhaa - while this helps a little, I still need to figure Error Checking and Failed status for each command that runs through the entire workflow. Reason is if the workflow fails we need to know which step it failed and why, I understand we can login to WFA portal and check that but the whole point of automation is to have one Orchestrator tool (In this case it is BMC BSA) to recieve all the error codes and status so our Operations team is always executing Automation from one tool and looking at one tool.

sinhaa
2,614 Views

@MAHESH1111111

 

I understand your requirement. I have something in mind, I'll try those. I'l update you.

 

sinhaa

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public