VMware Cloud Community
FTVDaniel
Contributor
Contributor
Jump to solution

how to learn vro javascript commands

Hello

I used to work with powercli and I am now learning orchestrator which is much more powerfull but i have an issue. I do not know Javascript and I do not know the vcenter API and javascripts commandletts for javascript

this bring two questions

1 is it possible to have with javascript for vcenter the same command prompt we have with powercli which help to undersdand the vcenter commands (get-member)

2 is there a vcenter document identical to the powercli commandlets references ?

thanks for your help

1 Solution

Accepted Solutions
qc4vmware
Virtuoso
Virtuoso
Jump to solution

I really like this fling (I keep hoping it will become a standard vRO feature).  This gives you a REPL style command prompt to work with where you can explore the scriptable objects in a similar way to being at a PS prompt. vCO-CLI – VMware Labs .  I'm not sure it it works with the latest vRO as 5.5.x was the last time I tried it but I suspect it will.

This is also another good resource I recently found was Platypus... take a look at this blog post API Documentation for VMware Products with Platypus .

Another great way to explore the vSphere api is the Managed Object Browser.  Just be careful here if you run any of the methods they will really execute but if you just want to walk the tree and explore how the objects relate this is awesome.  It is available on any vCenter host by going to https://hostname/mob .  You'll be prompted for your credentials then you'll want to start with the link that says content.  You'll be at the root and see all of the services and the starting point for walking the inventory tree which are the datacenters.

Also, definitely take a look at things like the VMware vRealize Orchestrator Cookbook [Book] which is part of Safari if you have a subscription or you can purchase from many sources and this coding guide http://pubs.vmware.com/orchestrator-70/topic/com.vmware.ICbase/PDF/vrealize_orchestrator_coding_desi... .

View solution in original post

0 Kudos
4 Replies
tschoergez
Leadership
Leadership
Jump to solution

there is no (useful in vRO context) thing like get-member for javascript objects.

The Javascript objects that are being provided by the vCenter plugin 1:1 reflect the objects and types of the vCenter API, so you can use the regular vSphere API reference to figure out their properties and actions.

Find the official reference here:

vSphere 6.0 Documentation Center

This documentation is also exposed within  vRO in the API Explorer (accessible via the menu in vRO Client, or online: vCenter Server 5.0 Plug-In API Reference for vCenter Orchestrator,‌ just for 5.0 only unfortunately, but most things are still valid for 6)

If you are on Mac, also check out this timesaving tool to get the reference available offline:

Dash for OS X - API Documentation Browser, Snippet Manager - Kapeli

Joerg

qc4vmware
Virtuoso
Virtuoso
Jump to solution

I really like this fling (I keep hoping it will become a standard vRO feature).  This gives you a REPL style command prompt to work with where you can explore the scriptable objects in a similar way to being at a PS prompt. vCO-CLI – VMware Labs .  I'm not sure it it works with the latest vRO as 5.5.x was the last time I tried it but I suspect it will.

This is also another good resource I recently found was Platypus... take a look at this blog post API Documentation for VMware Products with Platypus .

Another great way to explore the vSphere api is the Managed Object Browser.  Just be careful here if you run any of the methods they will really execute but if you just want to walk the tree and explore how the objects relate this is awesome.  It is available on any vCenter host by going to https://hostname/mob .  You'll be prompted for your credentials then you'll want to start with the link that says content.  You'll be at the root and see all of the services and the starting point for walking the inventory tree which are the datacenters.

Also, definitely take a look at things like the VMware vRealize Orchestrator Cookbook [Book] which is part of Safari if you have a subscription or you can purchase from many sources and this coding guide http://pubs.vmware.com/orchestrator-70/topic/com.vmware.ICbase/PDF/vrealize_orchestrator_coding_desi... .

0 Kudos
qc4vmware
Virtuoso
Virtuoso
Jump to solution

How did I not know of DashDoc... pretty sweet!

0 Kudos
FTVDaniel
Contributor
Contributor
Jump to solution

thanks for your answers I will test all those links wich looks pretty good help

an other tool i found is Onyx which is able to catch all actions done in the vsphere client and translate thoses actions in javascript

https://labs.vmware.com/flings/onyx

https://labs.vmware.com/flings/onyx

0 Kudos