Cisco UCS Director PowerShell API User Guide, Release 5.0
First Published: August 04, 2014
Americas Headquarters
Cisco Systems, Inc.
170 West Tasman Drive
San Jose, CA 95134-1706
USA
http://www.cisco.com
Tel: 408 526-4000
800 553-NETS (6387)
Fax: 408 527-0883
Text Part Number: OL-32375-01
THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS,
INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS.
THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH
THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY,
CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY.
The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB's public domain version
of the UNIX operating system. All rights reserved. Copyright © 1981, Regents of the University of California.
NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED “AS IS" WITH ALL FAULTS.
CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE.
IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT
LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network
topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional
and coincidental.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: http://
www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership
relationship between Cisco and any other company. (1110R)
© 2014
Cisco Systems, Inc. All rights reserved.
CONTENTS
Preface
Preface v
Audience v
Conventions v
Related Documentation vii
Documentation Feedback vii
Obtaining Documentation and Submitting a Service Request vii
CHAPTER 1
Getting Started 1
About Cisco UCS Director 1
About Microsoft Windows PowerShell 2
System Requirements 2
Working with PowerShell 2
CHAPTER 2
Working with Cmdlets 5
Configuring the PowerShell Console for Cisco UCS Director 5
Getting Help 5
Defining Inputs 6
Executing Cmdlets 7
Use Case: Canceling a Service Request 7
Pipelined Objects 9
Viewing Reports 10
CHAPTER 3
Troubleshooting 13
Troubleshooting 13
Cisco UCS Director PowerShell API User Guide, Release 5.0
OL-32375-01
iii
Contents
Cisco UCS Director PowerShell API User Guide, Release 5.0
iv
OL-32375-01
Preface
This preface contains the following sections:
• Audience, page v
• Conventions, page v
• Related Documentation, page vii
• Documentation Feedback, page vii
• Obtaining Documentation and Submitting a Service Request, page vii
Audience
This guide is intended primarily for data center administrators who use Cisco UCS Director and who have
responsibilities and expertise in one or more of the following:
• Server administration
• Storage administration
• Network administration
• Network security
• Virtualization and virtual machines
Conventions
Text Type
Indication
GUI elements
GUI elements such as tab titles, area names, and field labels appear in this font.
Main titles such as window, dialog box, and wizard titles appear in this font.
Document titles
Document titles appear in this font.
TUI elements
In a Text-based User Interface, text the system displays appears in this font.
Cisco UCS Director PowerShell API User Guide, Release 5.0
OL-32375-01
v
Preface
Conventions
Text Type
Indication
System output
Terminal sessions and information that the system displays appear in this
font.
CLI commands
CLI command keywords appear in this font.
Variables in a CLI command appear in this font.
Note
Tip
[]
Elements in square brackets are optional.
{x | y | z}
Required alternative keywords are grouped in braces and separated by vertical
bars.
[x | y | z]
Optional alternative keywords are grouped in brackets and separated by vertical
bars.
string
A nonquoted set of characters. Do not use quotation marks around the string or
the string will include the quotation marks.
<>
Nonprinting characters such as passwords are in angle brackets.
[]
Default responses to system prompts are in square brackets.
!, #
An exclamation point (!) or a pound sign (#) at the beginning of a line of code
indicates a comment line.
Means reader take note. Notes contain helpful suggestions or references to material not covered in the
document.
Means the following information will help you solve a problem. The tips information might not be
troubleshooting or even an action, but could be useful information, similar to a Timesaver.
Caution
Means reader be careful. In this situation, you might perform an action that could result in equipment
damage or loss of data.
Timesaver
Means the described action saves time. You can save time by performing the action described in the
paragraph.
Cisco UCS Director PowerShell API User Guide, Release 5.0
vi
OL-32375-01
Preface
Related Documentation
Warning
IMPORTANT SAFETY INSTRUCTIONS
This warning symbol means danger. You are in a situation that could cause bodily injury. Before you
work on any equipment, be aware of the hazards involved with electrical circuitry and be familiar with
standard practices for preventing accidents. Use the statement number provided at the end of each warning
to locate its translation in the translated safety warnings that accompanied this device.
SAVE THESE INSTRUCTIONS
Related Documentation
Cisco UCS Director Documentation Roadmap
For a complete list of Cisco UCS Director documentation, see the Cisco UCS Director Documentation
Roadmap available at the following URL: http://www.cisco.com/en/US/docs/unified_computing/ucs/
ucs-director/doc-roadmap/b_UCSDirectorDocRoadmap.html.
Cisco UCS Documentation Roadmaps
For a complete list of all B-Series documentation, see the Cisco UCS B-Series Servers Documentation Roadmap
available at the following URL: http://www.cisco.com/go/unifiedcomputing/b-series-doc.
For a complete list of all C-Series documentation, see the Cisco UCS C-Series Servers Documentation Roadmap
available at the following URL: http://www.cisco.com/go/unifiedcomputing/c-series-doc.
Note
The Cisco UCS B-Series Servers Documentation Roadmap includes links to documentation for Cisco
UCS Manager and Cisco UCS Central. The Cisco UCS C-Series Servers Documentation Roadmap includes
links to documentation for Cisco Integrated Management Controller.
Documentation Feedback
To provide technical feedback on this document, or to report an error or omission, please send your comments
to [email protected]. We appreciate your feedback.
Obtaining Documentation and Submitting a Service Request
For information on obtaining documentation, submitting a service request, and gathering additional information,
see the monthly What's New in Cisco Product Documentation, which also lists all new and revised Cisco
technical documentation.
Subscribe to the What's New in Cisco Product Documentation as a Really Simple Syndication (RSS) feed
and set content to be delivered directly to your desktop using a reader application. The RSS feeds are a free
service and Cisco currently supports RSS version 2.0.
Cisco UCS Director PowerShell API User Guide, Release 5.0
OL-32375-01
vii
Preface
Obtaining Documentation and Submitting a Service Request
Cisco UCS Director PowerShell API User Guide, Release 5.0
viii
OL-32375-01
CHAPTER
1
Getting Started
This chapter contains the following sections:
• About Cisco UCS Director, page 1
• About Microsoft Windows PowerShell, page 2
• System Requirements, page 2
• Working with PowerShell, page 2
About Cisco UCS Director
Cisco UCS Director (formerly Cisco Cloupia Unified Infrastructure Controller) is a 64-bit appliance that uses
the following standard templates:
• Open Virtualization Format (OVF) for VMware vSphere
• Virtual Hard Disk (VHD) for Microsoft Hyper-V
Cisco UCS Director delivers unified, highly secure management for the industry's leading converged
infrastructure solutions, which are based on the Cisco UCS and Cisco Nexus platforms.
Cisco UCS Director extends the unification of computing and network layers through Cisco UCS to provide
data center administrators with a comprehensive visibility and management capability. It supports NetApp
FlexPod and ExpressPod, EMC Isilon, EMC VSPEX, EMC VPLEX, and VCE Vblock systems, based on the
Cisco UCS and Cisco Nexus platforms.
Cisco UCS Director automates the provisioning of resource pools across physical, virtual, and baremetal
environments. It delivers native, automated monitoring for health, status, and resource utilization. You can
do the following using Cisco UCS Director:
• Create, clone, and deploy service profiles and templates for all servers and applications
• Monitor organizational usage, trends, and capacity across a converged infrastructure on a continuous
basis, such as by viewing heat maps that show virtual machine (VM) utilization across all your data
centers
• Deploy and add capacity to ExpressPod and FlexPod infrastructures in a consistent, repeatable manner
• Manage, monitor, and report on Cisco UCS domains and their components
Cisco UCS Director PowerShell API User Guide, Release 5.0
OL-32375-01
1
Getting Started
About Microsoft Windows PowerShell
• Extend virtual service catalogs to include physical infrastructures services
• Manage secure multitenant environments to accommodate virtualized workloads that run with
nonvirtualized workloads
About Microsoft Windows PowerShell
Microsoft Windows PowerShell is a task-based command-line shell and scripting language that you, as the
system administrator, can use to automate the administration of system resources in your network. When a
PowerShell interface is integrated with the Cisco UCS Director APIs, you can handle datacenter management
with ease.
You use cmdlet (pronounced as command-let), which is a single-feature command, to manipulate objects in
Windows PowerShell. A cmdlet is the combination of a verb and noun separated by a dash (-). Examples are
Get-Help, Get-Process, and Invoke-API. The cmdlets are executed in a Microsoft Windows server. Each
cmdlet performs a single operation; multiple cmdlets can be chained together.
Cisco UCS Director provides a Representational State Transfer (REST) interface that enables you to manage
the internal behavior of PowerShell. PowerShell cmdlets provide a wrapper to these REST APIs.
Cisco UCS Director offers the following REST API types:
• Legacy JSON–based REST APIs—Enables you to submit workflow requests, examine workflow inputs
and output schemas, and fetch reports.
• XML–based REST APIs—Enables you to execute the workflow tasks that are supported by Cisco UCS
Director.
The PowerShell provides cmdlet wrappers for the Legacy JSON–based APIs that aid in the workflow
management.
System Requirements
Windows PowerShell is built on top of the .NET Framework common language runtime (CLR) and the .NET
Framework. It accepts and returns .NET Framework objects.
To work with PowerShell, you must install the Cisco UCS Director PowerShell console on any Windows-based
system that supports the following:
• .NET Framework 4.0 and above
• PowerShell version 3.0 and above
Working with PowerShell
PowerShell provides an interactive prompt to execute cmdlets.
Accessing PowerShell
You can use PowerShell.exe to start a Windows PowerShell session from the command line of another tool,
such as Cmd.exe, or use it at the Windows PowerShell command line to start a new session.
Cisco UCS Director PowerShell API User Guide, Release 5.0
2
OL-32375-01
Getting Started
Working with PowerShell
Viewing the Primary Console and PowerShell Version
The support for PowerShell is available for Cisco UCS Director Release 4.1.0.3 and later releases. You can
view the primary console on which Cisco UCS Director is installed and the version of PowerShell that is
running on your system by using the $PSVersionTable command.
This example shows how to display information about the primary console that Cisco UCS Director is installed
on and which version of PowerShell is being used:
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
$PSVersionTable
Name
---PSVersion
WSManStackVersion
SerializationVersion
CLRVersion
BuildVersion
PSCompatibleVersions
PSRemotingProtocolVersion
Value
----3.0
3.0
1.1.0.1
4.0.30319.18408
6.2.9200.16398
{1.0, 2.0, 3.0}
2.2
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Verifying the Cisco UCS Director Module
You must verify if the Cisco UCS Director module has been installed by using the Get-Module command.
In addition, you can use this command to display the type, version, and name of the Cisco UCS Director
module.
This example shows how to verify if the Cisco UCS Director module has been installed:
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Get-Module
ModuleType
---------Binary
Manifest
Version
------0.9
3.1.0.0
Name
---CiscoUcsdPS
Microsoft.PowerShell.Utility
ExportedCommands
--------------<Invoke–userAPICan...
<Add–Member, Add–T...
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Viewing Cmdlets
You can view the list of cmdlets that are available for use by using the Get-Command command. The Name
column lists the cmdlets in the verb-noun naming convention.
This example shows how to display a list of the cmdlets that are available:
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Get-Command -Module CiscoUcsdPS
CommandType
---------Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Name
---Invoke-UserAPICancelSeviceRequest
Invoke-UserAPIExecuteVMAction
Invoke-UserAPIGetAllCatalogs
Invoke-UserAPIGetAllGroups
Invoke-UserAPIGetAvailableReports
Invoke-UserAPIGetHistoricalReports
Invoke-UserAPIGetInstantDataReport
Invoke-UserAPIGetPage
Invoke-UserAPIGetSeviceRequestDetails
Invoke-UserAPIGetSeviceRequests
Invoke-UserAPIGetSeviceRequestWorkflow
Invoke-UserAPIGetTabularReport
ModuleName
---------CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
Cisco UCS Director PowerShell API User Guide, Release 5.0
OL-32375-01
3
Getting Started
Working with PowerShell
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Cmdlet
Invoke-UserAPIGetVMActionRequests
Invoke-UserAPIGetWorkflowInputs
Invoke-UserAPIGetWorkflowInputValue
Invoke-UserAPIGetWorkflowInputValues
Invoke-UserAPIGetWorkflows
Invoke-UserAPIGetWorkflowStatus
Invoke-UserAPIReceiveObject
Invoke-UserAPIReconfigureVM
Invoke-UserAPIRollbackflow
Invoke-UserAPISubmitServiceRequest
Invoke-UserAPISubmitServiceRequestCustom
Invoke-UserAPISubmitWorkflowServiceRequest
Invoke-UserAPISubmitWorkflowServiceRequestWithG...
Invoke-UserAPISubmitWorkflowServiceRequestWithS...
Invoke-UserAPIValidateWorkflow
Invoke-UserAPIWorkflowInputDetails
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
CiscoUcsdPS
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Cisco UCS Director PowerShell API User Guide, Release 5.0
4
OL-32375-01
CHAPTER
2
Working with Cmdlets
This chapter contains the following sections:
• Configuring the PowerShell Console for Cisco UCS Director, page 5
• Getting Help, page 5
• Defining Inputs, page 6
• Executing Cmdlets, page 7
• Pipelined Objects, page 9
• Viewing Reports, page 10
Configuring the PowerShell Console for Cisco UCS Director
You must configure the environment variables in the PowerShell console to run the cmdlets against the Cisco
UCS Director server. All cmdlets accept the IP address of Cisco UCS Director and the REST Key as optional
parameters. If you do not specify these parameters, the cmdlets pick their targets from the PowerShell
environment variables UCSD_SERVER and UCSD_RESTKEY.
You can configure the environment variables using the SetEnvironmentVariable method as follows:
[Environment]::SetEnvironmentVariable("UCSD_SERVER","10.1.1.1","User")
[Environment]::SetEnvironmentVariable("UCSD_RESTKEY","562FDF763A384E78B9BAB7FE02CA13B6","User")
You can retrieve the configured environment variables using the GetEnvironmentVariable command as
follows:
[Environment]::GetEnvironmentVariable("UCSD_RESTKEY","User")
Changes that you make to environment variables take effect only when you restart the session.
Getting Help
You can run cmdlets in Windows PowerShell. To get help for a cmdlet, use the ? or get-Help command.
When you enter ? with the cmdlet, you see the syntax, parameters, aliases, and remarks for the cmdlet.
Cisco UCS Director PowerShell API User Guide, Release 5.0
OL-32375-01
5
Working with Cmdlets
Defining Inputs
This example shows how to get help for a cmdlet:
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Invoke–userAPISubmitServiceRequest –?
NAME
Invoke–userAPISubmitServiceRequest
SYNTAX
Invoke–userAPISubmitServiceRequest [–catalogName] <string> [-vdcName] <string>
[-durationHours] <int> [-beginTime] <long> [quantity] <int> [-comments] <string> [-server <string>] [-restkey <string>]
ALIASES
None
REMARKS
None
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Each cmdlet has mandatory and optional parameters. For example, the Invoke–userAPISubmitServiceRequest
cmdlet has the catalogName as a mandatory parameter, and the server and restKey are optional parameters.
You can get detailed help about the individual parameters of a cmdlet when you use the get-Help command,
the cmdlet name, and parameter as follows:
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
get-Help Invoke–userAPISubmitServiceRequest –Parameter catalogName
–catalogName <string>
Required?
Position?
Accept pipeline input?
Paramter set name
Aliases
Dynamic?
true
0
false
<All>
None
None
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
get-Help Invoke–userAPISubmitServiceRequest –Parameter server
–server <string>
Required?
Position?
Accept pipeline input?
Paramter set name
Aliases
Dynamic?
false
Named
false
<All>
None
false
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Defining Inputs
Cmdlets take inputs as described in the Cisco UCS Director REST Developer Guide. For more information
about REST APIs, see the Cisco UCS Director REST Developer Guide.
The cmdlets that submit a workflow take an array of name-value pairs as workflow inputs. You must specify
the input as an array of colon-separated name-value pairs as follows:
Name1:value1, Name2:value2
Cisco UCS Director PowerShell API User Guide, Release 5.0
6
OL-32375-01
Working with Cmdlets
Executing Cmdlets
For example, to submit a workflow named user-add-test, the command line is as follows:
Invoke-userAPISubmitWorkflowServiceRequest user-add-test -parameters
user-type:Regular,group-id:1,login-name:cmdlettest1,password:test,confirm-password:test,email:[email protected]
Executing Cmdlets
Cmdlets are executed in the same way as any other PowerShell command. You can apply common operations,
such as search and filtering, to the outputs of the commands by using the pipe operator (¦).
This example shows how to get the parameters of a cmdlet using the ? command, and capture and filter of
cmdlet outputs:
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Invoke–userAPIGetWorkflowInputValues –?
NAME
Invoke–userAPIGetWorkflowInputValues
SYNTAX
Invoke–userAPIGetWorkflowInputValues [–srId] <int> [-server <string>] [-restkey <string>]
[<CommonParameters>]
ALIASES
None
REMARKS
None
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Invoke–userAPIGetWorkflowInputValues 429
Input Set Id
-----------18
18
18
18
18
18
18
18
Action Id
--------0
156
156
156
156
156
156
156
Field Id
-------WF_EMPTY_INPUTS
input_0_user-type471
AddUser_231.OUTUT_USER_NAME
input_3_password453
input_4_confirm-password361
input_5_email1932
input_1_group-id135
input_2_login-name867
Field Value
----------Regular
cmdlettest1
test
test
[email protected]
1
cmdlettest1
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Invoke–userAPIGetWorkflowInputValues 429 ¦ Select-Object 'Field Id', 'Field Value'
Field Id
-------WF_EMPTY_INPUTS
input_0_user-type471
AddUser_231.OUTUT_USER_NAME
input_3_password453
input_4_confirm-password361
input_5_email1932
input_1_group-id135
input_2_login-name867
Field Value
----------Regular
cmdlettest1
test
test
[email protected]
1
cmdlettest1
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Use Case: Canceling a Service Request
This section explains how you can cancel a service request through the PowerShell console.
Cisco UCS Director PowerShell API User Guide, Release 5.0
OL-32375-01
7
Working with Cmdlets
Use Case: Canceling a Service Request
Before You Begin
Ensure that you have configured the environment variables in the PowerShell console to run the cmdlets
against the Cisco UCS Director server. For more information, see Configuring the PowerShell Console for
Cisco UCS Director, on page 5.
Step 1
View the list of cmdlets that are available for use by using Get-Command. The cmdlet for canceling a service request
is Invoke–userAPICancelServiceRequest.
Step 2
Get the parameters of the Invoke–userAPICancelServiceRequest cmdlet using the ? command.
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Invoke–userAPICancelServiceRequest –?
NAME
Invoke–userAPICancelServiceRequest
SYNTAX
Invoke–userAPICancelServiceRequest [–requestId] <int> [-server <string>] [-restkey <string>]
[<CommonParameters>]
ALIASES
None
REMARKS
None
The input required for executing the Invoke–userAPICancelServiceRequest cmdlet are:
• requestId—Mandatory parameter
• server—Optional parameter
• restKey—Optional parameter
Note
Step 3
You can use the get-Help command to get detailed help about the individual parameters of a cmdlet. For more
information, see Getting Help, on page 5.
Execute the command by passing the service request ID (for example, 79) as follows:
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Invoke–userAPICancelServiceRequest 79
This command returns the Boolean value as output. On successful cancellation of the service request, True is returned
as output.
True
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Cisco UCS Director PowerShell API User Guide, Release 5.0
8
OL-32375-01
Working with Cmdlets
Pipelined Objects
Pipelined Objects
You can connect commands together with the pipe operator (¦), to execute common options on the command
output. The output of each command is used as input to the next command.
The following table lists the types of objects that are written to the pipeline by cmdlets.
Cmdlet
Return Object Type
Invoke-userAPICancelServiceRequest
SR ID (Int)
Invoke-userAPIExecuteVMAction
VM Id ( String )
Invoke-userAPIGetAllCatalogs
APITabularReport
Invoke-userAPIGetAllGroups
APITabularReport
Invoke-userAPIGetAllVDCs
APITabularReport
Invoke-userAPIGetAvailableReports
Array of APIReportDefinition
Invoke-userAPIGetHistoricalReport
Array of HistoricalDataSeries
Invoke-userAPIGetInstantDataReport
APISnapshotReport
Invoke-userAPIGetPage
VMDataViewPaginated
Invoke-userAPIGetServiceRequestDetails
APIServiceRequestDetails
Invoke-userAPIGetServiceRequests
APITabularReport
Invoke-userAPIGetServiceRequestWorkFlow
APIWorkflowStatus
Invoke-userAPIGetTabularReport
APITabularReport
Invoke-userAPIGetVMActionRequests
APITabularReport
Invoke-userAPIGetWorkflowInputs
Array of APIWorkflowInputDetail
Invoke-userAPIGetWorkflowInputValue
String
Invoke-userAPIGetWorkflowInputValues
WorkflowInputValue
Invoke-userAPIGetWorkflows
Array of CustomActionDefinition
Invoke-userAPIGetWorkflowStatus
Integer
Invoke-userAPIReconfigureVM
VM Id ( String )
Invoke-userAPIRollbackWorkflow
SR ID
Invoke-userAPISubmitServiceRequest
SR ID
Invoke-userAPISubmitServiceRequestCustom
SR ID
Invoke-userAPISubmitWorkflowServiceRequest
SR ID
Invoke-userAPISubmitWorkflowServiceRequestWithGroup SR ID
Invoke-userAPISubmitWorkflowServiceRequestWithStartTimeAndDurationHours SR ID
Cisco UCS Director PowerShell API User Guide, Release 5.0
OL-32375-01
9
Working with Cmdlets
Viewing Reports
Cmdlet
Return Object Type
Invoke-userAPIValidateWorkFlow
APIWFValidationResult
Invoke-userAPIWorkflowInputDetails
APIWorkflowInputDetails
Viewing Reports
You can view reports by using the following cmdlets:
• Invoke-UserAPIGetAllCatalogs
• Invoke-UserAPIGetAllGroups
• Invoke-UserAPIGetAvailableReports
• Invoke-UserAPIGetHistoricalReports
• Invoke-UserAPIGetInstantDataReport
• Invoke-UserAPIGetPage
• Invoke-UserAPIGetSeviceRequestDetails
• Invoke-UserAPIGetSeviceRequests
• Invoke-UserAPIGetSeviceRequestWorkflow
• Invoke-UserAPIGetTabularReport
• Invoke-UserAPIGetVMActionRequests
• Invoke-UserAPIGetWorkflowInputs
• Invoke-UserAPIGetWorkflowInputValue
• Invoke-UserAPIGetWorkflowInputValues
• Invoke-UserAPIGetWorkflows
• Invoke-UserAPIGetWorkflowStatus
The userAPIGetPage API requires the name of the paginated report as one of the parameters.
The following table provides the report name and its context value:
Report Name
Context Value
CHARGEBACK_DETAILS_SERVICES_GLOBAL_TABULAR
None
PER_CLOUD_ARCHIVED_HYPERV_VM_LIST_REPORT
<cloudName>
vms.paginated.report
<cloudName>
PER_CLOUD_ARCHIVED_VM_LIST_REPORT
<cloudName>
Cisco UCS Director PowerShell API User Guide, Release 5.0
10
OL-32375-01
Working with Cmdlets
Viewing Reports
This example shows how to fetch a page of the vmware-account account report:
Invoke-userAPIGetPage vms.paginated.report vmware-account 1 10
Cisco UCS Director PowerShell API User Guide, Release 5.0
OL-32375-01
11
Working with Cmdlets
Viewing Reports
Cisco UCS Director PowerShell API User Guide, Release 5.0
12
OL-32375-01
CHAPTER
3
Troubleshooting
This chapter contains the following section:
• Troubleshooting, page 13
Troubleshooting
This section provides solution to the issues that an administrator may face when using the PowerShell console.
Running Script is disabled
Problem
Running Script is disabled.
Description
When you launch the PowerShell command prompt, an error message stating that the running script is disabled
is thrown as follows.
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
C:\Windows\System32\windowspowershell\v1.0\powershell.exe -NoExit -File -\StartUcsdPS.ps1
Widows PowerShell
Copyright <c> 2013 Microsoft Corporation. All rights reserved.
File C:\Program Files <x86>\Cisco\Cisco UCS Director PowerShell
Console\Modules\CiscoUcsdPS\StartUcsdPS.ps1 cannot be loaded because running scripts is
disabled on this system. For more information, see about_Exeuction_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo
: SecurityError: <:> [], ParentContainsErrorRecord Exception
+ FullyQualifiedErrorId : UnauthorizedAccess
Solution
The execution policy is part of the security strategy of Windows PowerShell. It determines whether you can
load configuration files (including your Windows PowerShell profile) and run scripts, and it determines which
scripts, if any, must be digitally signed before they will run. The Set-ExecutionPolicy cmdlet changes the
user preference for the Windows PowerShell execution policy.
Cisco UCS Director PowerShell API User Guide, Release 5.0
OL-32375-01
13
Troubleshooting
Troubleshooting
To change the execution policy for the default scope, start Windows PowerShell and set the ExecutionPolicy
to Unrestricted as follows:
PS C:\Program Files (x86)\Cisco\Cisco UCS Director PowerShell Console\Modules\CiscoUcsdPS>
Set-ExecutionPolicy Unrestricted
Cmdlet execution is failed
Problem
During execution of cmdlet, the PowerShell console throws any one of the following errors:
• The Cisco UCS Director server could not be reached.
• The operation timed out error.
• IP/REST Key can't be Empty.
Description
Even after configuring the environment variables UCSD_RESTKEY and UCSD_SERVER, the cmdlet is
failed to execute.
PS C:\UCSDPowerShellTest\Modules\CiscoUcsdPS>
[Environment]::SetEnvironmentVariable("UCSD_SERVER","10.1.1.1","User")
PS C:\UCSDPowerShellTest\Modules\CiscoUcsdPS>
[Environment]::SetEnvironmentVariable("UCSD_RESTKEY","5E8DA3924FDB4CC49213FCAAE2CBCEEB","User")
PS C:\UCSDPowerShellTest\Modules\CiscoUcsdPS> Invoke-userAPIGetAllGroups
Invoke-userAPIGetAllGroups : IP/REST Key can't be Empty
At line:1 char:1
+ Invoke-userAPIGetAllGroups
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo
: InvalidArgument: (server/restKey:String) [Invoke
- userAPIGetAllGroups], ArgumentException
Solution
The values set to the environment variables are picked by APIs only after re-launching the console.
Cisco UCS Director PowerShell API User Guide, Release 5.0
14
OL-32375-01
© Copyright 2026 Paperzz