cisco virtual application cloud segmentation services rest ......cisco systems, inc. 1 cisco virtual...

151
Cisco Systems, Inc. www.cisco.com 1 Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0 First Published: 2016-05-06 Last Updated: 2016-05-06

Upload: others

Post on 24-Jul-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

  • Cisco Systems, Inc. www.cisco.com

    1

    Cisco Virtual Application Cloud

    Segmentation Services REST API Guide,

    Release 5.4STV3.0 First Published: 2016-05-06

    Last Updated: 2016-05-06

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Overview

    2

    Contents Overview ............................................................................................................................................................................ 9

    About the Cisco VACS REST API ..................................................................................................................................... 9

    Access Privileges ............................................................................................................................................................ 9

    Supported Protocols and Formats ................................................................................................................................. 9

    Recommended Tools ................................................................................................................................................... 10

    Poodle Vulnerability .................................................................................................................................................... 10

    Getting Started ................................................................................................................................................................ 11

    About the API Access Key ............................................................................................................................................ 11

    Generating an API Access Key ...................................................................................................................................... 11

    Enabling the Developer Menu Options ....................................................................................................................... 11

    Using the REST API Browser ......................................................................................................................................... 12

    Prerequisites ............................................................................................................................................................ 12

    Accessing the Report Metadata ................................................................................................................................... 13

    Prerequisites ............................................................................................................................................................ 13

    Request Format ........................................................................................................................................................... 13

    Response Format ......................................................................................................................................................... 15

    REST Tools ........................................................................................................................................................................ 17

    REST API Browser ......................................................................................................................................................... 17

    Usage Example: Retrieving the VM Summary ......................................................................................................... 17

    Usage Example: Creating a Group ........................................................................................................................... 18

    Usage Example: Sample Java Code .......................................................................................................................... 20

    REST API SDK Bundle .................................................................................................................................................... 21

    About the REST API Operations ....................................................................................................................................... 22

    Cisco UCS Director API Operations .................................................................................................................................. 23

    Login Operation ........................................................................................................................................................... 23

    userAPIGetUserLoginProfile .................................................................................................................................... 23

    Values Fetch Operations .............................................................................................................................................. 23

    userAPIGetLOVValue ............................................................................................................................................... 23

    userAPIGetTabularValue .......................................................................................................................................... 23

    User Account Operations ............................................................................................................................................. 24

    userAPIAddUser ....................................................................................................................................................... 24

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Overview

    3

    userAPIOnBoarding .................................................................................................................................................. 24

    userAPIUpdateUser ................................................................................................................................................. 24

    userAPIDeleteUser ................................................................................................................................................... 25

    userAPIResetMyPassword ....................................................................................................................................... 25

    userAPIResetUserPassword ..................................................................................................................................... 26

    userAPIVerifyUser .................................................................................................................................................... 26

    userAPIGetRESTAccessKey ....................................................................................................................................... 27

    userAPIIsMspMode .................................................................................................................................................. 27

    Group Operations ........................................................................................................................................................ 28

    userAPICreateGroup ................................................................................................................................................ 28

    userAPIAddGroup .................................................................................................................................................... 28

    userAPIGetGroups ................................................................................................................................................... 29

    userAPIGetGroupById .............................................................................................................................................. 29

    userAPIGetGroupByName ....................................................................................................................................... 29

    userAPIUpdateGroup ............................................................................................................................................... 30

    userAPIDeleteGroup ................................................................................................................................................ 30

    Account Operations ..................................................................................................................................................... 31

    userAPICreateInfraAccount ..................................................................................................................................... 31

    userAPIUpdateInfraAccount .................................................................................................................................... 32

    userAPIGetAllAccounts ............................................................................................................................................ 33

    userAPIGetAllPhysicalInfraAccounts ....................................................................................................................... 33

    userAPIGetAccountTypeEntryByName .................................................................................................................... 33

    userAPIGetAccountTypeByName ............................................................................................................................ 33

    userAPIDeleteInfraAccount ..................................................................................................................................... 34

    Report Operations ....................................................................................................................................................... 35

    userAPIGetAvailableReports .................................................................................................................................... 35

    userAPIGetTabularReports ...................................................................................................................................... 35

    userAPIFilterTabularReport ..................................................................................................................................... 35

    userAPIGetHistoricalReport ..................................................................................................................................... 36

    userAPIGetInstantDataReport ................................................................................................................................. 36

    userAPIGetTabularReportWithMetaData ................................................................................................................ 36

    Approval Operations .................................................................................................................................................... 36

    userAPIGetMyApprovalList ...................................................................................................................................... 36

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Overview

    4

    userAPIUpdateMyApproval ..................................................................................................................................... 37

    Catalog Operations .......................................................................................................................................................... 38

    userAPICreateCatalogItem .......................................................................................................................................... 38

    userAPIGetAllCatalogs ............................................................................................................................................. 38

    userAPIGetCatalogsPerGroup .................................................................................................................................. 38

    userAPIGetAllCatalogs ............................................................................................................................................. 38

    Chargeback Operations ............................................................................................................................................... 40

    userAPIChargebackDetails ....................................................................................................................................... 40

    Funds Operations ......................................................................................................................................................... 40

    userAPICheckFunds.................................................................................................................................................. 40

    Inventory (Cloud) Operations ...................................................................................................................................... 41

    userAPIRequestInventoryCollection ........................................................................................................................ 41

    LOV Provider Operations ............................................................................................................................................. 41

    userAPIgetStaticListByName .................................................................................................................................... 41

    userAPIgetBMAOSList .............................................................................................................................................. 41

    userAPIGetLOVProvidersList .................................................................................................................................... 41

    Payment Status Operations ......................................................................................................................................... 43

    userAPIUpdatePaymentStatus ................................................................................................................................ 43

    Resource Accounting and Limits .................................................................................................................................. 43

    userAPIGetResourceAccounting .............................................................................................................................. 43

    userAPIGetResourceAccountingDetails ................................................................................................................... 43

    userAPIGetResourceLimits ...................................................................................................................................... 43

    userAPIGetResourceLimitsForMyGroup .................................................................................................................. 44

    Cisco VACS Container Operations ................................................................................................................................ 45

    userAPIGetContainerDetails .................................................................................................................................... 45

    userAPIGetStaticNAT ............................................................................................................................................... 46

    userAPIGetStaticNATPerVM .................................................................................................................................... 47

    userAPIVACSSetNat ................................................................................................................................................. 48

    userAPIGetERSPAN .................................................................................................................................................. 49

    userAPIVACSsetErspan ............................................................................................................................................ 50

    userAPIGetERSPANWithVM ..................................................................................................................................... 51

    userAPIVACSaddVM ................................................................................................................................................. 52

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Overview

    5

    userAPIVACSdeleteVM ............................................................................................................................................ 53

    userAPIVACSPowerOnContainer ............................................................................................................................. 54

    userAPIVACSPowerOffContainer ............................................................................................................................. 55

    userAPIGetVACSResourceHistory ............................................................................................................................ 56

    userAPIGetContainerVmIps ..................................................................................................................................... 65

    userAPIVACSaddVM(with password sharing options) ............................................................................................. 65

    userAPIGetFirewallPolicy ......................................................................................................................................... 66

    userAPIVACSManageFirewallPolicyAclRule (Add Firewall Policy) ........................................................................... 68

    userAPIVACSManageFirewallPolicy (Update Firewall Policy) .................................................................................. 69

    userAPIVACSManageFirewallPolicyAclRule (Delete Firewall Policy) ....................................................................... 70

    userAPIGetSLB ......................................................................................................................................................... 72

    userAPIGetTemplate ................................................................................................................................................ 73

    userAPIVACSCreateContainerRest ........................................................................................................................... 76

    userAPIGetZones ..................................................................................................................................................... 96

    userAPIGetZonesWithVM ........................................................................................................................................ 97

    Service Category Operations ....................................................................................................................................... 99

    userAPIGetServiceCategory ..................................................................................................................................... 99

    userAPICreateServiceCategory ................................................................................................................................ 99

    userAPICloneServiceCategory .................................................................................................................................. 99

    userAPIModifyServiceCategory ............................................................................................................................... 99

    userAPIDeleteServiceCategory .............................................................................................................................. 100

    Service Request Operations ....................................................................................................................................... 100

    userAPISubmitServiceRequest ............................................................................................................................... 100

    userAPISubmitServiceRequestCustom .................................................................................................................. 101

    userAPIResubmitServiceRequest ........................................................................................................................... 101

    userAPIGetServiceRequests ................................................................................................................................... 102

    userAPIGetChildServiceRequests ........................................................................................................................... 102

    userAPIGetServiceRequestDetails ......................................................................................................................... 102

    userAPICancelServiceRequest ............................................................................................................................... 102

    userAPIGetServiceRequestLogEntries ................................................................................................................... 103

    userAPIGetServiceRequestLogEntriesAtLevels ...................................................................................................... 103

    userAPIGetServiceRequestWorkFlow .................................................................................................................... 103

    userAPISubmitVAppServiceRequest ...................................................................................................................... 104

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Overview

    6

    userAPIGetVMsForServiceRequest ........................................................................................................................ 104

    userAPISubmitWorkflowServiceRequest ............................................................................................................... 104

    Task Operations ......................................................................................................................................................... 105

    VDC Operations.......................................................................................................................................................... 105

    userAPIGetAllVDCs................................................................................................................................................. 105

    userAPICreateVDC ................................................................................................................................................. 105

    userAPIExportVDC ................................................................................................................................................. 105

    userAPIImportVDC ................................................................................................................................................. 106

    VM Operations ........................................................................................................................................................... 106

    UserAPIProvisionRequest ...................................................................................................................................... 106

    UserAPIProvisionRequestWithPortGroup ............................................................................................................. 107

    userAPIGetAllVMs .................................................................................................................................................. 108

    userAPIGetVMSummary ........................................................................................................................................ 108

    userAPIGetVMsForServiceRequest ........................................................................................................................ 108

    userAPIGetVMActionRequests .............................................................................................................................. 109

    userAPIGetAvailableVMActions ............................................................................................................................. 109

    userAPIExecuteVMAction (for VMware vSphere VMs) ......................................................................................... 110

    userAPIExecuteVMAction (for Microsoft Hyper-V VMs) ....................................................................................... 110

    userAPIHypervVMProvisioningWithVMNetwork .................................................................................................. 111

    userAPIReconfigureVM .......................................................................................................................................... 113

    userAPIGetVMActionStatus ................................................................................................................................... 113

    userAPISetVMProperties ....................................................................................................................................... 113

    userAPIGetVMAccessCredentials .......................................................................................................................... 113

    userAPIGetVMSnapshotDetails ............................................................................................................................. 114

    userAPICreateVMSnapshot ................................................................................................................................... 114

    userAPICheckContextActionStatus ........................................................................................................................ 114

    userAPIDeleteCatalogItem ..................................................................................................................................... 114

    userAPIVMWareProvisionRequest ........................................................................................................................ 115

    userAPIVMWareCloneVMProvisionRequest ......................................................................................................... 115

    userAPIVMWareMoveVMProvisionRequest ......................................................................................................... 116

    userAPIConfigureVMLeaseTime ............................................................................................................................ 116

    Workflow Operations ................................................................................................................................................ 117

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Overview

    7

    userAPIGetWorkflows ............................................................................................................................................ 117

    userAPIGetWorkflowSteps .................................................................................................................................... 117

    userAPIGetWorkflowStatus ................................................................................................................................... 117

    userAPIGetWorkflowInputs ................................................................................................................................... 118

    userAPIValidateWorkFlow ..................................................................................................................................... 118

    userAPISubmitWorkflowServiceRequest ............................................................................................................... 118

    userAPIRollbackWorkflow ..................................................................................................................................... 119

    userAPIExportWorkflows ....................................................................................................................................... 119

    userAPIImportWorkflows ...................................................................................................................................... 119

    Activity Operations .................................................................................................................................................... 119

    userAPIGetActivity ................................................................................................................................................. 119

    userAPICreateActivity ............................................................................................................................................ 120

    userAPICloneActivity .............................................................................................................................................. 120

    userAPIModifyActivity ........................................................................................................................................... 120

    userAPIDeleteActivity ............................................................................................................................................ 120

    Tag Operations ........................................................................................................................................................... 121

    userAPIGetTagLibrary ............................................................................................................................................ 121

    userAPICreateTag .................................................................................................................................................. 121

    userAPICloneTag .................................................................................................................................................... 121

    userAPIModifyTag .................................................................................................................................................. 121

    userAPIDeleteTag .................................................................................................................................................. 122

    Resource Group Operations ...................................................................................................................................... 122

    userAPIgetResourceGroups ................................................................................................................................... 122

    userAPICreateResourceGroup ............................................................................................................................... 122

    userAPIModifyResourceGroup .............................................................................................................................. 124

    userAPIDeleteResourceGroup ............................................................................................................................... 124

    Script Operations ....................................................................................................................................................... 125

    userAPIExecuteVIXScript ........................................................................................................................................ 125

    Understanding Workflows ............................................................................................................................................. 125

    Workflow Designer .................................................................................................................................................... 126

    Predefined Tasks ........................................................................................................................................................ 127

    Predefined Workflows ............................................................................................................................................... 127

    Cisco VACS Workflows ............................................................................................................................................... 127

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Overview

    8

    Creating a Workflow .................................................................................................................................................. 127

    Adding Tasks to a Workflow ...................................................................................................................................... 128

    Linking Tasks .............................................................................................................................................................. 129

    Accessing the Task Documentation ........................................................................................................................... 130

    Sample Custom Tasks or Workflows .............................................................................................................................. 130

    Adding a Custom Task to an Existing Workflow .................................................................................................... 130

    Code Snippets ................................................................................................................................................................ 137

    1. How to get the list of catalog items for a given group? .................................................................................... 139

    2. How to order a Cisco VACS container based on the catalog items? ................................................................. 139

    3. How to view a container details? ...................................................................................................................... 140

    4. How to get the status of a service request? ...................................................................................................... 141

    5. How to execute VM life-cycle operations on a workload VM? ......................................................................... 143

    6. How to get the status of workload VMs? .......................................................................................................... 144

    7. How to get the StaticNAT information for a container? .................................................................................... 145

    8. How to add a workload VM to a container? ...................................................................................................... 146

    9. How to delete a workload VM in a container? .................................................................................................. 148

    Obtaining Documentation and Submitting a Service Request ...................................................................................... 149

    Related Documentation ................................................................................................................................................. 149

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Overview

    9

    Overview This section includes the following topics:

    About the Cisco VACS REST API

    Access Privileges

    Supported Protocols and Formats

    Recommended Tools

    POODLE Vulnerability

    About the Cisco VACS REST API

    The Cisco VACS REST API enables you to perform operations on the Cisco UCS Director resources and to integrate

    these operations into applications so that they can provide API-supported functionality and features. You can use

    applications developed using this REST (Representational State Transfer) API to do the following:

    Get Cisco UCS Director reports about physical and virtual devices, networks, appliances, groups and users,

    policies, administration, resource accounting, funds, and other monitored entities within your Cisco UCS

    Director.

    Invoke orchestrator workflow and task operations.

    Invoke additional operations specific to Cisco UCS Director.

    Access Privileges

    With appropriate access privileges, you can use the APIs to get any report made available through Cisco UCS Director.

    Access to the API interface is limited to registered user accounts. Secure access is administered through the use of the

    REST API Access Key, which is a unique key code assigned to each user account. A user account is administratively

    associated with a user type, so this access key determines the user account's level of access to information exposed

    through the API.

    Different user types have access to different categories of data. A Cisco UCS Director administrator defines the access

    rules associated with each user type. For more information on the end-user and administrator user types and the data

    accessible to each type of user, see the http://www.cisco.com/c/en/us/support/servers-unified-computing/ucs-

    director/products-maintenance-guides-list.html or contact your system administrator. Work with your system

    administrator to get the necessary user access privileges for your project.

    Supported Protocols and Formats

    Cisco VACS REST APIs are compatible with any HTTP or HTTPS browser. The REST APIs use code formatted in JSON

    and XML. A Java API is also available.

    JSON

    Unless otherwise noted, the Cisco UCS Director API documentation refers to REST API request arguments and

    responses (payload data) that are encoded in JSON (JavaScript Object Notation) format. For more information, see http:/

    /www.json.org or http://en.wikipedia.org/wiki/JSON.

    Note

    Live and valid Cisco VACS REST API requests and responses in JSON format are provided within Cisco UCS Director.

    These provide excellent examples of JSON protocols and formatting. To see this API data, you must first enable the

    developer menus and then use the Report Metadata option available on any report in Cisco UCS Director. For more

    information, see Enabling the Developer Menu Options.

    http://www.cisco.com/c/en/us/support/servers-unified-computing/ucs-director/products-maintenance-guides-list.htmlhttp://www.cisco.com/c/en/us/support/servers-unified-computing/ucs-director/products-maintenance-guides-list.htmlhttp:///www.json.orghttp:///www.json.orghttp:///en.wikipedia.org/wiki/JSON

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Overview

    10

    XML

    For information about using XML-formatted REST API requests, see Using the REST API Browser. This provides

    information about using the REST API browser, which is embedded in Cisco UCS Director.

    Java

    For information about using the Java API, see the Cisco UCS Director REST API Javadocs and the Cisco UCS Director

    Open Automation API Javadocs.

    Recommended Tools

    The Cisco VACS API uses HTTP or HTTPS as communication protocols. Any compatible browser or client with user

    account access can be used to submit requests to the Cisco VACS API. Most programming languages have built-in or

    open source libraries that provide REST API access and parsing of JSON and XML.

    For exploring and testing the APIs, we recommend the following software tools and options:

    Developer Menu Options

    Cisco UCS Director includes Developer Menu options that include crucial features and tools for developers, such as

    Report Metadata and access to the Rest API Browser. To enable these options, see Accessing the Report Metadata.

    Mozilla Firefox RESTClient Add-On

    RESTClient is a Mozilla FireFox add-on that provides useful options for parsing and viewing API requests and responses.

    See https://addons.mozilla.org/en-US/firefox/addon/restclient/?src=ss, but check for more recent releases.

    Note

    If you are currently logged into Cisco UCS Director with user account credentials that your application will use, you

    should be able to use any supported web browser to send API requests and get responses. However, the Mozilla Firefox

    RESTClient add-on provides a standalone client that also parses and labels the API data in a useful and informative way.

    Cisco UCS Director REST API Browser

    The REST API Browser is available in the Orchestration area of Cisco UCS Director. It provides API information and API

    code generation capabilities that make it easy to see and work with all of the available APIs, including both the REST

    APIs and the Java API.

    After you enable the developer menu, you can access this feature and get extensive information about Cisco UCS

    Director exposed APIs, including the REST API in XML format and the Java API. For more information, see Using the

    REST API Browser.

    Poodle Vulnerability

    To avoid POODLE vulnerability, SSL Version 2 and SSL Version 3 are disabled on Cisco UCS Director north-bound HTTP

    interface by configuring Apache Tomcat to allow only TLS. Hence, any north-bound applications accessing Cisco UCS

    Director through REST API will be connected through TLS. Also, the browsers will be connected to Cisco UCS Director

    through TLS. For more information, refer http://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-

    sa-20141015-poodle.

    http://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20141015-poodlehttp://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20141015-poodle

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Getting Started

    11

    Getting Started This section includes the following topics:

    About the API Access Key

    Generating and API Access Key

    Enabling the Developer Menu Options

    Using the REST API Browser

    Request Format

    Response Format

    About the API Access Key

    To access Cisco UCS Director through the API interface, you must have a valid Cisco UCS Director user account and an

    API access key. The API access key is required for Cisco UCS Director to authenticate API requests. This access key is a

    unique security access key code that is associated with a specific valid Cisco UCS Director user account.

    To authenticate API requests, all Cisco UCS Director APIs require the API access key for authentication. You must pass

    the REST API access key as a name:value header following standard HTTP syntax and semantic rules. For example, a

    valid name:value header is X-Cloupia-Request-Key: F90ZZF12345678ZZ90Z12ZZ3456FZ789. For more information

    about the API request header, see Request Format and RFC2616 Header Field Definitions.

    To provide data security, send all requests over an HTTPs (SSL) connection.

    Generating an API Access Key

    To generate the API access key, perform the following steps:

    ______________________________________________________________________________________________

    Step 1: In Cisco UCS Director, click your login name in the upper right.

    For example, if you log in as admin, Cisco UCS Director displays admin in the upper right.

    Step 2 In the User Information dialog box, click the Advanced tab.

    Step 3 To copy the value displayed in the REST API Access Key area, click Copy Key Value.

    Step 4 Save the access key in a secure location, and use it in the API request header.

    For more information about the API request header, see Request Format.

    Step 5: If you want to change the API access key, click Regenerate Key.

    After you generate a new key, the old key code is retired and you cannot use it.

    ______________________________________________________________________________________________

    Enabling the Developer Menu Options

    Cisco UCS Director includes features and capabilities that are intended expressly for developers and engineers. After

    you enable the Developer Menu option, you have access to the integrated REST API Browser and Report Metadata

    information. These features provide you with site-specific API data and with REST API request code that you can send

    through any standard HTTP or HTTPS browser. The HTTP request code provided by the Report Metadata views yields

    immediate API service results. Plan to use these options in every situation where you need API information.

    Obtain one or more user accounts that provide exactly the same administrative access to data that your application users

    will have. Your Cisco UCS Director administrator can explain the data access limitations associated with different

    administrator and end-user roles. You may want multiple user accounts to test the user-experiences associated with

    different data access and security controls.

    The Cisco UCS Director REST API Browser provides API information and API code generation capabilities that make it

    easy to see and work with all of the available APIs, including both the REST APIs and the Java APIs.

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Getting Started

    12

    To enable end menu options, perform the following steps:

    _______________________________________________________________________________________________

    Step 1: In Cisco UCS Director, click your login name in the upper right.

    For example, if you log in as admin, Cisco UCS Director displays admin in the upper right.

    Step 2 In the User Information dialog box, click the Advanced tab.

    Step 3 Check the Enable Developer Menu (for this session) check box and close the User Information dialog box.

    The REST API Browser is activated for the duration of the current session, and the Report Metadata option

    becomes available in the report views opened in the session.

    Note

    The Advanced tab also displays the REST API Access Key code for the account.

    Step 4 Close the User Information dialog box.

    _______________________________________________________________________________________________

    Using the REST API Browser

    The Cisco UCS Director REST API Browser provides API information and API code generation capabilities that assist and

    educate developers in the use of all available exposed Cisco UCS Director APIs, including the XML-formatted REST API

    and the Java API. The primary view lists the Task folders, each of which provides access to the APIs. The task name

    effectively supplies the top-level context or category folder under which the APIs are listed. For example, all the APIs

    pertaining to NetApp ONTAP tasks and NetApp OnCommand tasks are available inside the folders with these names.

    Prerequisites

    1. Obtain one or more user accounts that provide exactly the same administrative access to data that your application users

    will have. Your Cisco UCS Director administrator can explain the data access limitations associated with different

    administrator and end-user roles. You may want multiple user accounts to test the user-experiences associated with

    different data access and security controls.

    2. Enable the developer menu option for the session.

    To use the REST API browser, perform the following steps:

    Step 1: On the menu bar, choose Policies > Orchestration.

    Step 2 Click the REST API Browser tab.

    Click the right scroll arrow, if necessary, to navigate to the REST API Browser tab.

    Step 3 Open the task folder that contains the APIs you want to view.

    Notes:

    1. You can use the Search field at the top right corner of the Rest API Browser tab to find a specific API if you

    do not know which task folder it belongs in. Enter a string that occurs in the API Resource, Operation or

    Description fields to narrow your search. You can also use the other options on that menu bar, such as the

    Add Advanced Filter, to help you find a specific API.

    2. All Cisco VACS REST APIs are available in the Service Container Tasks group.

    Step 4 Double-click a row that contains an API resource and operation that interests you.

    The REST API browser displays the following:

    API Examples tab Displays the API data for your selection and enables you to generate a sample URL.

    Depending on the operation and resource that you selected, this tab might also include data entry

    boxes that accept parameter values and enable you to construct a successful API request. If available in

    a data entry box, click Select to open data search filters that can help you sort out and select the data

    that you need to enter.

    Details tab Provides additional details about the API, including the API definition, input parameters, and

    output parameters.

    Sample Java Code tab Provides sample code for the API.

    _________________________________________________________________________________________________

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Getting Started

    13

    Accessing the Report Metadata

    Report Metadata enables you to view the API code used by Cisco UCS Director, including the API request code for every

    report displayed in Cisco UCS Director. This code includes complete URL code that is ready to paste into a browser and

    send. The immediate API responses provide a trove of information and education for the developer. To see the API

    request code, you simply navigate to a report, select Report Metadata, and scroll down through the resulting list to the

    API request used to fetch the report.

    Prerequisites Obtain one or more user accounts that provide exactly the same administrative access to data that your application

    users will have. Your Cisco UCS Director administrator can explain the data access limitations associated with

    different administrator and end-user roles. You may want multiple user accounts in order to test the user-

    experiences associated with different data access and security controls.

    Enable the Developer Menu options for the session.

    To access the report metadata, perform the following steps:

    _________________________________________________________________________________________________

    Step 1: In Cisco UCS Director, navigate to the page for which you want to see the API code.

    For example, choose one of the following:

    Policies > Orchestrations

    Physcial > Storage > Storage_Account >Filers

    Step 2: Check Report Metadata.

    Step 3: In the Information dialog box, review the sample code.

    _________________________________________________________________________________________________

    Request Format

    API clients can use HTTP or HTTPS to interact with Cisco UCS Director. To pass the REST API access key, each request

    must be associated with an http/https header called X-Cloupia-Request-Key with its value set to the current REST API

    Access Key. For information about getting and using this key, see Generating an API Access Key.

    URL Format

    http://SERVER/app/api/rest?formatType=json&opName=operationName&opData=operationData

    where SERVER is the IP address or the hostname of the Cisco UCS Director VM, and where opName is the API operation

    name associated with the request. For example: userAPIGetMyLoginProfile, or userAPIGetVMActionStatus, and where

    opData includes the JSON parameters (the arguments associated with the operation).

    Request URL Parameters

    formatType The only supported format that is discussed here is JavaScript Object Notation (JSON). Set this

    parameter value to json.

    opName The operation name associated with the request. A list of operations is provided in About the REST

    API Operations.

    opData Parameters (or arguments) associated with the operation. Cisco UCS Director uses JSON encoding of

    the parameters. If no arguments are required for the operation, use {} as an empty set. Before you send JSON

    data in a request, you must apply escape characters as appropriate. For details about encoding the URL, see the

    RFC at http://www.ietf.org/rfc/rfc1738.txt.

    For more information about JSON syntax and data types, see

    https://en.wikipedia.org/wiki/JSON#Data_types.2C_syntax_and_example.

    For information about non-JSON formatted API requests, see Using the REST API Browser.

    About Operations Data Parameters/Arguments

    http:///www.ietf.org/rfc/rfc1738.txthttps://en.wikipedia.org/wiki/JSON#Data_types.2C_syntax_and_example

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Getting Started

    14

    Because the method and a generic designation of the API resource are communicated through the opName, the

    operation parameters must present any arguments that are needed to designate a specific instance of the resource to be

    operated upon.

    For a list of available API operations and parameter specifications, see About the REST API Operations.

    Operations Data Parameter Syntax

    The following table shows examples of operations data parameter syntax in JSON format.

    If the operation needs the following parameters

    (opData)

    How to represent in JSON

    No parameters {}

    One parameter; integer (for example, 10) {param0:10}

    One parameter: string (for example, cloud) {param0:"cloud"}

    Two parameters: a string and an Integer {param0:"cloud",param1:10}

    Two parameters: a string with null value and an Integer {param0:null,param1:10}

    Three parameters {param0:"cloud",param1:"cloupia",param2:100}

    Operation Data Parameters ",param2:"STORAGE-ACCOUNTS-T51"

    Size","value":100},{"name":"Select Group","value":"14"},{"name":"Select vDC","value":18}]},param2:212}

    param0 Name of the workflow being invoked through the REST API.

    param1 Input being passed to the workflow. If there are more than one input, separate the inputs by comma and

    within the curly braces with proper quotations. If there are no inputs, use null for the API invocation.

    param2 If this workflow is being invoked as a child workflow of another service request, use the service request

    (SR) ID. If this workflow is not invoked as a child workflow, use -1. When -1 is used, a new service request will be

    invoked.

    Note: Cisco UCS Director provides many complete API requests, formatted as URLs and ready for you to cut and paste into a

    browser. See Enabling the Developer Menu Options.

    Context Parameters

    In the example above, Param0 is used to specify the Cisco UCS Director context. The context data value refers to one of the

    major domains managed by Cisco UCS Director, for example, "global-services", "vm", "vdc", "datacenter",

    "storage_accounts", "Compute-chassis", "network-device". A list of the standard Cisco UCS Director contexts appears in

    API Request Context Parameters.

    Report Parameters

    The report parameter value is always the reportId. Typical reportIds include "STORAGE-ACCOUNTS-T51", "CPU-S0",

    "VOLUMES--X1", "NETWORK-USAGE-H0", "PORT-SUMMARY-V50", "PRIVATE-CLOUD-FREE-STORAGE-S1". The

    reportId is typically the last parameter listed in an API request for a report. So, if the context is specified by two parameters,

    the report parameter is often the third, param2. For an extensive list of report names, and reportIds, categorized by context,

    see List of Available Cisco UCS Director Reports.

    Sample API Request 1 The operation that requests a Login profile refers to the logged in user, so there is no need for a parameter. Most other

    operations need multiple arguments.

    http://10.10.1.153/app/api/rest?formatType=json&opName=userAPIGetMyLoginProfile&opData={}

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Getting Started

    15

    { "serviceResult":{"userId":"jsmith","firstName":"John","lastName":"Smith","email":"[email protected]",

    "groupName":"Eng Group","role":"Regular"}, "serviceError":null,

    "serviceName":"InfraMgr", "opName":"userAPIGetMyLoginProfile" }

    Sample API Request 2

    In this request for a report about chassis for a data center, the operation requires three parameters, which is typical for a

    report request.

    http://172.99.999.142/app/api/rest?opName=userAPIGetTabularReport&opData={param0:"datacenter",

    param1:"datacenter",param2:"UCS-CHASSIS-T50"}

    { "serviceResult":

    {"rows":[{"ID":"PHY-ACC;sys/chassis-2",

    "Account_Name":"PHY-ACC","DN":"sys/chassis-2",

    "Serial_Number":"1558","Model":"N20-C6508","Power_State":"ok",

    "Operation_State":"accessibility-problem",

    "Configuration_State":"ok","License_State":"license-ok","Servers":5,

    "IO_Modules":2,"PSUs":4,"Fan_Modules":8,

    "Vendor":"Cisco Systems Inc"},{"ID":"UCSCirrus;sys/chassis-1",

    "Account_Name":"UCSCirrus","DN":"sys/chassis-1",

    "Serial_Number":"FOX1352GDX4","Model":"N20-C6508",

    "Power_State":"redundancy-failed","Operation_State":"power-problem",

    "Configuration_State":"ok","License_State":"license-ok","Servers":7,

    "IO_Modules":2,"PSUs":4,"Fan_Modules":8,

    "Vendor":"Cisco Systems Inc"},{"ID":"UCSM237;sys/chassis-1",

    "Account_Name":"UCSM237","DN":"sys/chassis-1",

    "Serial_Number":"1557","Model":"N20-C6508","Power_State":"ok",

    "Operation_State":"operable",

    "Configuration_State":"unsupported-connectivity","License_State":"license-ok",

    "Servers":6,"IO_Modules":2,

    "PSUs":4,"Fan_Modules":8,"Vendor":"Cisco Systems Inc"},

    {"ID":"real108;sys/chassis-1","Account_Name":"real108",

    "DN":"sys/chassis-1","Serial_Number":"FOX1352GDX4","Model":"N20-C6508",

    "Power_State":"redundancy-failed",

    "Operation_State":"power-problem","Configuration_State":"ok",

    "License_State":"license-ok","Servers":7,

    "IO_Modules":2,"PSUs":4,"Fan_Modules":8,"Vendor":"Cisco Systems Inc"}],

    "columnMetaData":null}, "serviceError":null, "serviceName":"InfraMgr",

    "opName":"userAPIGetTabularReport" }}

    Note: For advanced Cisco UCS Director API users, the code in the Report Metadata request for the data center's UCS-

    CHASSIS-T50 report gave the first parameter as param0:"23". In the request used in Sample API Request 2, the context

    "datacenter" was substituted for the value "23" and the request was successful. By comparing the API documentation

    against the Report Metadata and Cisco UCS Director, you can sometimes discover alpha string value substitutes for the

    numeral string values (representing contexts) that appear in the Report Metadata requests.

    Response Format

    The following HTTP status codes are returned by Cisco UCS Director:

    401 Unauthorized The API key is not a valid key.

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Getting Started

    16

    200 OK Cisco UCS Director has processed the request. The actual status of the request is in the body of the

    response.

    The Cisco UCS Director response body is in JSON format as determined by the FormatType parameter specified in the API

    request.

    Components of an API Response

    API Response Component Description Component Example (Success Scenario)

    serviceResult If the request succeeds, this result

    contains a specified set of name-

    value pairs or a JSON object or a

    report.

    "serviceResult":

    {"userId":"jsmith",

    "firstName":"John","lastName":"Smith",

    "email":"[email protected]",

    groupName":"Eng Group","role":"Regular"}

    serviceError If the request succeeds, the

    serviceError is set to null. If the

    operation fails, the serviceError

    contains the actual error message.

    "serviceError":null

    serviceName Name of the back end service. Often

    set to InfraMgr, for example.

    "serviceName":"InfraMgr"

    opName Name of the operation provided in

    the request.

    "opName":"userAPIGetMyLoginProfile"

    Example: API Response in a Success Scenario

    { "serviceResult":{"userId":"jsmith","firstName":"John","lastName":"Smith",

    "email":"jsmith@example.

    com","groupName":"Eng Group","role":"Regular"}, "serviceError":null, "serviceName":"InfraMgr",

    "opName":"userAPIGetMyLoginProfile"

    }

    Example: API Response in a Failure Scenario

    { "serviceResponse":null, "serviceError":"SERVICE_CALL_EXCEPTION: Service InfraMgr does not support operation test",

    "serviceName":"InfraMgr", "opName":"test"

    }

    API Response (Service Result) Data Types

    The service result (payload) sent in a response to a Cisco VACS REST API request is specified for the operation. The service

    result can be an operation-specific set of name-value pairs, or it can be formatted as a standard data type for this API, that

    is, as a report or a JSON object.

    To see examples of the different report types, see Reports and JSON Object Response Samples.

    For information about the most commonly used Cisco UCS Director report formats and their contents, see About Reports.

    For a list of available reports and the contexts with which they are associated, see List of Available Cisco UCS Director

    Reports.

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    REST Tools

    17

    For samples of JSON Objects, see JSON Object Parameter Types.

    REST Tools By default, Cisco VACS is enabled to respond to the REST API requests from the appropriate REST clients. Cisco VACS

    provides the following entities to aid in the REST API developments:

    REST API Browser

    REST API SDK Bundle

    REST API Browser

    The REST API browser available with Cisco UCS Director aids the Developers and QA Engineers to validate the REST

    APIs added to the framework.

    An administrator or group administration user can launch the REST API Browser. To launch the REST API Browser,

    choose Policies > Orchestration > REST API Browser.

    The REST API browser groups the APIs based on the tasks needed to manage the respective infrastructure components

    of the datacenter.

    To view an API, expand a task folder and double-click the report for the respective API. The browser provides the

    following tabs for the selected API:

    1) API Examples Displays the inputs for user-selection. A Developer can provide his inputs for the respective API as

    required and generate a sample URL.

    2) Details Defines the syntax and the semantics for the API.

    3) Sample Java Code A Java code snippet that demonstrates the use of the API.

    Usage Example: Retrieving the VM Summary

    1. From the Cisco UCS Director menu bar, choose Policies > Orchestration > REST API Browser.

    2. Select and double-click the userAPIGetVMSummary API. The following tabs are displayed:

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    REST Tools

    18

    a. API Examples

    b. Details

    c. Sample Java Code

    3. Click the Details tab, to view the definition of the userAPIGetVMSummary API. The userAPIGetVMSummary API

    takes the vmId as its input.

    4. In the API Examples tab, click Generate URL to get the URL for the REST operation. The vmId must be passed as

    the param0, as shown in the following dialog box.

    5. From the UCSD Server drop-down list, choose Cisco UCS Director on which the API is targeted at and click

    Execute REST API for a response.

    Usage Example: Creating a Group

    1. From the Cisco UCS Director menu bar, choose Policies > Orchestration > REST API Browser.

    2. Select and double-click the userAPIGetVMSummary API. The following tabs are displayed:

    a. API Examples

    b. Details

    c. Sample Java Code

    3. Click the Details tab, to view the definition of the userAPIGetVMSummary API. The userAPIGetVMSummary API

    takes the vmId as its input.

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    REST Tools

    19

    4. In the API Examples tab, click Generate URL to get the URL for the REST operation. The vmId must be passed as

    the param0, as shown in the following dialog box.

    5. From the UCSD Server drop-down list, choose Cisco UCS Director on which the API is targeted at and click

    Execute REST API for a response.

    Upon clicking Execute REST API, the following screen appears.

    6. Fill in the fields and click Generate XML to generate the sample XML file for group creation.

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    REST Tools

    20

    7. From the UCSD Server drop-down list, choose Cisco UCS Director on which the API is targeted at and click

    Execute REST API for a response.

    Usage Example: Sample Java Code

    1. From the Cisco UCS Director menu bar, choose Policies > Orchestration > REST API Browser.

    2. Select and double-click the userAPIGetVMSummary API. The following tabs are displayed:

    a. API Examples

    b. Details

    c. Sample Java Code

    The Sample Java Code tab provides the code snippet that can be used to automate the management services through

    code.

    The code snippet can be used to execute the respective API. To execute the code in the Eclipse and obtain the output,

    you must import the SDK bundle as a Java Project into the Eclipse IDE.

    To import the SDK bundle, perform the following steps:

    ______________________________________________________________________________________________

    1. In the Eclipse IDE, choose File > New > Java Project. The Create a Java Project dialog box appears.

    2. In the Project Name field, enter a name for the project.

    3. Right click the project, and select Import.

    4. In the Import dialog box, select Existing projects into Workspace, and then click Next.

    5. Click Browse and navigate to the folder where you extracted the SDK Bundle.

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    REST Tools

    21

    6. Click Finish.

    The Eclipse IDE displays the SDK Bundle project on the Project Explorer tab.

    _________________________________________________________________________________________________

    REST API SDK Bundle

    For more information on the REST API SDK bundle, see the Cisco UCS Director REST

    API Developer Guide.

    http://www.cisco.com/c/en/us/support/servers-unified-computing/ucs-director/products-programming-reference-guides-list.htmlhttp://www.cisco.com/c/en/us/support/servers-unified-computing/ucs-director/products-programming-reference-guides-list.html

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    About the REST API Operations

    22

    About the REST API Operations The catalog of Cisco VACS REST API operations provided in this section can help you determine which operations serve

    your needs, and how to work with each operation. You can find examples of the request and response values for an API

    operation through the Report Metadata and REST API Browser.

    Note:

    The operations performed using the GET and PUT method are used primarily for services and provisioning.

    The opData of the API request URL, includes the following JSON parameters (the arguments associated with the

    operation):

    o param0 Name of the workflow being invoked through the REST API.

    o param1 Input being passed to the workflow. If there are more than one input, separate the inputs by

    comma and within the curly braces with proper quotations. If there are no inputs, use null for the API

    invocation.

    o param2 If this workflow is being invoked as a child workflow of another service request, use the

    service request (SR) ID. If this workflow is not invoked as a child workflow, use -1. When -1 is used, a

    new service request will be invoked.

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    23

    Cisco UCS Director API Operations

    Login Operation

    userAPIGetUserLoginProfile

    Description

    Returns user information for the given user ID.

    Parameters

    String userId

    Return Value Type

    APILoginReport

    Accessible

    Administrator/end user

    Note: See also User Account Operations, which include operations for adding users, onboarding, managing passwords,

    and profiles.

    Values Fetch Operations

    userAPIGetLOVValue

    Description

    Returns a list of possible values for a given workflow input type of embedded list of variables (LOV) (embedded-lov).

    When the API is accessed using an end user Rest API key, the data is filtered based on the end user ID.

    Parameters

    String type Use the userAPIGetWorkflowInputs API to get the input type.

    Return Value Type

    FormLOVPair

    Accessible

    Administrator/end user

    userAPIGetTabularValue

    Description

    Returns the possible values for a given workflow input type of table or popup-table in a tabular format. When the API

    is accessed using an end user Rest API key, the data is filtered based on the end user ID.

    Parameters

    String type Use the userAPIGetWorkflowInputs API to get the input type.

    Return Value Type

    APITabularReport

    Accessible

    Administrator/end user

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    24

    User Account Operations

    userAPIAddUser

    Description

    Adds a user with the provided information (for example, user ID, password, email).

    Parameters

    String userId A unique ID of the user.

    String password The password of the user.

    String firstName The first name of the user.

    String lastName The last name of the user.

    String email The email address of the user.

    String role The role of the user. The user roles include: GroupAdmin, BillingAdmin, Operator, MSPAdmin,

    AdminIS, AdminStorage, AdminComputing, AdminNetwork, AdminAllPolicy, Admin for Admin / System Admin,

    and Regular for Regular / Service End-User.

    String groupName The name of the group to which the user belongs to.

    Note: The groupName values must be specified for the following roles: GroupAdmin, MSPAdmin, and Regular for

    Regular / Service End-User. The groupName value must be specified as null for the following roles: BillingAdmin,

    Operator, Admin for Admin / System Admin, AdminIS, Admincomputing, AdminNetwork, AdminStorage, and

    AdminAllPolicy.

    Return Value Type

    boolean (true when successful)

    Accessible

    Administrator

    userAPIOnBoarding

    Description

    Creates user, group and VDC with the details provided in the APIUserOnBoardDetails argument.

    Parameters

    APIUserOnBoardParams inParams

    For an example of this JSON object, see JSON Object Parameter Types.

    Return Value Type

    APIUserOnBoardDetails

    For an example of this JSON object, see JSON Object Parameter Types.

    Accessible

    Administrator/end user

    userAPIUpdateUser

    Description

    Updates the details of a user. The user ID cannot be edited.

    Parameters

    apiUser APIUSer

    The APIUSer includes the following parameters:

    String loginName The login name of the user.

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    25

    String firstName The first name of the user.

    String lastName The last name of the user.

    String email The email address of the user.

    String role The role of the user. The user roles include: GroupAdmin, BillingAdmin, Operator, MSPAdmin,

    AdminIS, AdminStorage, AdminComputing, AdminNetwork, AdminAllPolicy, Admin for Admin / System Admin,

    and Regular for Regular / Service End-User.

    String groupName The name of the group to which the user belongs to.

    String address The postal address of the user.

    Sample /app/api/rest?formatType=json&opName=userAPIUpdateUser&opData={param0:{"loginName":"TestSDK",

    "firstName":"","lastName":"","email":"[email protected]","role":"GroupAdmin","groupName":"Group1",

    "address":"sample"}}

    Return Value Type

    boolean (true when successful)

    Accessible

    Administrator

    userAPIDeleteUser

    Description

    Deletes the user with the given user ID.

    Parameters

    String userId

    Return Value Type

    boolean (true when successful)

    Accessible

    Administrator

    userAPIResetMyPassword

    Description

    Resets the password of the user account to the new password that is provided in the request.

    Parameters

    String newPassword

    Return Value Type

    boolean (true when successful)

    Accessible

    Administrator/end user

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    26

    userAPIResetUserPassword

    Description

    Resets the password of a user with the user ID and new password provided.

    Parameters

    String user ID

    String newPassword

    boolean resetAPIKey

    Note:

    If the resetAPIKey is set to true, Cisco UCS Director resets the REST API Key in addition to resetting the password. If set

    to false, only the password will be reset, and the REST API key remains unchanged for the given user. The user does not

    have to do anything if the resetAPIKey is set to true. You must decide whether to reset the REST API key when the

    password is reset.

    Return Value Type

    boolean (true when successful)

    Accessible

    Administrator

    userAPIVerifyUser

    Description

    Authenticates the user with the given password.

    Parameters

    String userId

    String passWord

    Return Value Type

    APILoginProfile

    For an example of this JSON object, see JSON Object Parameter Types.

    Accessible

    Administrator/end user

    Note:

    See also Login Operations.

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    27

    userAPIGetRESTAccessKey

    Description

    Returns an API access key for the given user name.

    Parameters

    String username Name of the user for whom the API access key need to be retrieved.

    Return Value Type

    String

    Accessible

    Administrator/end user

    userAPIIsMspMode

    Description

    Returns true if the currently logged in user is in the Management Software Provider (MSP) mode.

    Parameters

    None

    Return Value Type

    Boolean

    Accessible

    Administrator/end user

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    28

    Group Operations

    userAPICreateGroup

    Description

    Creates a group in Cisco UCS Director. The group type is set as 0 for administrator or end user, and as 1 for

    Managed Service Provider (MSP) organization user. If the parent group ID is greater than 0, the created group name

    is mapped to parent group ID.

    Note:

    If a group belongs to a parent group or an organization, the parentId and parentGroupName parameters are

    mandatory. If the group type is set as 0, the group name and email address are mandatory.

    Parameters

    apiGroup APIGroup

    The APIGroup includes the following parameters:

    int groupId

    String groupName

    String description

    int parentGroupId

    String emailAddress

    String lastName

    String firstName

    String phoneNumber

    String address

    int groupType

    Return Value Type

    Int groupId

    Accessible

    Administrator

    userAPIAddGroup

    Description

    Adds a group with the specified data (group name, description, names, email).

    Parameters

    String groupName

    String description

    String firstName

    String lastName

    String contactEmail

    Return Value Type

    boolean (true when successful)

    Accessible

    Administrator

    Note:

    Many operations are associated with a group value, such as userAPIGetCatalogsPerGroup. For more information, see the

    main operation category.

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    29

    userAPIGetGroups

    Description

    Returns all groups in Cisco UCS Director as a list.

    Parameters

    None

    Return Value Type

    List APIGroup

    Accessible

    Administrator/end user

    userAPIGetGroupById

    Description

    Returns the group details for the given group ID.

    Parameters

    int groupId ID of the group.

    Return Value Type

    List APIGroup

    Accessible

    Administrator/end user

    userAPIGetGroupByName

    Description

    Returns the group details for the given group name.

    Parameters

    String groupName Name of the group.

    Return Value Type

    List APIGroup

    Accessible

    Administrator/end user

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    30

    userAPIUpdateGroup

    Description

    Updates the details of a group with the given details. The group ID and group name cannot be edited.

    Parameters

    apiGroup APIGroup

    Return Value Type

    Boolean

    Accessible

    Administrator

    userAPIDeleteGroup

    Description

    Deletes a group from Cisco UCS Director based on the given group ID.

    Parameters

    int groupId

    Return Value Type

    Boolean

    Accessible

    Administrator

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    31

    Account Operations

    userAPICreateInfraAccount

    Description

    Creates an infra account.

    Note:

    When creating an account using the XML-based API, refer to the possible values of the account category and account

    type parameters to pass valid values.

    Parameters

    InfraAccountDetails infraAccountDetails

    The InfraAccountDetails includes the following parameters:

    o String accountName a unique name that you assign to this account.

    o String podName the pod to which this account belongs.

    o int accountCategory the category of the account. The possible values of the account category are:

    Integer Account Category

    1 Compute

    2 Storage

    3 Network

    4 Multi-Domain Manager or Others

    5 Cloud

    o String accountType The type of the account. You need to pass the value within quotes as "11".

    The possible values of the account type are:

    Integer Account Type

    2 VMware

    6 HYPERV

    9 REDHAT_KVM

    10 XENDESKTOP

    11 UCSM

    12 NETAPP

    14 NETAPP_DFM

    15 HP

    16 CISCO_CIMC

    17 EMC_VNX

    18 IPMI

    19 LOAD_BALANCERS

    20 EMC_VMAX

    24 EMC_VPLEX

    22 WHIPTAIL

    23 EMC_ISILON

    25 EMC_NEW_VNX

    26 EMC_NEW_VNX_BLOCK

    27 EMC_NEW_VNC_UIFIED

    28 HP_QA

    29 CAT_LDAP

    30 CAT_LDAP_CLEANUP

    31 VCE_VISION_IO

    32 EMC_RECOVERPOINT

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    32

    33 UCS_INVICTA_APPLIANCE

    34 UCS_INVICTA_SCALING

    35 EMC_NEW_VNX_BLOCK_HTTP

    36 EMC_VNXE

    o String deviceCategory The category of the device, including Compute, Storage, and Network.

    o String description A description of this account.

    o String contact The email address that you can use to contact the administrator or other person responsible

    for this account.

    o String destinationIPAddress The destination IP address of this account. You need to pass the IP address

    within quotes.

    o String login The login ID that this account will use to access element manager. For instance, the Cisco UCS

    Manager account will use this login ID to access Cisco UCS Manager. This username must be a valid

    account in Cisco UCS Manager.

    o String password The password associated with the login ID.

    o String enablepassword Pass the value as true to enable password for this account.

    o String protocol The protocol to use to communicate with the account. The possible values are Telnet and

    SSH.

    o int port The port that is used to access the element manager.

    o infraAccountSupportDetailsInfo Details of the infra account. The infraAccountSupportDetailsInfo includes

    the following parameters:

    String spAIpAddress The IP address for Storage Processor A of the VNX device.

    String spBIpAddress The IP address for Storage Processor B of the VNX device.

    String blockAccessUserName The username for block access of the VNX device.

    String blockAccessPwd The password for block access of the VNX device.

    String sshIpAddress The IP address of the SSH server. You need to pass the IP address within

    quotes.

    String sshUsername The username that this account will use to access the SSH server.

    String sshPassword The password associated with the SSH username.

    int sshPort The port used to access the SSH server.

    String domain The domain that is associated with the account.

    String serviceProvider The name of the service provider associated with this account, if any.

    Return Value Type

    boolean (true when successful)

    Accessible

    Administrator

    userAPIUpdateInfraAccount

    Description

    Updates an infra account.

    Parameters

    InfraAccountDetails infraAccountDetails

    Return Value Type

    boolean (true when successful)

    Accessible

    Administrator/End user

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    33

    userAPIGetAllAccounts

    Description

    Returns the name of all accounts.

    Parameters

    None

    Return Value Type

    List as String type

    Accessible

    Administrator/End user

    userAPIGetAllPhysicalInfraAccounts

    Description

    Returns all physical infra account types.

    Parameters

    None

    Return Value Type

    List PhysicalInfraAccount

    Accessible

    Administrator/End user

    userAPIGetAccountTypeEntryByName

    Description

    Returns the account type entry for the given account name.

    Parameters

    String Account name

    Return Value Type

    List AccountTypeEntry

    Accessible

    Administrator/End user

    userAPIGetAccountTypeByName

    Description

    Displays the account type based on the account name.

    Parameters

    String Account name

    Return Value Type

    List as String

    Accessible

    Administrator/End user

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    34

    userAPIDeleteInfraAccount

    Description

    Deletes an infra Account.

    Parameters

    String Account name

    Return Value Type

    Boolean (true when successful)

    Accessible

    Administrator/End user

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    35

    Report Operations

    userAPIGetAvailableReports

    Description

    Returns the available reports for a given context.

    Parameters

    String contextName

    String contextValue

    Return Value Type

    List APIReportDefinition

    Accessible

    Administrator/end user

    userAPIGetTabularReports

    Description

    Returns a tabular report for a given context and report ID.

    Parameters

    String contextName

    String contextValue

    String reportId

    Return Value Type

    APITabularReport

    Accessible

    Administrator/end user

    userAPIFilterTabularReport

    Description

    Filters the tabular report based on the given column label and column value. All the rows in the report can be

    retrieved by passing empty value (" ") in the column label and column value parameters.

    Parameters

    String contextName

    String contextValue

    String reportId

    String columnLabel

    String cloumnValue

    Note:

    The columnLabel parameter must be retrieved from the result of the userAPIGetTabularReport API. For filtering

    tabular reports of VMs based on VM ID, use VM-ID as columnLabel.

    Return Value Type

    APITabularReport

    Accessible

    Administrator/end user

  • Cisco Virtual Application Cloud Segmentation Services REST API Guide, Release 5.4STV3.0

    Cisco UCS Director API Operations

    36

    use