Attached is a PowerShell script that provides a CLI like interface to execute WFA workflows.
It is a PowerShell wrapper over REST calls to WFA.
The script has the following capabilities:
1. Show all workflows
2. Show details of a workflow
3. Execute a workflow
4. Get the job execution details of a workflow
1. Show all workflows
This is going to list all the workflows that are present in the WFA database. Each workflow maps to a Serial Number which can be used to get details of the workflow, execute the workflow or get the job status for the workflow.
2. Show details of a workflow
This will help fetch details of a workflow such as Name, UUID, Description, Certification, Version, Categories and User Inputs, based on the workflow serial number entered.
3. Execute a workflow
This will execute a workflow based on the serial number entered. On selecting a workflow, each user input will be prompted for, interactively.
Once the workflow execution is triggered, a job id is returned and an option is provided to wait for workflow completion.
4. Get the job execution details of a workflow
This will return the job status and job details of a workflow based on the serial number and job id entered.
Notes:
1. To run this, you need to :
- download the file and unzip it
- modify the wfa server ip-address, username, password, protocol, port in the script
- execute it using PowerShell ISE.
Attached are screenshots for the execution phases.
2. Can be executed by Operators, Architects and Admins.
3. This will work on PowerShell versions 2.0 onwards.
4. Can use http/https as protocols
5. Dependent user inputs will not show a validate set. Example: On selecting a specific cluster as user input, if the next user input is a vserver, and it depends on the cluster, the valid set of vservers will not be shown as in the WFA UI.
6. This script is based on the script written by Mirko, which entirely used SOAP APIs.