Package org.jclouds.vcloud.director.v1_5.user

Examples of org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi


      assertEquals(api.getVmApi().get(vmURI), expected);
   }

   @Test(enabled = false)
   public void testEditVm() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("PUT", vmId)
            .xmlFilePayload("/vm/editVm.xml", VCloudDirectorMediaType.VM)
            .acceptAnyMedia()
            .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


    assertEquals(api.getVmApi().edit(vmURI, modified), expected);
   }

   @Test(enabled = false)
   public void testRemoveVm() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("DELETE", vmId)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vm/removeVmTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

    Task expected = removeVmTask();

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

    assertEquals(api.getVmApi().remove(vmURI), expected);
   }

   @Test(enabled = false)
   public void testConsolidateVm() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vmId + "/action/consolidate")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vm/consolidateVmTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

    Task expected = consolidateVmTask();

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

    assertEquals(api.getVmApi().consolidate(vmURI), expected);
   }

   @Test(enabled = false)
   public void testDeploy() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vmId + "/action/deploy")
            .xmlFilePayload("/vm/deployParams.xml", VCloudDirectorMediaType.DEPLOY_VAPP_PARAMS)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/deployTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

      DeployVAppParams params = DeployVAppParams.builder()
            .build();

    Task expected = deployTask();

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

    assertEquals(api.getVmApi().deploy(vmURI, params), expected);
   }

   @Test(enabled = false)
   public void testDiscardSuspendedState() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vmId + "/action/discardSuspendedState")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/discardSuspendedStateTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

    Task expected = discardSuspendedStateTask();

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

    assertEquals(api.getVmApi().discardSuspendedState(vmURI), expected);
   }

   @Test(enabled = false)
   public void testInstallVMwareTools() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vmId + "/action/installVMwareTools")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/installVMwareToolsTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

    Task expected = installVMwareToolsTask();

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

    assertEquals(api.getVmApi().installVMwareTools(vmURI), expected);
   }

   @Test(enabled = false)
   public void testRelocate() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vmId + "/action/relocate")
            .xmlFilePayload("/vApp/relocateParams.xml", VCloudDirectorMediaType.RELOCATE_VM_PARAMS)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/relocateTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

      RelocateParams params = RelocateParams.builder()
            .build();

    Task expected = relocateTask();

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

    assertEquals(api.getVmApi().relocate(vmURI, params), expected);
   }

   @Test(enabled = false)
   public void testUndeploy() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vmId + "/action/undeploy")
            .xmlFilePayload("/vApp/undeployParams.xml", VCloudDirectorMediaType.UNDEPLOY_VAPP_PARAMS)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/undeployTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

      UndeployVAppParams params = UndeployVAppParams.builder()
            .build();

    Task expected = undeployTask();

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

    assertEquals(api.getVmApi().undeploy(vmURI, params), expected);
   }

   @Test(enabled = false)
   public void testUpgradeHardwareVersion() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vmId + "/action/upgradeHardwareVersion")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/upgradeHardwareVersionTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

    Task expected = upgradeHardwareVersionTask();

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

    assertEquals(api.getVmApi().upgradeHardwareVersion(vmURI), expected);
   }

   @Test(enabled = false)
   public void testPowerOff() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vmId + "/power/action/powerOff")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/powerOffTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

      Task expected = powerOffTask();

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

TOP

Related Classes of org.jclouds.vcloud.director.v1_5.user.VCloudDirectorApi

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.