Examples of Vm


Examples of org.jclouds.vcloud.director.v1_5.domain.Vm

   /**
    * Suspend a {@link Vm}.
    */
   protected Vm suspendVm(String vmUrn) {
      Vm test = vmApi.get(vmUrn);
      Status status = test.getStatus();
      if (status != Status.SUSPENDED) {
         Task suspend = vmApi.suspend(vmUrn);
         assertTaskSucceedsLong(suspend);
      }
      test = vmApi.get(vmUrn);
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Vm

   /**
    * Check the {@link Vm}s current status.
    */
   protected void assertVmStatus(String vmUrn, final Status status) {
      Vm testVm = vmApi.get(vmUrn);
      assertStatus(VM, testVm, status);
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Vm

               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vm/vm.xml", VCloudDirectorMediaType.VM)
               .httpResponseBuilder().build());

      Vm expected = getVm();

      assertEquals(api.getVmApi().get(vmURI), expected);
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Vm

            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vm/modifiedVm.xml", VCloudDirectorMediaType.VM)
            .httpResponseBuilder().build());

    Vm modified = getVm();
    modified.setName("new-name");
    modified.setDescription("New Description");

    Task expected = editVmTask();

    assertEquals(api.getVmApi().edit(vmURI, modified), expected);
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Vm

         assertEquals(api.getVmApi().editVirtualHardwareSectionSerialPorts(vmURI, serialPorts), expected);
   }

   public static Vm getVm() {
      // FIXME Does not match XML
      Vm vm = Vm.builder()
            .href(URI.create("https://mycloud.greenhousedata.com/api/vApp/vm-d0e2b6b9-4381-4ddc-9572-cdfae54059be"))
//            .link(Link.builder()
//                     .href(URI.create())
//                     .build())
            .build();
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Vm

   /**
    * @see VmApi#edit(String, Vm)
    */
   @Test(description = "PUT /vApp/{id}", dependsOnMethods = { "testGetVm" })
   public void testEditVm() {
      Vm newVm = Vm.builder().name(name("new-name-")).description("New Description").build();

      // The method under test
      Task editVm = vmApi.edit(vmUrn, newVm);
      assertTrue(retryTaskSuccess.apply(editVm), String.format(TASK_COMPLETE_TIMELY, "editVm"));

      // Get the edited Vm
      vm = vmApi.get(vmUrn);

      // Check the required fields are set
      assertEquals(vm.getName(), newVm.getName(),
               String.format(OBJ_FIELD_EQ, VM, "Name", newVm.getName(), vm.getName()));
      assertEquals(vm.getDescription(), newVm.getDescription(),
               String.format(OBJ_FIELD_EQ, VM, "Description", newVm.getDescription(), vm.getDescription()));
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Vm

      assertTaskSucceedsLong(deployVApp);

      // Get the edited VApp and the Vm
      remove = vAppApi.get(remove.getId());
      List<Vm> vms = remove.getChildren().getVms();
      Vm temp = Iterables.get(vms, 0);

      // otherwise it's impossible to stop a running vApp with no vms
      if (vms.size() == 1) {
         UndeployVAppParams undeployParams = UndeployVAppParams.builder().build();
         Task shutdownVapp = vAppApi.undeploy(remove.getId(), undeployParams);
         assertTaskSucceedsLong(shutdownVapp);
      } else {
         powerOffVm(temp.getId());
      }
      // The method under test
      Task removeVm = vmApi.remove(temp.getId());
      assertTrue(retryTaskSuccess.apply(removeVm), String.format(TASK_COMPLETE_TIMELY, "removeVm"));

      Vm removed = vmApi.get(temp.getId());
      assertNull(removed, "The Vm " + temp.getName() + " should have been removed");
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Vm

   }
  

   public static Vm getVm() {
      // FIXME Does not match XML
      Vm vm = Vm.builder()
            .href(URI.create("https://mycloud.greenhousedata.com/api/vApp/vm-d0e2b6b9-4381-4ddc-9572-cdfae54059be"))
//            .link(Link.builder()
//                     .href(URI.create())
//                     .build())
            .build();
View Full Code Here

Examples of org.jclouds.vcloud.domain.Vm

         VApp vapp = client.getContext().unwrap(VCloudApiMetadata.CONTEXT_TOKEN).getApi().getVAppClient().getVApp(
                  node.getUri());
         assertEquals(vapp.getDescription(), group);

         Vm vm = Iterables.get(vapp.getChildren(), 0);
         String apiOutput = vm.getGuestCustomizationSection().getCustomizationScript();
         checkApiOutput(apiOutput);

         ExecResponse vmTools = client.runScriptOnNode(node.getId(), PARSE_VMTOOLSD,
               wrapInInitScript(false).runAsRoot(false));
         checkApiOutput(new String(base64().decode(vmTools.getOutput().trim()), UTF_8));
View Full Code Here

Examples of org.jnode.vm.facade.Vm

     * @param factory
     */
    protected Item(ItemFactory factory) {
        this.factory = factory;
        if (false) {
            final Vm vm = VmUtils.getVm();
            final String name = getClass().getName();
            vm.getCounterGroup(name).getCounter("new").inc();
        }
    }
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.