to access the REST API and then passing the
formatType, opName, and opData as parameters.
The HTTP header for authentication is named X-
Cloupia-Request-Key and contains the value of the
access key for the admin user for the Cisco UCS Director
instance that runs on the server with IP address
10.10.10.66. The response from this instance of Cisco
UCS Director looks as shown in Example 9-13.
The operation name is contained in the response and is
indeed userAPIGetMyLoginProfile, serviceName
specifies the name of the back-end service (which is in
most cases InfraMgr), serviceResult contains a set of
name/value pairs or a JSON object if the request was
successful, and serviceError contains the error
message. If the request succeeds, the serviceError
value is set to null, and if the operation fails,
serviceError contains the error message.
Example 9-13 REST API Response Containing User
Profile Information
Click here to view code image
{
"opName" : "userAPIGetMyLoginProfile",
"serviceName" : "InfraMgr",
"serviceResult" : {
"email" : null,
"groupName" : null,
"role" : "Admin",
"userId" : "admin",
"groupId" : 0,
"firstName" : null,
"lastName" : null
},
"serviceError" : null}
As mentioned previously, Cisco UCS Director tasks and
workflows can have any number of input and output
variables. In order to retrieve the inputs for a specific
workflow, the userAPIGetWorkflowInputs