VMware Cloud Community
vBlockJFK
Enthusiast
Enthusiast
Jump to solution

Documentation for the Plugin Actions

I'd like to use some of the actions that come with the UCS Plugin library, but I don't understand the functions, input parameters, or output parameters. Can you point me to where these might be documented?

0 Kudos
1 Solution

Accepted Solutions
igorstoyanov
VMware Employee
VMware Employee
Jump to solution

A bit late but it could be helpful for somebody else looking for the same..

So, this should be valid for every plugin:

1.
var arrayOfObjectsFromThatType = Server.findAllForType("NameSpace:Type"); 
// returns array of all of objects from this type.

2.
var specificObject = Server.findForType("NameSpace:Type", id);
//Return an object by id and type

3. All UCS Objects has the following properties:
id
name
dn
multiUcsmDn

The  most important of all of those properites is multiUcsmDn . This is the  unique id that has the hierarchy encoded. So, for this plugin the id =  multiUcsmDn. Examples.

"System" will have multiUcsmDn = "http://10.23.34.34/" - not sure for the exact system but you can figure it out.
"Chassis" will have multiUcsmDn = "http://10.23.34.34/sys/chassis-1"
"Blade" will have multiUcsmDn =  ""http://10.23.34.34/sys/chassis-1/blade34"

So having all of this in mind, you can do the following

1.    


var systems = Server.findAllForType("UCSM:System"); 
// returns array of all of the registered UCS systems

2.   

Not straightforward here but you can filter the chassis based on a selected UCS system.

var allChassis = Server.findAllForType("UCSM:Chassis");

you can filter the chassis by multiUcsmDn. Something like
if (chassis.getMultiUcsmDn().indexOf(system.getMultiUcsmDn()) != -1)
//then add this chassis to the list so that you can filter only the chassis that are related to the UCS systems you chose.

3.

The next step is easy since chassis has method getBlades(). The two properties that might be helpful here "status" and "assignedToDn". It will identify if the state of the blade has been provissioned and so on.

4.   

In case, you are looking for blades that are not provission in the previous steps, there is a workflow to assing service profile to a blade - "Assign a service profile to a blade"

Hope, it is helpful.

Thanks,

Igor.

Visit http://blogs.vmware.com/orchestrator for the latest in Cloud Orchestration.

View solution in original post

0 Kudos
8 Replies
igorstoyanov
VMware Employee
VMware Employee
Jump to solution

Most of the actions in the Cisco UCS Manager plug-in are similar to the workflow. There are additional ones as well. You can find action and parameter descriptions in Tools/API Explorer  under com.vmware.library.ucsm. Please, take a look at the screenshot attached.

API_explorer.png

Thanks,

Igor.

Visit http://blogs.vmware.com/orchestrator for the latest in Cloud Orchestration.
vBlockJFK
Enthusiast
Enthusiast
Jump to solution

Thanks for the above answer, but I still need more information. What is a "resultClass" string supposed to contain? Where do I find the possible string values for "type"? Is there any documentation available besides the Users Guide?

0 Kudos
igorstoyanov
VMware Employee
VMware Employee
Jump to solution

I am afraid that the API explorer and the user guide are the only place documenting the Cisco UCS Manager plug-in API. As I said before, the actions should be one to one with the corresponding  workflows so if something is not documented fully (like type) you can take a look at the related workflow and find out the related type. Also, the Cisco UCS API documentation could be helpful to understand some of the concepts since the UCS plug-in expose that API.

Further, we can try to provide additional information if you have concrete question about some of the actions.

Thanks,

Igor.

Visit http://blogs.vmware.com/orchestrator for the latest in Cloud Orchestration.
0 Kudos
Burke-
VMware Employee
VMware Employee
Jump to solution

A list of possible "type" values can be found by browsing the API Explorer. When expanding any plugin, the first set of items listed are the Types that the plug-in has made available.

For example, here is a screenshot of the vCloud Director plugin from the API Explorer:

Screen shot 2011-05-27 at 4.01.49 PM.png

The format of the Types is: Plugin:TypeName

For instance: vCloud:AdminCatalog.

The "Types" are always the grey icons as shown in the above screenshot. Also, selecting a Type will give details in the bottom, including the Scripting Object if applicable.

