VMware {code} Community
Algosec123
Contributor
Contributor

vCenter REST API Question

Hello all,

I need to fetch some data from vCenter.

According to documentations it seems that I can get it via Orchestrator.

I prefer not to use Java SDK, but to run requests directly (something like Advance REST Client on chrome, etc.)

The data I need to collect is:

  • list of all VMs managed on the vCenter (and protected by the NSX distributed firewall)
  • The Exclusion List (- of VM)
  • The data (- content, ips, etc) about objects of source, destination or service of each firewall rule:

          Datacenter

          Cluster

          Distributed Virtual Port Group

          Network

          Virtual App

          Resource Pool

          Virtual Machine

          vNIc

          Logical Switch

          Security Group

          IP Sets

As I understand, Orchestrator is not a free tool, so I can't be sure that this is the right way.

My question is:

Is Orchestrator can supply me these required data?

If so, how?

I'm really new in this area and need guidance.

Regards

Reply
0 Kudos
5 Replies
dvatov
VMware Employee
VMware Employee

Hi,

Orchestrator is free but you need vCenter license. You can do this with Orchestrator or powercli (powershell extensions from vmware). Another option is to use http/html interface at https://<vcip>/mob but this is human oriented UI. You can use also C/java/perl sdk to connect to vCenter API.

-Daniel

Reply
0 Kudos
Algosec123
Contributor
Contributor

Hi Daniel et al,

I'm not sure I understand well...

Some beginner question:

  • Is the mob interface based on Orchestrator?

        i.e. it means that Orchestrator need to be installed on vCenter, or this independent the http interface?        

        Does it perform REST requests to Orchestrator behind the scenes?

  • The same re Java sdk- should I have Orchestrator for that? which credential do I need- for the Orchestrator  or vCneter?
  • And the main question-

       Does Orchestrator provide me the required data I mentioned?

       How can I get the data via Orchestrator/ mob/ sdk etc.

       Can you please guide me?


Thanks in advance

      

Reply
0 Kudos
dvatov
VMware Employee
VMware Employee

Hi,

- mob stands for Managed Object Browser. It is based on the vCenter API. Not connected to Orchestrator but very useful if you need to understand the vCenter API.

- vCenter API can be used in many ways and Orchestrator is just one of them. It is not mandatory to have Orchestrator to use vCenter API.

- Orchestrator automates vCenters through its vCenter plugin (bundled by default with every distribution). This plugin exposes the whole vCenter API so you should be able to get the data you need.

I think that you should find the data you need in the mob since and then script it. The objects you browse in MOB are with almost the same name and same hierarchy in Orchestrator.

Reply
0 Kudos
Algosec123
Contributor
Contributor

Hi,

Thanks for quick response.

A I understand from your answer I can use Java SDK without Orchestrator.

But according to VMware vSphere 5.1 documentation‌ it seems that I need the vco-server ip: (- something that I don't have)

//start a new session to Orchestrator by using specified credentials

VcoSession session = DefaultVcoSessionFactory.newLdapSession(new URI("https://vco-server:8281/api/"), "username", "password");

Maybe do you mean another SDK?

If so, please refer me the the right one

Reply
0 Kudos
dvatov
VMware Employee
VMware Employee

Hi,

The link you post is for Orchestrator API. vSphere one (vCenter/ESX) is at vSphere API and SDK Documentation.

Regards,

Daniel

Reply
0 Kudos