1 Reply Latest reply on Oct 24, 2018 7:21 AM by ViswanathAngajala

    Fetching Cluster Events using VI Java API

    Phaneendra_Krotha Novice


      Hi,

      Can someone help me in connecting to vCenter server and retrieve only Cluster related events using VI Java API?

      Using below snippet I'm able to retrieve Cluster details of my interest say name etc... but I really want to retrieve the details when a cluster is added/removed from vCenter server.

       

      ServiceInstance si = new ServiceInstance(new URL("myhost"), "username", "password", true);

        Folder rootFolder = si.getRootFolder();

        String name = rootFolder.getName();

        System.out.println("root:" + name);

        ManagedEntity[] mes1 = new InventoryNavigator(rootFolder).searchManagedEntities("ClusterComputeResource");

       

       

      Area of Interest

      ============

      1. A Cluster newly  added to a datacenter I would like to retrieve this event from vCenter using VI Java API?

      2.  A Cluster removed from a datacenter, I would like to retrieve this event from vCenter using VI Java API?

       

       

       

      Thanks,

      Phaneendra.