UAC - Remote Controller

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.

  • Requires Universal Controller version 6.5.0.0 (or higher) on the target Universal Controller, and UC 6.7.0.0 or Higher on the Source Universal Controller.
  • Running remote Universal Controller workflows is partially supported with the following limitations:
    • Tasks within the workflow are not individually tracked.
    • No output is returned.
    • Workflow status is returned, however workflows do not set a return code so you will need to define the Universal Task's exit code processing to handle the status returned in the stderr appropriately.
  • Both stdout and stderr from the remote task are returned to the Universal Task's stdout. Stderr is used for messages from the Universal Task itself.
  • Requires Python 3.6 or higher with the requests module installed. Tested with the Universal Agent bundled Python distribution.
  • You can set different log-levels for the Universal task, providing you more or less information to suit your needs.
  • We are also delivering a Python script for customers who would like to run Universal Controller tasks externally from a command line or other Job Scheduling tool.
    • Example command line:

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

    • Example stderr messages:

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