Package org.jclouds.googlecomputeengine.domain

Examples of org.jclouds.googlecomputeengine.domain.Operation$Error$Builder


      assertNotNull(deleteOperation);
   }

   @Test(groups = "live", dependsOnMethods = "testCreateOperations")
   public void testGetOperation() {
      Operation operation = api().getInZone(DEFAULT_ZONE_NAME, addOperation.getName());
      assertNotNull(operation);
      assertOperationEquals(operation, this.addOperation);
   }
View Full Code Here


      instanceTemplate.metadata(metadataBuilder.build());
      instanceTemplate.serviceAccounts(options.getServiceAccounts());

      final InstanceApi instanceApi = api.getInstanceApiForProject(userProject.get());
      final String zone = template.getLocation().getId();
      Operation operation = instanceApi.createInZone(name, zone, instanceTemplate);

      if (options.shouldBlockUntilRunning()) {
         waitOperationDone(operation);
      }

      // some times the newly created instances are not immediately returned
      AtomicReference<Instance> instance = Atomics.newReference();

      retry(new Predicate<AtomicReference<Instance>>() {
         @Override
         public boolean apply(AtomicReference<Instance> input) {
            input.set(instanceApi.getInZone(zone, name));
            return input.get() != null;
         }
      }, operationCompleteCheckTimeout, operationCompleteCheckInterval, MILLISECONDS).apply(instance);

      if (!options.getTags().isEmpty()) {
         Operation tagsOperation = instanceApi.setTagsInZone(zone,
                 name, options.getTags(), instance.get().getTags().getFingerprint());

         waitOperationDone(tagsOperation);

         retry(new Predicate<AtomicReference<Instance>>() {
View Full Code Here

      int diskSize = options.getBootDiskSize().or(10l).intValue();

      String diskName = instanceName + "-" + GCE_BOOT_DISK_SUFFIX;

      Operation diskOperation = api.getDiskApiForProject(userProject.get())
                                   .createFromImageWithSizeInZone(imageUri.toString(),
                                                                  diskName,
                                                                  diskSize,
                                                                  template.getLocation().getId());
View Full Code Here

   }

   @Override
   public boolean apply(AtomicReference<Operation> input) {
      checkNotNull(input, "input");
      Operation current = api.getZoneOperationApiForProject(project.get())
              .getInZone(zones.get().get(input.get().getZone().get()).getId(),
                      input.get().getName());
      switch (current.getStatus()) {
         case DONE:
            input.set(current);
            return true;
         case PENDING:
         case RUNNING:
View Full Code Here

   }

   @Override
   public boolean apply(AtomicReference<Operation> input) {
      checkNotNull(input, "input");
      Operation current = api.getGlobalOperationApiForProject(project.get()).get(input.get().getName());
      switch (current.getStatus()) {
         case DONE:
            input.set(current);
            return true;
         case PENDING:
         case RUNNING:
View Full Code Here

   @Override
   public boolean apply(AtomicReference<Operation> input) {
      checkNotNull(input, "input");

      Operation current = api.getRegionOperationApiForProject(project.get())
              .getInRegion(regions.get().get(input.get().getRegion().get()).getName(),
              input.get().getName());
      switch (current.getStatus()) {
         case DONE:
            input.set(current);
            return true;
         case PENDING:
         case RUNNING:
View Full Code Here

TOP

Related Classes of org.jclouds.googlecomputeengine.domain.Operation$Error$Builder

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.