Package com.vmware.vim25.mo

Examples of com.vmware.vim25.mo.InventoryNavigator


    @Test(expectedExceptions = AmazonServiceException.class)
    public void shouldEncapsulateInvalidPropertyException() throws RemoteException {
        VSphereServiceConnectionWithMockedInventoryNavigator service =
                        new VSphereServiceConnectionWithMockedInventoryNavigator();
        InventoryNavigator inventoryNavigatorMock = service.getInventoryNavigatorMock();
        when(inventoryNavigatorMock.searchManagedEntities(VIRTUAL_MACHINE_TYPE_NAME)).thenThrow(new InvalidProperty());

        service.describeVirtualMachines();
    }
View Full Code Here


    @Test(expectedExceptions = AmazonServiceException.class)
    public void shouldEncapsulateRuntimeFaultException() throws RemoteException {
        VSphereServiceConnectionWithMockedInventoryNavigator service =
                        new VSphereServiceConnectionWithMockedInventoryNavigator();
        InventoryNavigator inventoryNavigatorMock = service.getInventoryNavigatorMock();
        when(inventoryNavigatorMock.searchManagedEntities(VIRTUAL_MACHINE_TYPE_NAME)).thenThrow(new RuntimeFault());

        service.describeVirtualMachines();
    }
View Full Code Here

    @Test(expectedExceptions = AmazonServiceException.class)
    public void shouldEncapsulateRemoteExceptionException() throws RemoteException {
        VSphereServiceConnectionWithMockedInventoryNavigator service =
                        new VSphereServiceConnectionWithMockedInventoryNavigator();
        InventoryNavigator inventoryNavigatorMock = service.getInventoryNavigatorMock();
        when(inventoryNavigatorMock.searchManagedEntities(VIRTUAL_MACHINE_TYPE_NAME)).thenThrow(new RemoteException());

        service.describeVirtualMachines();
    }
View Full Code Here

            return Arrays.copyOf(mes, mes.length, VirtualMachine[].class);
        }
    }

    protected InventoryNavigator getInventoryNavigator() {
        return new InventoryNavigator(service.getRootFolder());
    }
View Full Code Here

    /**
     * Gets the named VirtualMachine.
     */
    public VirtualMachine getVirtualMachineById(String instanceId) throws RemoteException {
        InventoryNavigator inventoryNavigator = getInventoryNavigator();
        VirtualMachine virtualMachine = (VirtualMachine) inventoryNavigator.searchManagedEntity(
                VIRTUAL_MACHINE_TYPE_NAME, instanceId);

        return virtualMachine;
    }
View Full Code Here

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

    Folder rootFolder = si.getRootFolder();
    VirtualMachine vm = (VirtualMachine) new InventoryNavigator(
      rootFolder).searchManagedEntity("VirtualMachine", vmname);

    if(vm==null)
    {
      System.out.println("No VM " + vmname + " found");
View Full Code Here

  public static void main(String[] args) throws Exception
  {
    String vmName = "Rawc1.2_Win7x32bit_Target";

    ServiceInstance si = new ServiceInstance(new URL("https://8.8.8.8/sdk"), "administrator", "vmware", true);
    VirtualMachine vm = (VirtualMachine) new InventoryNavigator(si.getRootFolder()).searchManagedEntity("VirtualMachine", vmName);

    VirtualMachineDeviceManager vmdm = new VirtualMachineDeviceManager(vm);

    vmdm.createNetworkAdapter(VirtualNetworkAdapterType.VirtualE1000, "dvPortGroup", "00:50:56:00:12:14", true, true);
   
View Full Code Here

    String password = clp.get_option("password");
    String hostname = clp.get_option("hostname");

    ServiceInstance si = new ServiceInstance(new URL(urlStr),
        username, password, true);
    HostSystem host = (HostSystem) new InventoryNavigator(si
        .getRootFolder()).searchManagedEntity("HostSystem",
        hostname);

    if (host == null) {
      System.out.println("Host cannot be found");
View Full Code Here

    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

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

    String vmname = args[3];
    VirtualMachine vm = (VirtualMachine) new InventoryNavigator(
      si.getRootFolder()).searchManagedEntity(
        "VirtualMachine", vmname);

    if(vm == null)
    {
View Full Code Here

TOP

Related Classes of com.vmware.vim25.mo.InventoryNavigator

Copyright © 2018 www.massapicom. 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.