Run Task or Workflow on a Remote Universal Controller

Universal Task to launch, monitor, and return results from a task defined in a remote Universal Controller.

For customers who would like to manage tasks in one Universal Controller from another Universal Controller. Simply supply the target Universal Controller URL, valid credentials, and the name of a task defined to the target Universal Controller. Using the web service API's, the Universal Task launches the requested task by name, captures the new instance sysid, and uses this to track the status of the task.  After completion, the output is retrieved if the task type supports this, the Universal Task complete with the same exit code as the launched task.

python run_universal_controller_task.py --controllerurl https://localhost:8080/opswise --username controlleruser --password controlleruserpassword --task "sleep 0" --loglevel info

2018-08-07 09:33:08,976 - INFO     - Launching Task : Sleep 0

2018-08-07 09:33:09,049 - INFO     - Task Instance Sysid : 1533578492639002557VEO7SQNCIHTCF

2018-08-07 09:33:09,049 - INFO     - Monitoring Task : Sleep 0

2018-08-07 09:33:15,087 - INFO     - Task Complete : Status = SUCCESS, Exit Code = 0

2018-08-07 09:33:40,530 - INFO     - Retrieving Available Output : Sleep 0

2018-08-07 09:33:40,539 - INFO     - Output Retrieval Not Valid for Task Type : Timer


Universal Task Field Descriptions


Field Label

Description

Example

Required

Target Controller URL

Specify the URL for the Target Universal Controller. This specifies where the Task will be Launched.

https://localhost:8080/opswise

Y

Target Controller Credential

Select the Credential Definition to access the Target Universal Controller 


Y

Verify HTTPS

For https connections, the Universal Task supports host validation with a certificate or CA certificate, check this option to provide the location of the certificate or CA certificate. 


If unchecked no host certificate validation will be performed.


N

Certificate File Location

Select on of the following:

  • Utility Agent Path : If the certificate or CA certificate is located on the Utility Agent File System.
  • Script File : if the certificate or CA certificate is stored as a Script Data object on the Source Universal Controller

Y (if Verify HTTPS is True)

Certificate File

Specify the location of the certificate or CA certificate on the Utility Agent file system. 

/etc/certs/ca-cert.cer

C:\security\certs\ca-cert.cer

Y (if Certificate File Location is Utility Agent Path)

Certificate File

Select the Script Data object that contains the certificate or CA certificate.


Y (if Certificate File Location is Script Data)

Target Controller Task Name

Specify the Task to Launch on the Target Universal Controller. The Task name specified must exist of the Target Universal Controller.

Sleep 0

Y

Task Variables

Specify any Variables to pass to the task. 


N

Task Virtual Resources

Specify any Virtual Resources and the Amount that the Task will consume. 


N

Polling Interval

Provide the polling interval in seconds for checking the Task's status. Default is 5 seconds.


Y

Logging Level

Select the level of messages returned from the script. Valid options are:

  • None
  • Info
  • Debug
  • Warning
  • Error
  • Critical

N


Command Line Script Parameters


Option

Description

Example

Required

--controllerurl

Specify the URL for the Target Universal Controller. This specifies where the Task will be Launched.

--controllerurl https://localhost:8080/opswise

Y

--username

Specify the user to access the Remote Universal Controller

--username ops.admin

Y

--password

Specify the password for the user specified via --username

--password secret

Y

--verfiy

For https connections, the Universal Task supports host validation with a certificate or CA certificate. To Bypass host validation specify False. If not specified host validation will be performed.

--verify False

N

--certfile

Specify the location of the certificate or CA certificate

--certfile /etc/certs/uc-ca.cer

N

--taskname

Specify the Task to Launch on the Target Universal Controller. The Task name specified must exist of the Target Universal Controller.

--taskname "Sleep 0"

Y

--vararray


--vararray '{"var1":"value1","var2":"value2"}'

N

--resarray


--resarray '{"Resource1":"1","Resource2":"6"}'

N

--interval

Provide the polling interval in seconds for checking the Task's status. 

--interval 30

Y

--loglevel

Specify the level of messages returned from the script. Valid options are:

  • None
  • Info
  • Debug
  • Warning
  • Error
  • Critical

--loglevel info

N