Hope this info helps Smiley Happy

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you!

Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator
for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
vBlockJFK
Enthusiast
Enthusiast
Jump to solution

I am specifically interested in finding blades and Service Profiles from inside the hierarchy. I want to create an array of Service Profiles, for instance, to get information about them one by one. I don’t want the user or myself to have to select them by hand.

They “type” and “resultClass” parameters are typed as “string”, which give me little information as to how to format them. I am currently looking at the “loadElementsByType” method, which doesn’t say what it does, and doesn’t seem to exist in the UCSM docs.

Did Cisco help write this plugin? Did they provide any docs on how the underlying elements were supposed to work?

Thanks,

John Kennedy

http://vmjfk.blogspot.com

0 Kudos
Jinnie
VMware Employee
VMware Employee
Jump to solution

Hi John,

This method is not really public, so you will hardly find documentation.

But with vCO client you can take a look at what is inside, or query where is it used (right-click / Find elements that use this element).

So, the actual code, executed by this method is:

var result = UcsmObjectManager.loadTypeElements(type, resultClass, "getName");


The resulClass parameter is the class name of the result object from your search, and the type is the name of the object you query, the last one is the name of a property getter method.

The list of properties for each type, that you can query, you can get from the API Explorer in the vCO client.

For example, ServiceProfile type has:
description
displayName
dn
id
multiUcsmDn
name
.....

For example, for the 2 cases you mentioned, you need make calls like this:

loadElementsByType("Blade", "java.lang.String");
and
loadElementsByType("ServiceProfile",  "java.lang.String");

As a result you will recieve array with the names of these objects. If this is not what you wanted, for example, you need a dn list, or a list of some other property, you should use the already mentioned inner code, by creating your own Action or scripting element inside a workflow.

Like this:

var result = UcsmObjectManager.loadTypeElements("ServiceProfile", "java.lang.String", "getDn");

Hope that helps,

Ivan

vBlockJFK
Enthusiast
Enthusiast
Jump to solution

That is somewhat helpful. What I really need is a way to enumerate the Blades and Service profiles at runtime. Perhaps I'm choosing the wrong actions/workflows. What workflows are there for that?

0 Kudos
igorstoyanov
VMware Employee
VMware Employee
Jump to solution

A bit late but it could be helpful for somebody else looking for the same..

So, this should be valid for every plugin:

1.
var arrayOfObjectsFromThatType = Server.findAllForType("NameSpace:Type"); 
// returns array of all of objects from this type.

2.
var specificObject = Server.findForType("NameSpace:Type", id);
//Return an object by id and type

3. All UCS Objects has the following properties:
id
name
dn
multiUcsmDn

The  most important of all of those properites is multiUcsmDn . This is the  unique id that has the hierarchy encoded. So, for this plugin the id =  multiUcsmDn. Examples.

"System" will have multiUcsmDn = "http://10.23.34.34/" - not sure for the exact system but you can figure it out.
"Chassis" will have multiUcsmDn = "http://10.23.34.34/sys/chassis-1"
"Blade" will have multiUcsmDn =  ""http://10.23.34.34/sys/chassis-1/blade34"

So having all of this in mind, you can do the following

1.    


var systems = Server.findAllForType("UCSM:System"); 
// returns array of all of the registered UCS systems

2.   

Not straightforward here but you can filter the chassis based on a selected UCS system.

var allChassis = Server.findAllForType("UCSM:Chassis");

you can filter the chassis by multiUcsmDn. Something like
if (chassis.getMultiUcsmDn().indexOf(system.getMultiUcsmDn()) != -1)
//then add this chassis to the list so that you can filter only the chassis that are related to the UCS systems you chose.

3.

The next step is easy since chassis has method getBlades(). The two properties that might be helpful here "status" and "assignedToDn". It will identify if the state of the blade has been provissioned and so on.

4.   

In case, you are looking for blades that are not provission in the previous steps, there is a workflow to assing service profile to a blade - "Assign a service profile to a blade"

Hope, it is helpful.

Thanks,

Igor.

Visit http://blogs.vmware.com/orchestrator for the latest in Cloud Orchestration.
0 Kudos