Custom Tasks

This chapter contains the following sections:

Custom Tasks and Script Bundles

Custom tasks enable developers to perform customized operations on Cisco UCS Director resources. You write custom tasks using CloupiaScript, a language similar to JavaScript. You then use your custom tasks like any other task, including them in workflows to orchestrate work on your systems.

Script bundles are collections of custom tasks that are included with each new Cisco UCS Director release for a variety of specific applications. You can download a script bundle and import the custom tasks into Cisco UCS Director.

In both cases the goal is the same: to expand the range of tasks available for use in orchestration workflows in Cisco UCS Director.

When to Use Custom Tasks and Script Bundles

Custom tasks and script bundles supplement the task library that comes with Cisco UCS Director. Use them when there is no existing task that implements the functionality you need.

When to Use Custom Tasks

Use custom tasks when you have a single operation or unit of work that will recur in your workflows, and there is no existing task that performs the operation.

When to Use Script Bundles

Script bundles are provided with every major release. It is worthwhile to investigate new script bundles to see if any of the new or enhanced tasks implement workflow functionality required by your organization.

Following is a list scripts provided in the script bundles that can be downloaded with the Cisco UCS Director image:

Script Number

Script File

1 Add-UCSM-UUIDPool.wfdx
2 AddPortgroupToNetworkPolicy.wfdx
3 AddVMToInventory.wfdx
4 AssignCatalogsToAGroup.wfdx
5 Change-Cluster-In-Computing-Policy.wfdx
6 ConfigureVMAnnotation.wfdx
7 Create-UCSM-WWNN-WWPN-Pool.wfdx
8 CreateNetappAccount.wfdx
9 CreateUCSAccount.wfdx
10 CreateUCSMNetworkPolicy.wfdx
11 CreateUCSMServiceProfileTemplate.wfdx
12 CreateUCSMStoragePolicy.wfdx
13 CreateVMWareDatastoreClusterStoragePolicy.wfdx
14 DeleteVMWareSystemPolicy.wfdx
15 Free-VLANFrom-VLANPool.wfdx
16 Get Vmware HostNode Identity.wfdx
17 Get vCenter account details.wfdx
18 Get-NetApp-Volume.wfdx
19 Get-WWN-Of-Vmware-iSCSI-and-FC-Adapter-Type.wfdx
20 Get-Workflow-Output-Value.wfdx
21 GetAPICAccountDetails.wfdx
22 GetAllVMDetailsInAnArray.wfdx
23 GetFailedServiceRequestDetails.wfdx
24 GetGroupAdminUserFromUserGroup.wfdx
25 GetHypervVMSnapshotDetails.wfdx
26 GetInputDetailsBySRId.wfdx
27 GetNetAppInterfaceIdentity.wfdx
28 GetUCSServerUUID.wfdx
29 GetVMwareVMsByUserId.wfdx
30 GetVNICAdapterOfProvisionedVM.wfdx
31 GetWWNofBootDevicesWorkflow.wfdx
32 Modify VM Property Attributes.wfdx
33 ModifyUserPasswordAndAPIKey.wfdx
34 MultiTaskExample.wfdx
35 RemoveEsxiCluster.wfdx
36 ScheduleWorkflowServiceRequest.wfdx
37 ServiceContainerGatewayVLANs.wfdx
38 VM-Naming.wfdx

Using Custom Tasks and Script Bundles

As with any other task, custom tasks and tasks included in script bundles are executed as part of a workflow.

How to Use Custom Tasks

You create custom tasks using a wizard in Cisco UCS Director. To create a custom task, you must supply:

  • A name for the custom task.

  • Inputs and outputs for the custom task.

  • (Optional) Input Controllers, written in Cloupiascript.

  • Cloupiascript instructions to do the work of the custom task.

For system requirements and information about how to set up a development environment, install libraries, and begin using CloupiaScript to write custom tasks, see the Cisco UCS Director Custom Task Getting Started Guide.

For examples of creating custom tasks, see the Cisco UCS Director Custom Task Cookbook.

For a reference to Cisco UCS Director Custom Task classes and methods, see the Cisco UCS Director Javadoc.

How to Use Script Bundles

To use the custom tasks in a script bundle, you simply download the script bundle and import custom tasks from the bundle.

To download a script bundle for the current release of Cisco UCS Director, go to Cisco DevNet.

For instructions on importing custom tasks from a script bundle, see Importing Workflows in the Cisco UCS Director Orchestration Guide.