Package org.jclouds.cloudstack.domain

Examples of org.jclouds.cloudstack.domain.AsyncCreateResponse


         checkVolume(volume);

         VirtualMachine virtualMachine = getPreferredVirtualMachine();

         logger.info("attaching volume %s to vm %s", volume, virtualMachine);
         AsyncCreateResponse job = client.getVolumeClient().attachVolume(volume.getId(), virtualMachine.getId());
         assertTrue(jobComplete.apply(job.getJobId()));
         Volume attachedVolume = findVolumeWithId(volume.getId());

         checkVolume(attachedVolume);
         assertEquals(virtualMachine.getId(), attachedVolume.getVirtualMachineId());
         assertNotNull(attachedVolume.getAttached());

         logger.info("detaching volume %s from vm %s", volume, virtualMachine);
         job = client.getVolumeClient().detachVolume(volume.getId());
         assertTrue(jobComplete.apply(job.getJobId()));
         Volume detachedVolume = findVolumeWithId(volume.getId());

         checkVolume(detachedVolume);
         assertNull(detachedVolume.getAttached());
View Full Code Here


   public void testCreateVolumeFromSnapshotInZoneAndDeleteVolume() {
      logger.info("testCreateVolumeFromSnapshotInZoneAndDeleteVolume (takes ~3m)");
      assertNotNull(getPreferredSnapshot());

      AsyncCreateResponse job = client.getVolumeClient().createVolumeFromSnapshotInZone(prefix + "-jclouds-volume",
            getPreferredSnapshot().getId(), zoneId);
      assertTrue(jobComplete.apply(job.getJobId()));
      Volume volume = findVolumeWithId(job.getId());

      checkVolume(volume);
      client.getVolumeClient().deleteVolume(volume.getId());
   }
View Full Code Here

              HttpResponse.builder()
                      .statusCode(200)
                      .payload(payloadFromResource("/queryasyncjobresultresponse-createvolume.json"))
                      .build());
     
      AsyncCreateResponse response = client.createVolumeFromCustomDiskOfferingInZone("VolumeClientExpectTest-jclouds-volume", "0473f5dd-bca5-4af4-a9b6-db9e8a88a2f6", "6f9a2921-b22a-4149-8b71-6ffc275a2177", 1);
      assertNotNull(response);
   }
View Full Code Here

      User testUser = null;
      try {
         testAccount = createTestAccount(globalAdminClient, prefix);
         testUser = createTestUser(globalAdminClient, testAccount, prefix);

         AsyncCreateResponse response = domainAdminClient.getUserClient().disableUser(testUser.getId());
         assertNotNull(response);
         assertTrue(adminJobComplete.apply(response.getJobId()));

         AsyncJob<User> job = domainAdminClient.getAsyncJobClient().getAsyncJob(response.getJobId());
         assertNotNull(job);
         assertEquals(job.getResult().getState(), User.State.DISABLED);

         User updated = domainAdminClient.getUserClient().enableUser(testUser.getId());
         assertNotNull(updated);
View Full Code Here

         HttpResponse.builder()
            .statusCode(200)
            .payload(payloadFromResource("/createfirewallrulesresponse.json"))
            .build());

      AsyncCreateResponse response = client.createFirewallRuleForIpAndProtocol("2", FirewallRule.Protocol.TCP);
      assertEquals(response.getJobId(), "2036");
      assertEquals(response.getId(), "2017");
   }
View Full Code Here

         HttpResponse.builder()
            .statusCode(200)
            .payload(payloadFromResource("/createportforwardingrulesresponse.json"))
            .build());

      AsyncCreateResponse response = client.createPortForwardingRuleForVirtualMachine(
         "2", PortForwardingRule.Protocol.TCP, 22, "1234", 22);
      assertEquals(response.getJobId(), "2035");
      assertEquals(response.getId(), "2015");
   }
View Full Code Here

              HttpResponse.builder()
                      .statusCode(200)
                      .payload(payloadFromResource("/createegressfirewallrulesresponse.json"))
                      .build());

      AsyncCreateResponse response = client.createEgressFirewallRuleForIpAndProtocol("2", FirewallRule.Protocol.TCP);
      assertEquals(response.getJobId(), "2036");
      assertEquals(response.getId(), "2017");
   }
View Full Code Here

      Account testAccount = null;
      try {
         testAccount = createTestAccount(globalAdminClient, prefix);

         AsyncCreateResponse response = domainAdminClient.getAccountClient()
            .disableAccount(testAccount.getName(), testAccount.getDomainId(), false);
         assertNotNull(response);
         assertTrue(adminJobComplete.apply(response.getJobId()));

         AsyncJob<Account> job = domainAdminClient.getAsyncJobClient().getAsyncJob(response.getJobId());
         assertEquals(job.getResult().getState(), Account.State.DISABLED);

         Account updated = domainAdminClient.getAccountClient()
            .enableAccount(testAccount.getName(), testAccount.getDomainId());
         assertNotNull(updated);
View Full Code Here

   public void testDeployVirtualMachineIs2xxVersion3x() {
      HttpResponse deployVirtualMachineInZoneResponse = HttpResponse.builder().statusCode(200)
            .payload(payloadFromResource("/deployvirtualmachineresponse.json")).build();
      VirtualMachineClient client = requestSendsResponse(deployVirtualMachineInZone, deployVirtualMachineInZoneResponse);

      AsyncCreateResponse async = client.deployVirtualMachineInZone("zone1", "serviceOffering1", "template1");

      assertEquals(async, AsyncCreateResponse.builder().id("1234").jobId("50006").build());
   }
View Full Code Here

   public void testDeployVirtualMachineIs2xxVersion4x() {
      HttpResponse deployVirtualMachineInZoneResponse = HttpResponse.builder().statusCode(200)
            .payload(payloadFromResource("/deployvirtualmachineresponse4x.json")).build();
      VirtualMachineClient client = requestSendsResponse(deployVirtualMachineInZone, deployVirtualMachineInZoneResponse);

      AsyncCreateResponse async = client.deployVirtualMachineInZone("zone1", "serviceOffering1", "template1");

      assertEquals(
            async,
            AsyncCreateResponse.builder().id("1cce6cb7-2268-47ff-9696-d9e610f6619a")
                  .jobId("13330fc9-8b3e-4582-aa3e-90883c041ff0").build());
View Full Code Here

TOP

Related Classes of org.jclouds.cloudstack.domain.AsyncCreateResponse

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.