Generic Task for Cisco UCS Director Base Platform Connector Pack, Release 6.7.3.1
This document describes the generic tasks that are introduced in the Cisco UCS Director Base Platform Connector Pack, Release 6.7.3.1.
Generic API Task
Cisco UCS Director has a repository of out-of-the-box tasks that are built around specific operations for a particular device. These tasks have pre-defined inputs and pre-defined outputs. In certain situations, these out-of-the-box tasks doesn’t meet your requirements. Say, for example, if new parameters are added to the device specific API to enhance the existing functionality, you have to wait till the next release for the task enhancement from the Cisco UCS Director development team.
To overcome this stituation, Cisco UCS Director provides generic API tasks that you can utilize in any device specific workflow and achieve the desired result. Generic API tasks such as SSH task, which allows you to automate operations on a device which can be accessed through SSH. As SSH is a standard way of interacting with devices, you can automate such operations without depending on pre-defined tasks in Cisco UCS Director.
Generic API task is introduced as an out-of-the-box task to help you to use any API in a standard HTTP/HTTPs manner.
The pre-defined structure of an HTTP/HTTPs-based API includes the following:
-
IP address
-
Port
-
URL path
-
Headers
-
Request body
-
Authentication parameters
For more information on generic API tasks, see Working with Generic API Task of Cisco UCS Director.
Using the Process Text Task for Text Manipulation
The Process Text is a dynamic task that enables you to dynamically define inputs and outputs. You can add the Process Text task to any workflow to manipulate the defined inputs as per the operations and deliver the manipulated text as an output in other tasks.
You can add the Process Text task to a workflow, and edit the task to define the input list, operations, and the expected output list.
To add and define parameters in the Process Text task, perform the following:
Procedure
Step 1 |
Choose Orchestration. |
Step 2 |
On the Orchestration page, click Workflows. |
Step 3 |
Locate and select the workflow to which you want to add the Process Text task. Alternatively, you can also add the Process Text task while creating a new workflow. |
Step 4 |
Click Workflow Designer. |
Step 5 |
Add the Process Text task. |
Step 6 |
Click Close to close the Workflow Designer. |
Converting the Task Output Type
The Convert Type task is a dynamic task that enables you to dynamically define the input list and output type for the corresponding input label. You can add the Convert Type task to any workflow to generate output type defined for the given input value. You can map the output type to other tasks.
To add and define parameters in the Convert Type task, perform the following:
Procedure
Step 1 |
Choose Orchestration. |
Step 2 |
On the Orchestration page, click Workflows. |
Step 3 |
Locate and select the workflow to which you want to add the Convert Type task. Alternatively, you can also add the Convert Type task while creating a new workflow. |
Step 4 |
Click Workflow Designer. |
Step 5 |
Add the Convert Type task. |
Step 6 |
Click Close to close the Workflow Designer. |
Registering LOV as Workflow Input
The Register LOV task registers given key value pairs as an LOV in the workflow task input, which can be used by other tasks after registration. During LOV registration, you can define the LOV name, labels, and values in the JSON format:
{"LOVName1" : {"LOVLabel":"LOVValue","LOVLabel":"LOVValue","LOVLabel":"LOVValue"},
"LOVName2": {"LOVLabel":"LOVValue","LOVLabel":"LOVValue","LOVLabel":"LOVValue"}}
After the task is executed, the registered LOV is displayed in the workflow task input page. You can use the registered LOV in other tasks by mapping the registered LOV as task input or admin input.
To add and define parameters in the Register LOV task, perform the following:
Procedure
Step 1 |
Choose Orchestration. |
Step 2 |
On the Orchestration page, click Workflows. |
Step 3 |
Locate and select the workflow to which you want to add the Register LOV task. Alternatively, you can also add the Register LOV task while creating a new workflow. |
Step 4 |
Click Workflow Designer. |
Step 5 |
Add the Register LOV task. |
Step 6 |
Click Close to close the Workflow Designer. |
Getting Data from Tabular Reports
You can use the Get Data From Tabular Report task to retrieve specific data from a tabular report. The task provides options to select columns for retrieving only the
selected column data from the given report name, and to define filter condition to filter specific report rows. The output
is provided in the csv
format with each row separated by a new line character.
To add and define parameters in the Get Data From Tabular Report task, perform the following:
Procedure
Step 1 |
Choose Orchestration. |
Step 2 |
On the Orchestration page, click Workflows. |
Step 3 |
Locate and select the workflow to which you want to add the Get Data From Tabular Report task. Alternatively, you can also add the Get Data From Tabular Report task while creating a new workflow. |
Step 4 |
Click Workflow Designer. |
Step 5 |
Add the Get Data From Tabular Report task. |
Step 6 |
Click Close to close the Workflow Designer. |
Processing Time-based Data
You can use the Process Time task to perform actions such as converting time format, get system time and so on. To process time, you can either define the input in a specific time format or define normal time value without following any format. Then, choose an operation such as Convert Time Format, to be performed on input time, and define the output format in which the processed time has to be output for each operation.
The supported operations are: Convert Time Format, Get System Time, Get Time Difference, Get Time Component, Get Prior or After Time, and Get Time from NTP server.
For the Get Prior or After Time operation type, you have to input two values: Date in any format and a generic number. Based on the set prior or after action and time component, the output will be processed. For example, if you have set input as 16/07/2019 and 2, choosen Before and Date in the Select Prior or After and Select Time Component drop-down lists, then the processed time output is 14.
For Get Time from NTP server operation type, you have to provide the IP address of the NTP server or DNS name.
To add and define parameters in the Process Time task, perform the following:
Procedure
Step 1 |
Choose Orchestration. |
Step 2 |
On the Orchestration page, click Workflows. |
Step 3 |
Locate and select the workflow to which you want to add the Process Time task. Alternatively, you can also add the Process Time task while creating a new workflow. |
Step 4 |
Click Workflow Designer. |
Step 5 |
Add the Process Time task. |
Step 6 |
Click Close to close the Workflow Designer. |
Reading the Content of a File
You can use the Read File task to read the content of a specifc file and generate an output with either the entire content of the file or the content in a specific line.
You can also provide a regular expression pattern to read the lines matching the given pattern.
To add and define parameters in the Read File task, perform the following:
Procedure
Step 1 |
Choose Orchestration. |
Step 2 |
On the Orchestration page, click Workflows. |
Step 3 |
Locate and select the workflow to which you want to add the Read File task. Alternatively, you can also add the Read File task while creating a new workflow. |
Step 4 |
Click Workflow Designer. |
Step 5 |
Add the Read File task. |
Step 6 |
Click Close to close the Workflow Designer. |
Related Documentation
The following documentation describes how to go further with Cisco UCS Director by using advanced scripting capabilities not covered in this guide.
-
For a better understanding and usage of Cisco UCS Director Orchestrator, see the Cisco UCS Director Orchestration Guide.
-
For automating operations on a device using generic API tasks, see the Working with Generic API Task of Cisco UCS Director.
-
For a description of scripting technologies available in Cisco UCS Director and help choosing the right solution for your application, see the Cisco UCS Director API Customization and Integration Guide.
-
For an introduction to developing custom tasks, see the Cisco UCS Director Custom Task Getting Started Guide.
-
For examples of scripts that can be used to customize tasks, see the Cisco UCS Director CloupiaScript Cookbook.