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

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


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

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

      Task expected = powerOnTask();

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


      HttpResponse vmRebootResponse = HttpResponse.builder()
            .payload(payloadFromResourceWithContentType("/vm/vmRebootTask.xml", VCloudDirectorMediaType.TASK))
            .statusCode(200)
            .build();

      VCloudDirectorApi vCloudDirectorApi = requestsSendResponses(
            loginRequest, sessionResponse,
            vmEntityRequest, vmEntityResponse,
            vmRebootRequest, vmRebootResponse
      );

      Task actual = vCloudDirectorApi.getVmApi().reboot(vmUrn);

      Task expected = rebootTask();

      assertEquals(actual, expected);
   }
View Full Code Here

      assertEquals(actual, expected);
   }

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

      Task expected = resetTask();

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

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

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

      Task expected = shutdownTask();

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

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

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

    Task expected = suspendTask();

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

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

   @Test(enabled = false)
   public void testGetGuestCustomizationSection() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("GET", vmId + "/guestCustomizationSection")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/getGuestCustomizationSection.xml", VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION)
            .httpResponseBuilder().build());

    GuestCustomizationSection expected = getGuestCustomizationSection();

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

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

   @Test(enabled = false)
   public void testEditGuestCustomizationSection() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("PUT", vmId + "/guestCustomizationSection")
            .xmlFilePayload("/vApp/editGuestCustomizationSection.xml", VCloudDirectorMediaType.GUEST_CUSTOMIZATION_SECTION)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/editGuestCustomizationSectionTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

      GuestCustomizationSection section = getGuestCustomizationSection().toBuilder()
            .build();

      Task expected = editGuestCustomizationSectionTask();

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

      assertEquals(api.getVmApi().editGuestCustomizationSection(vmURI, section), expected);
   }

   @Test(enabled = false)
   public void testEjectMedia() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("PUT", vmId + "/media/action/ejectMedia")
            .xmlFilePayload("/vApp/ejectMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/ejectMediaTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

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

      Task expected = ejectMediaTask();

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

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

   @Test(enabled = false)
   public void testInsertMedia() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("PUT", vmId + "/media/action/insertMedia")
            .xmlFilePayload("/vApp/insertMediaParams.xml", VCloudDirectorMediaType.MEDIA_PARAMS)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/insertMediaTask.xml", VCloudDirectorMediaType.VAPP)
            .httpResponseBuilder().build());

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

      Task expected = insertMediaTask();

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

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

   @Test(enabled = false)
   public void testGetNetworkConnectionSection() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("GET", vmId + "/networkConnectionSection")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/getNetworkConnectionSection.xml", VCloudDirectorMediaType.NETWORK_CONNECTION_SECTION)
            .httpResponseBuilder().build());

      NetworkConnectionSection expected = getNetworkConnectionSection();

         assertEquals(api.getVmApi().getNetworkConnectionSection(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.