Package org.jclouds.googlecomputeengine.options

Examples of org.jclouds.googlecomputeengine.options.AttachDiskOptions


      InstanceApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
              TOKEN_RESPONSE, attach, attachResponse).getInstanceApiForProject("myproject");

      assertEquals(api.attachDiskInZone("us-central1-a", "test-1",
              new AttachDiskOptions()
                      .mode(DiskMode.READ_ONLY)
                      .source(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1"))
                      .type(DiskType.PERSISTENT)),
              new ParseOperationTest().expected());
   }
View Full Code Here


      InstanceApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
              TOKEN_RESPONSE, attach, attachResponse).getInstanceApiForProject("myproject");

      assertNull(api.attachDiskInZone("us-central1-a", "test-1",
              new AttachDiskOptions()
                      .mode(DiskMode.READ_ONLY)
                      .source(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1"))
                      .type(DiskType.PERSISTENT)));

   }
View Full Code Here

   public void testAttachDiskToInstance() {
      assertZoneOperationDoneSucessfully(diskApi().createInZone(ATTACH_DISK_NAME, 1, DEFAULT_ZONE_NAME), TIME_WAIT);

      Instance originalInstance = api().getInZone(DEFAULT_ZONE_NAME, INSTANCE_NAME);
      assertZoneOperationDoneSucessfully(api().attachDiskInZone(DEFAULT_ZONE_NAME, INSTANCE_NAME,
              new AttachDiskOptions().type(DiskType.PERSISTENT)
                      .source(getDiskUrl(userProject.get(), ATTACH_DISK_NAME))
                      .mode(DiskMode.READ_ONLY)
                      .deviceName(ATTACH_DISK_DEVICE_NAME)),
              TIME_WAIT);
View Full Code Here

   public void testAttachDiskToInstance() {
      assertZoneOperationDoneSucessfully(diskApi().createInZone(ATTACH_DISK_NAME, 1, DEFAULT_ZONE_NAME), TIME_WAIT);

      Instance originalInstance = api().getInZone(DEFAULT_ZONE_NAME, INSTANCE_NAME);
      assertZoneOperationDoneSucessfully(api().attachDiskInZone(DEFAULT_ZONE_NAME, INSTANCE_NAME,
              new AttachDiskOptions().type(DiskType.PERSISTENT)
                      .source(getDiskUrl(userProject.get(), ATTACH_DISK_NAME))
                      .mode(DiskMode.READ_ONLY)
                      .deviceName(ATTACH_DISK_DEVICE_NAME)),
              TIME_WAIT);
View Full Code Here

      InstanceApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
              TOKEN_RESPONSE, attach, attachResponse).getInstanceApiForProject("myproject");

      assertEquals(api.attachDiskInZone("us-central1-a", "test-1",
              new AttachDiskOptions()
                      .mode(DiskMode.READ_ONLY)
                      .source(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1"))
                      .type(DiskType.PERSISTENT)),
              new ParseOperationTest().expected());
   }
View Full Code Here

      InstanceApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE),
              TOKEN_RESPONSE, attach, attachResponse).getInstanceApiForProject("myproject");

      assertNull(api.attachDiskInZone("us-central1-a", "test-1",
              new AttachDiskOptions()
                      .mode(DiskMode.READ_ONLY)
                      .source(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1"))
                      .type(DiskType.PERSISTENT)));

   }
View Full Code Here

TOP

Related Classes of org.jclouds.googlecomputeengine.options.AttachDiskOptions

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.