Examples of ManagedEntity


Examples of com.vmware.vim.binding.vim.ManagedEntity

    * @throws Exception
    */
   private static String calculatePathSlow(ResourcePool rp) throws Exception {
      LinkedList<ResourcePool> rpStack  = new LinkedList<ResourcePool>();
      while (rp != null) {
         ManagedEntity parent = MoUtil.getManagedObject(rp.getParent());
         AuAssert.check(parent != null);
         if (!(parent instanceof ResourcePool)) {
            // skip the root RP's name in the path
            break;
         }
View Full Code Here

Examples of com.vmware.vim25.mo.ManagedEntity

     * @param name Name of the entity.
     * @return Found managed entity in success or null in failure.
     */
    protected ManagedEntity searchManagedEntity(String type, String name)
    {
        ManagedEntity ret = null;
        try {
            ret = new InventoryNavigator
                (rootFolder_).searchManagedEntity(type, name);
        } catch (Exception e) { /* InvalidProperty, RuntimeFault, RemoteException */
            logger_.warning(Utility.toString(e));
View Full Code Here

Examples of com.vmware.vim25.mo.ManagedEntity

        ManagedObjectReference mor =
            generateMoref("VirtualMachine", morefStr);
        if (mor == null) { return null; }

        ManagedEntity vm =
            MorUtil.createExactManagedEntity(si_.getServerConnection(), mor);

        if (vm instanceof VirtualMachine) {
            return (VirtualMachine) vm; /* may be null */
        } else {
View Full Code Here

Examples of com.vmware.vim25.mo.ManagedEntity

     */
    public VirtualMachineManager searchVmWithName(String vmName)
        throws Exception
    {
        if (conn_.isConnected() == false) { conn_.connect(); }
        ManagedEntity vm = conn_.searchManagedEntity("VirtualMachine", vmName);
        if (vm == null) { throw new Exception(); }
        return new VirtualMachineManager(conn_, (VirtualMachine)vm);
    }
View Full Code Here

Examples of com.vmware.vim25.mo.ManagedEntity

    {
        if (conn_.isConnected() == false) { conn_.connect(); }

        List<String> ret = new LinkedList<String>();
       
        ManagedEntity host = conn_.searchManagedEntity("HostSystem", hostname);
        if (host == null) { return ret; }

        List<Datastore> tmp = getAllDatastoreList((HostSystem) host);

        for (Datastore ds: tmp) {
View Full Code Here

Examples of com.vmware.vim25.mo.ManagedEntity

     * Get name of default datastore.
     */
    public String getDefaultDatastoreName(String hostName)
        throws Exception
    {
        ManagedEntity host = conn_.searchManagedEntity("HostSystem", hostName);
        if (host == null) { throw new Exception("host is not found."); }
        return getDefaultDatastore((HostSystem) host).getName();
    }
View Full Code Here

Examples of com.vmware.vim25.mo.ManagedEntity

        return buf.toString();
    }

    private VirtualMachine createVMMock(String id) {
        VirtualMachine vm1 = mock(VirtualMachine.class);
        ManagedEntity me1 = mock(ManagedEntity.class);
        when(vm1.getName()).thenReturn(id + ".name");
        when(vm1.getParent()).thenReturn(me1);
        when(me1.getName()).thenReturn(id + ".parent.name");
        return vm1;
    }
View Full Code Here

Examples of com.vmware.vim25.mo.ManagedEntity

    ServiceInstance si = new ServiceInstance(
      new URL(args[0]), args[1], args[2], true);

    String vmname = args[3];
    ManagedEntity vm = new InventoryNavigator(
      si.getRootFolder()).searchManagedEntity(
        "VirtualMachine", vmname);
   
    if(vm == null)
    {
View Full Code Here

Examples of com.vmware.vim25.mo.ManagedEntity

    System.out.println("session:" + sessionStr);

    ServiceInstance si = new ServiceInstance(new URL(
        request.getParameter(SERVICE_URL)),sessionStr, true);

    ManagedEntity me = MorUtil.createExactManagedEntity(
        si.getServerConnection(), mor);

    String name = me.getName();
    out.println("name:" + name);
    out.println(DateFormat.getDateTimeInstance().format(
        new Date()));
  }
View Full Code Here

Examples of com.vmware.vim25.mo.ManagedEntity

      InventoryNavigator iv = new InventoryNavigator(si.getRootFolder());
     
      HttpNfcLease hnLease = null;
     
      ManagedEntity me = null;
      if (entityType.equals("VirtualApp"))
      {
        me = iv.searchManagedEntity("VirtualApp", vAppOrVmName);
        hnLease = ((VirtualApp)me).exportVApp();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.