Home > vSphere API > Announcing vijavaNG 6.5.1 Beta with Tagging and VCSA Management APIs

Announcing vijavaNG 6.5.1 Beta with Tagging and VCSA Management APIs

With the increasingly wider adoption of commercial vijavaNG in the VMware communities, we always seek to enhance and extend the APIs beyond these like ESX agent APIs. Today we are happy to announce the 6.5.1 which support for the tagging and vCenter appliance management APIs.

Tagging

Time to learn how to "Google" and manage your VMware and clouds in a fast and secure

HTML5 App

Tagging is one important feature that was introduced in vSphere 5.1. For some reasons, VMware hasn’t opened the public to the public with the standard vSphere API. That is why you can use it in the vSphere Web Client, but not any other products from other vendors. Technically speaking, you can dig out the APIs but that is not in compliance with VMware licensing.

That was changed with the vSphere Automation SDK which includes a few REST APIs including the tagging APIs. On the very high level, there are 3 different concepts in the tagging feature: tag category, tag definition, and tag association. Their names explain pretty much everything. In a normal workflow, you would create a new category first, then a new tag in the category, and finally associating the tag with one of many managed objects. If the category or tag already exists, you can skip them safely. More often than not, you will only need tag association which is really the action of tagging.

While playing with the Java SDK for the vSphere automation API, I found it’s pretty hard to understand, let alone to use. Also, since the tagging is just one small part of the whole vSphere management, it’s important to fit it into the vSphere API family. Although VMware’s direction is to make this REST API to be the future, I don’t think it can happen any time soon. Will discuss it in a separate blog post later.

To help our vijavaNG customers, we decided to implement the tagging API into the vijavaNG as an integral part even though the underlying vSphere APIs and tagging APIs are two different implementations. The original vSphere API is the same and can still run by itself. The tagging APIs depends on the vSphere APIs and can run with it. In other words, if you don’t need tagging you can still run the old binary; if you do, you can add the tagging jar and its dependency. This design allows biggest flexibility.

Here is how a sample looks like:

/**
 * DoubleCloud Inc. All rights reserved.
 */
package com.vmware.cis.sample;
 
import com.vmware.cis.common.CisInstance;
import com.vmware.cis.tag.Tag;
import com.vmware.cis.tag.TagAssociationManager;
import com.vmware.cis.tag.TagCategory;
import com.vmware.cis.tag.TagCategoryManager;
import com.vmware.cis.tag.TagManager;
import com.vmware.vim25.mo.Folder;
import com.vmware.vim25.mo.HostSystem;
import com.vmware.vim25.mo.InventoryNavigator;
import com.vmware.vim25.mo.ServiceInstance;
import java.io.IOException;
import java.net.URL;
 
/**
 *
 * @author Steve
 */
public class TagDemo
{
  public static void main(String[] args) throws IOException
  {
    ServiceInstance si = new ServiceInstance(new URL("https://10.8.8.10/sdk"), "administrator@vsphere.local", "doublecloud", true);
    Folder rootFolder = si.getRootFolder();
    HostSystem host = (HostSystem) new InventoryNavigator(rootFolder).searchManagedEntity("HostSystem", "10.8.8.11");
 
    CisInstance ci = new CisInstance("10.8.8.10", "administrator@vsphere.local", "doublecloud");
    String tagID = getTagID(ci, "SecuredAsset");
    TagAssociationManager tam = ci.getManager(TagAssociationManager.class);
    tam.attach(tagID, host.getMOR());
 
    ci.deleteSession();
    si.getServerConnection().logout();
  }
 
  public static String getTagID(CisInstance ci, String name) throws IOException
  {
    TagManager tagMgr = ci.getManager(TagManager.class);
    String[] tagIDs = tagMgr.list();
    for(String tagID : tagIDs)
    {
      Tag tag = tagMgr.get(tagID);
      if(tag.name.equals(name)) {
        return tag.id;
      }
    }
    return null;
  }
 }

Hope you would agree that this is a dramatic simplification from the samples using the VMware Java SDK like this one. It also integrates better with the vSphere API.

VCSA Management

The appliance management APIs is a really nice addition to the vSphere management. From what we see from the API endpoints, it’s likely based on the VMware Studio product which has probably been discontinued (not quite sure – if you know please leave a comment). That is why you can pretty much map the API to the Web GUI exposed at 5480 port.

With the appliance APIs, you can control the access of shell/SSH/DCUI, monitor the health of services, configure the network, retrieve system information like up time, and manage the vMon services. Once the endpoints are clear, the related services are pretty easy to understand. For this reason, we like the REST API documentation. Somehow the schema of the REST is not released anywhere.

There are a few other APIs in the automation SDK that we choose not to implement at this time: vAPI, content library APIs. If you have interests to see them in vijavaNG, please let us know.

  1. May 16th, 2017 at 01:41 | #1

    [DoubleCloud] Announcing vijavaNG 6.5.1 Beta with Tagging and VCSA Management APIs https://t.co/c1WbaH1fMW

  2. May 16th, 2017 at 03:24 | #2

    Announcing vijavaNG 6.5.1 Beta with Tagging and VCSA Management APIs https://t.co/D2MxdQqGiy

  1. No trackbacks yet.