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

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


    assertEquals(api.getVAppApi().remove(vAppURI), expected);
   }

   @Test(enabled = false)
   public void testControlAccess() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vAppId + "/action/controlAccess")
            .xmlFilePayload("/vApp/controlAccessParams.xml", VCloudDirectorMediaType.CONTROL_ACCESS)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/controlAccessParams.xml", VCloudDirectorMediaType.CONTROL_ACCESS)
            .httpResponseBuilder().build());

    ControlAccessParams params = controlAccessParams();

    ControlAccessParams expected = controlAccessParams();

    assertEquals(api.getVAppApi().editControlAccess(vAppURI, params), expected);
   }
View Full Code Here


    assertEquals(api.getVAppApi().editControlAccess(vAppURI, params), expected);
   }

   @Test(enabled = false)
   public void testDeploy() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vAppId + "/action/deploy")
            .xmlFilePayload("/vApp/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.getVAppApi().deploy(vAppURI, params), expected);
   }
View Full Code Here

    assertEquals(api.getVAppApi().deploy(vAppURI, params), expected);
   }

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

    Task expected = discardSuspendedStateTask();

    assertEquals(api.getVAppApi().discardSuspendedState(vAppURI), expected);
   }
View Full Code Here

    assertEquals(api.getVAppApi().discardSuspendedState(vAppURI), expected);
   }

   @Test(enabled = false)
   public void testEnterMaintenanceMode() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vAppId + "/action/enterMaintenanceMode")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .httpResponseBuilder().statusCode(204).build());

    // TODO how to test?
    api.getVAppApi().enterMaintenanceMode(vAppURI);
   }
View Full Code Here

    api.getVAppApi().enterMaintenanceMode(vAppURI);
   }

   @Test(enabled = false)
   public void testExitMaintenanceMode() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vAppId + "/action/exitMaintenanceMode")
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .httpResponseBuilder().statusCode(204).build());

    // TODO how to test?
    api.getVAppApi().exitMaintenanceMode(vAppURI);
   }
View Full Code Here

    api.getVAppApi().exitMaintenanceMode(vAppURI);
   }

   @Test(enabled = false)
   public void testRecomposeVApp() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vAppId + "/action/recomposeVApp")
            .xmlFilePayload("/vApp/recomposeVAppParams.xml", VCloudDirectorMediaType.RECOMPOSE_VAPP_PARAMS)
            .acceptAnyMedia()
            .httpRequestBuilder().build(),
         new VcloudHttpResponsePrimer()
            .xmlFilePayload("/vApp/recomposeVAppTask.xml", VCloudDirectorMediaType.TASK)
            .httpResponseBuilder().build());

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

    Task expected = recomposeVAppTask();

    assertEquals(api.getVAppApi().recompose(vAppURI, params), expected);
   }
View Full Code Here

    assertEquals(api.getVAppApi().recompose(vAppURI, params), expected);
   }

   @Test(enabled = false)
   public void testUndeploy() {
      VCloudDirectorApi api = requestsSendResponses(loginRequest, sessionResponse,
         new VcloudHttpRequestPrimer()
            .apiCommand("POST", vAppId + "/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.getVAppApi().undeploy(vAppURI, params), expected);
   }
View Full Code Here

    assertEquals(api.getVAppApi().undeploy(vAppURI, params), expected);
   }

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

      Task expected = powerOffTask();

      assertEquals(api.getVAppApi().powerOff(vAppURI), expected);
   }
View Full Code Here

      assertEquals(api.getVAppApi().powerOff(vAppURI), expected);
   }

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

      Task expected = powerOnTask();

      assertEquals(api.getVAppApi().powerOn(vAppURI), expected);
   }
View Full Code Here

      HttpResponse vAppRebootResponse = HttpResponse.builder()
            .payload(payloadFromResourceWithContentType("/vapp/vAppRebootTask.xml", VCloudDirectorMediaType.TASK))
            .statusCode(200)
            .build();

      VCloudDirectorApi vCloudDirectorApi = requestsSendResponses(
            loginRequest, sessionResponse,
            vAppEntityRequest, vAppEntityResponse,
            vAppRebootRequest, vAppRebootResponse
      );

      Task actual = vCloudDirectorApi.getVAppApi().reboot(vAppUrn);
      Task expected = rebootTask();

      assertEquals(actual, 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.