diff --git a/providers/google-compute-engine/pom.xml b/providers/google-compute-engine/pom.xml index f440a0f136..9edc75e1e9 100644 --- a/providers/google-compute-engine/pom.xml +++ b/providers/google-compute-engine/pom.xml @@ -37,9 +37,9 @@ Private key (PKCS12 file) associated with the Google API client_id - v1beta16 + v1 - osFamily=GCEL,osVersionMatches=1[012].[01][04],locationId=us-central1-a,minRam=2048 + imageId=debian-7-wheezy-v20131120,locationId=us-central1-a,minRam=2048 diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java index 6589c4d30b..6918d279f1 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApi.java @@ -27,7 +27,6 @@ import org.jclouds.googlecomputeengine.features.FirewallApi; import org.jclouds.googlecomputeengine.features.GlobalOperationApi; import org.jclouds.googlecomputeengine.features.ImageApi; import org.jclouds.googlecomputeengine.features.InstanceApi; -import org.jclouds.googlecomputeengine.features.KernelApi; import org.jclouds.googlecomputeengine.features.MachineTypeApi; import org.jclouds.googlecomputeengine.features.NetworkApi; import org.jclouds.googlecomputeengine.features.ProjectApi; @@ -47,7 +46,7 @@ import com.google.common.annotations.Beta; *

* * @author David Alves - * @see api doc + * @see api doc */ @Beta public interface GoogleComputeEngineApi extends Closeable { @@ -106,15 +105,6 @@ public interface GoogleComputeEngineApi extends Closeable { @Path("/projects/{project}") InstanceApi getInstanceApiForProject(@PathParam("project") String projectName); - /** - * Provides access to Kernel features - * - * @param projectName the name of the project - */ - @Delegate - @Path("/projects/{project}") - KernelApi getKernelApiForProject(@PathParam("project") String projectName); - /** * Provides access to MachineType features * diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java index 564f869f3d..d6bb755669 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java @@ -40,7 +40,7 @@ import com.google.common.collect.ImmutableSet; import com.google.inject.Module; /** - * Implementation of {@link ApiMetadata} for GoogleCompute v1beta16 API + * Implementation of {@link ApiMetadata} for GoogleCompute v1 API * * @author David Alves */ @@ -80,8 +80,8 @@ public class GoogleComputeEngineApiMetadata extends BaseHttpApiMetadata>builder() diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java index 1334a32a17..0bf6b6f515 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineConstants.java @@ -34,6 +34,10 @@ public interface GoogleComputeEngineConstants { */ public static final String GOOGLE_PROJECT = "google"; + public static final String CENTOS_PROJECT = "centos-cloud"; + + public static final String DEBIAN_PROJECT = "debian-cloud"; + public static final String COMPUTE_SCOPE = "https://www.googleapis.com/auth/compute"; public static final String COMPUTE_READONLY_SCOPE = "https://www.googleapis.com/auth/compute.readonly"; @@ -58,4 +62,19 @@ public interface GoogleComputeEngineConstants { public static final Location GOOGLE_PROVIDER_LOCATION = new LocationBuilder().scope(LocationScope.PROVIDER).id (GCE_PROVIDER_NAME).description(GCE_PROVIDER_NAME).build(); + + /** + * The key we look for in instance metadata for the URI for the image the instance was created from. + */ + public static final String GCE_IMAGE_METADATA_KEY = "jclouds-image"; + + /** + * Metadata key to check for whether we should delete an instance's boot disk when we delete the instance. + */ + public static final String GCE_DELETE_BOOT_DISK_METADATA_KEY = "jclouds-delete-boot-disk"; + + /** + * The suffix we append to auto-created boot disk names. + */ + public static final String GCE_BOOT_DISK_SUFFIX = "boot-disk"; } diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java index f4495c0b29..62d3914d32 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceAdapter.java @@ -20,14 +20,21 @@ import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import static com.google.common.collect.Iterables.contains; import static com.google.common.collect.Iterables.filter; +import static com.google.common.collect.Iterables.tryFind; import static java.util.concurrent.TimeUnit.MILLISECONDS; -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GOOGLE_PROJECT; +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.CENTOS_PROJECT; +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.DEBIAN_PROJECT; +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_BOOT_DISK_SUFFIX; +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_DELETE_BOOT_DISK_METADATA_KEY; +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_IMAGE_METADATA_KEY; import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_INTERVAL; import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.OPERATION_COMPLETE_TIMEOUT; import static org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig.Type; +import static org.jclouds.googlecomputeengine.predicates.InstancePredicates.isBootDisk; import static org.jclouds.util.Predicates2.retry; import java.net.URI; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; @@ -36,7 +43,6 @@ import java.util.concurrent.atomic.AtomicReference; import javax.annotation.Resource; import javax.inject.Named; -import com.google.common.primitives.Ints; import org.jclouds.collect.Memoized; import org.jclouds.compute.ComputeServiceAdapter; import org.jclouds.compute.domain.Hardware; @@ -49,10 +55,15 @@ import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; import org.jclouds.googlecomputeengine.compute.functions.FirewallTagNamingConvention; import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions; import org.jclouds.googlecomputeengine.config.UserProject; +import org.jclouds.googlecomputeengine.domain.Disk; import org.jclouds.googlecomputeengine.domain.Image; import org.jclouds.googlecomputeengine.domain.Instance; +import org.jclouds.googlecomputeengine.domain.Instance.AttachedDisk; +import org.jclouds.googlecomputeengine.domain.Instance.PersistentAttachedDisk; import org.jclouds.googlecomputeengine.domain.InstanceInZone; import org.jclouds.googlecomputeengine.domain.InstanceTemplate; +import org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk; +import org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk.Mode; import org.jclouds.googlecomputeengine.domain.MachineType; import org.jclouds.googlecomputeengine.domain.MachineTypeInZone; import org.jclouds.googlecomputeengine.domain.Operation; @@ -64,11 +75,14 @@ import org.jclouds.logging.Logger; import com.google.common.base.Function; import com.google.common.base.Objects; +import com.google.common.base.Optional; import com.google.common.base.Predicate; import com.google.common.base.Supplier; import com.google.common.collect.FluentIterable; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.primitives.Ints; import com.google.common.util.concurrent.Atomics; import com.google.common.util.concurrent.UncheckedTimeoutException; import com.google.inject.Inject; @@ -85,7 +99,6 @@ public class GoogleComputeEngineServiceAdapter implements ComputeServiceAdapter< private final GoogleComputeEngineApi api; private final Supplier userProject; private final Supplier> zones; - private final Supplier> hardwareMap; private final Function> metatadaFromTemplateOptions; private final Predicate> retryOperationDonePredicate; private final long operationCompleteCheckInterval; @@ -101,7 +114,6 @@ public class GoogleComputeEngineServiceAdapter implements ComputeServiceAdapter< @Named(OPERATION_COMPLETE_INTERVAL) Long operationCompleteCheckInterval, @Named(OPERATION_COMPLETE_TIMEOUT) Long operationCompleteCheckTimeout, @Memoized Supplier> zones, - @Memoized Supplier> hardwareMap, FirewallTagNamingConvention.Factory firewallTagNamingConvention) { this.api = checkNotNull(api, "google compute api"); this.userProject = checkNotNull(userProject, "user project name"); @@ -110,11 +122,10 @@ public class GoogleComputeEngineServiceAdapter implements ComputeServiceAdapter< this.operationCompleteCheckInterval = checkNotNull(operationCompleteCheckInterval, "operation completed check interval"); this.operationCompleteCheckTimeout = checkNotNull(operationCompleteCheckTimeout, - "operation completed check timeout"); + "operation completed check timeout"); this.retryOperationDonePredicate = retry(operationDonePredicate, operationCompleteCheckTimeout, - operationCompleteCheckInterval, TimeUnit.MILLISECONDS); + operationCompleteCheckInterval, TimeUnit.MILLISECONDS); this.zones = checkNotNull(zones, "zones"); - this.hardwareMap = checkNotNull(hardwareMap, "hardwareMap"); this.firewallTagNamingConvention = checkNotNull(firewallTagNamingConvention, "firewallTagNamingConvention"); } @@ -129,6 +140,22 @@ public class GoogleComputeEngineServiceAdapter implements ComputeServiceAdapter< Hardware hardware = checkNotNull(template.getHardware(), "hardware must be set"); checkNotNull(hardware.getUri(), "hardware must have a URI"); + checkNotNull(template.getImage().getUri(), "image URI is null"); + + // Note that the ordering is significant here - the first disk must be the boot disk. + List disks = Lists.newArrayList(); + + if (!tryFind(options.getDisks(), isBootDisk()).isPresent()) { + Disk bootDisk = createBootDisk(template, name); + + disks.add(new PersistentDisk(Mode.READ_WRITE, + bootDisk.getSelfLink(), + null, + true, + true)); + } + + disks.addAll(options.getDisks()); InstanceTemplate instanceTemplate = InstanceTemplate.builder() .forMachineType(hardware.getUri()); @@ -139,12 +166,20 @@ public class GoogleComputeEngineServiceAdapter implements ComputeServiceAdapter< instanceTemplate.addNetworkInterface(options.getNetwork().get()); } + instanceTemplate.disks(disks); + LoginCredentials credentials = getFromImageAndOverrideIfRequired(template.getImage(), options); ImmutableMap.Builder metadataBuilder = metatadaFromTemplateOptions.apply(options); + + metadataBuilder.put(GCE_IMAGE_METADATA_KEY, template.getImage().getUri().toString()); + + if (!options.shouldKeepBootDisk()) { + metadataBuilder.put(GCE_DELETE_BOOT_DISK_METADATA_KEY, Boolean.TRUE.toString()); + } + instanceTemplate.metadata(metadataBuilder.build()); instanceTemplate.serviceAccounts(options.getServiceAccounts()); - instanceTemplate.image(checkNotNull(template.getImage().getUri(), "image URI is null")); final InstanceApi instanceApi = api.getInstanceApiForProject(userProject.get()); final String zone = template.getLocation().getId(); @@ -199,6 +234,26 @@ public class GoogleComputeEngineServiceAdapter implements ComputeServiceAdapter< return new NodeAndInitialCredentials(instanceInZone, instanceInZone.slashEncode(), credentials); } + private Disk createBootDisk(Template template, String instanceName) { + URI imageUri = template.getImage().getUri(); + + GoogleComputeEngineTemplateOptions options = GoogleComputeEngineTemplateOptions.class.cast(template.getOptions()).clone(); + + 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()); + + waitOperationDone(diskOperation); + + return api.getDiskApiForProject(userProject.get()).getInZone(template.getLocation().getId(), + diskName); + } @Override public Iterable listHardwareProfiles() { @@ -224,14 +279,17 @@ public class GoogleComputeEngineServiceAdapter implements ComputeServiceAdapter< public Iterable listImages() { return ImmutableSet.builder() .addAll(api.getImageApiForProject(userProject.get()).list().concat()) - .addAll(api.getImageApiForProject(GOOGLE_PROJECT).list().concat()) + .addAll(api.getImageApiForProject(DEBIAN_PROJECT).list().concat()) + .addAll(api.getImageApiForProject(CENTOS_PROJECT).list().concat()) .build(); } @Override public Image getImage(String id) { return Objects.firstNonNull(api.getImageApiForProject(userProject.get()).get(id), - api.getImageApiForProject(GOOGLE_PROJECT).get(id)); + Objects.firstNonNull(api.getImageApiForProject(DEBIAN_PROJECT).get(id), + api.getImageApiForProject(CENTOS_PROJECT).get(id))); + } @Override @@ -280,9 +338,33 @@ public class GoogleComputeEngineServiceAdapter implements ComputeServiceAdapter< @Override public void destroyNode(final String name) { SlashEncodedIds slashEncodedIds = SlashEncodedIds.fromSlashEncoded(name); - + String diskName = null; + try { + Instance instance = api.getInstanceApiForProject(userProject.get()).getInZone(slashEncodedIds.getFirstId(), + slashEncodedIds.getSecondId()); + if (instance.getMetadata().getItems().get(GCE_DELETE_BOOT_DISK_METADATA_KEY).equals("true")) { + Optional disk = tryFind(instance.getDisks(), new Predicate() { + @Override + public boolean apply(AttachedDisk input) { + return PersistentAttachedDisk.class.isInstance(input) && + PersistentAttachedDisk.class.cast(input).isBoot(); + } + }); + if (disk.isPresent()) { + diskName = PersistentAttachedDisk.class.cast(disk.get()).getSourceDiskName(); + } + } + } catch (Exception e) { + // TODO: what exception actually gets thrown here if the instance doesn't really exist? + } waitOperationDone(api.getInstanceApiForProject(userProject.get()).deleteInZone(slashEncodedIds.getFirstId(), slashEncodedIds.getSecondId())); + + if (diskName != null) { + waitOperationDone(api.getDiskApiForProject(userProject.get()).deleteInZone(slashEncodedIds.getFirstId(), + diskName)); + } + } @Override diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceInZoneToNodeMetadata.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceInZoneToNodeMetadata.java index 98b9a149e6..4c4c60044a 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceInZoneToNodeMetadata.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/functions/InstanceInZoneToNodeMetadata.java @@ -18,6 +18,7 @@ package org.jclouds.googlecomputeengine.compute.functions; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.compute.util.ComputeServiceUtils.groupFromMapOrName; +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_IMAGE_METADATA_KEY; import java.net.URI; import java.util.Map; @@ -32,6 +33,8 @@ import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.domain.NodeMetadataBuilder; import org.jclouds.compute.functions.GroupNamingConvention; import org.jclouds.domain.Location; +import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; +import org.jclouds.googlecomputeengine.config.UserProject; import org.jclouds.googlecomputeengine.domain.Instance; import org.jclouds.googlecomputeengine.domain.InstanceInZone; import org.jclouds.googlecomputeengine.domain.SlashEncodedIds; @@ -55,6 +58,8 @@ public class InstanceInZoneToNodeMetadata implements Function> hardwares; private final Supplier> locations; private final FirewallTagNamingConvention.Factory firewallTagNamingConvention; + private final GoogleComputeEngineApi api; + private final Supplier userProject; @Inject public InstanceInZoneToNodeMetadata(Map toPortableNodeStatus, @@ -62,47 +67,64 @@ public class InstanceInZoneToNodeMetadata implements Function> images, @Memoized Supplier> hardwares, @Memoized Supplier> locations, - FirewallTagNamingConvention.Factory firewallTagNamingConvention) { + FirewallTagNamingConvention.Factory firewallTagNamingConvention, + GoogleComputeEngineApi api, + @UserProject Supplier userProject) { this.toPortableNodeStatus = toPortableNodeStatus; this.nodeNamingConvention = namingConvention.createWithoutPrefix(); this.images = images; this.hardwares = hardwares; this.locations = locations; this.firewallTagNamingConvention = checkNotNull(firewallTagNamingConvention, "firewallTagNamingConvention"); + this.api = checkNotNull(api, "api"); + this.userProject = checkNotNull(userProject, "userProject"); } @Override public NodeMetadata apply(InstanceInZone instanceInZone) { Instance input = instanceInZone.getInstance(); - Map imagesMap = images.get(); - Image image = checkNotNull(imagesMap.get(checkNotNull(input.getImage(), "image")), - "no image for %s. images: %s", input.getImage(), imagesMap.values()); String group = groupFromMapOrName(input.getMetadata().getItems(), - input.getName(), nodeNamingConvention); - + input.getName(), nodeNamingConvention); FluentIterable tags = FluentIterable.from(input.getTags().getItems()) - .filter(Predicates.not(firewallTagNamingConvention.get(group).isFirewallTag())); + .filter(Predicates.not(firewallTagNamingConvention.get(group).isFirewallTag())); - return new NodeMetadataBuilder() - .id(SlashEncodedIds.fromTwoIds(checkNotNull(locations.get().get(input.getZone()), "location for %s", input.getZone()).getId(), - input.getName()).slashEncode()) + NodeMetadataBuilder builder = new NodeMetadataBuilder(); + + builder.id(SlashEncodedIds.fromTwoIds(checkNotNull(locations.get().get(input.getZone()), + "location for %s", input.getZone()) + .getId(), input.getName()).slashEncode()) .name(input.getName()) .providerId(input.getId()) .hostname(input.getName()) - .imageId(image.getId()) .location(checkNotNull(locations.get().get(input.getZone()), "location for %s", input.getZone())) .hardware(checkNotNull(hardwares.get().get(input.getMachineType()), "hardware type for %s", - input.getMachineType().toString())) - .operatingSystem(image.getOperatingSystem()) + input.getMachineType().toString())) .status(toPortableNodeStatus.get(input.getStatus())) .tags(tags) .uri(input.getSelfLink()) .userMetadata(input.getMetadata().getItems()) .group(group) .privateAddresses(collectPrivateAddresses(input)) - .publicAddresses(collectPublicAddresses(input)) - .build(); + .publicAddresses(collectPublicAddresses(input)); + + if (input.getMetadata().getItems().containsKey(GCE_IMAGE_METADATA_KEY)) { + try { + URI imageUri = URI.create(input.getMetadata().getItems() + .get(GCE_IMAGE_METADATA_KEY)); + + Map imagesMap = images.get(); + + Image image = checkNotNull(imagesMap.get(imageUri), + "no image for %s. images: %s", imageUri, + imagesMap.values()); + builder.imageId(image.getId()); + } catch (IllegalArgumentException e) { + // Swallow any exception here - it just means we don't actually have a valid image URI, so we skip it. + } + } + + return builder.build(); } private Set collectPrivateAddresses(Instance input) { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/options/GoogleComputeEngineTemplateOptions.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/options/GoogleComputeEngineTemplateOptions.java index 04ebaf4658..63e3685c2a 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/options/GoogleComputeEngineTemplateOptions.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/compute/options/GoogleComputeEngineTemplateOptions.java @@ -26,6 +26,7 @@ import java.util.Set; import org.jclouds.compute.options.TemplateOptions; import org.jclouds.domain.LoginCredentials; import org.jclouds.googlecomputeengine.domain.Instance; +import org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk; import org.jclouds.scriptbuilder.domain.Statement; import com.google.common.base.Optional; @@ -42,6 +43,9 @@ public class GoogleComputeEngineTemplateOptions extends TemplateOptions { private Optional networkName = Optional.absent(); private Set serviceAccounts = Sets.newLinkedHashSet(); private boolean enableNat = true; + private Set disks = Sets.newLinkedHashSet(); + private Optional bootDiskSize = Optional.absent(); + private boolean keepBootDisk = false; @Override public GoogleComputeEngineTemplateOptions clone() { @@ -59,6 +63,8 @@ public class GoogleComputeEngineTemplateOptions extends TemplateOptions { eTo.network(getNetworkName().orNull()); eTo.serviceAccounts(getServiceAccounts()); eTo.enableNat(isEnableNat()); + eTo.disks(getDisks()); + eTo.keepBootDisk(shouldKeepBootDisk()); } } @@ -96,6 +102,24 @@ public class GoogleComputeEngineTemplateOptions extends TemplateOptions { return this; } + /** + * @see #getDisks() + * @see org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk + */ + public GoogleComputeEngineTemplateOptions addDisk(PersistentDisk disk) { + this.disks.add(disk); + return this; + } + + /** + * @see #getDisks() + * @see org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk + */ + public GoogleComputeEngineTemplateOptions disks(Set disks) { + this.disks = Sets.newLinkedHashSet(disks); + return this; + } + /** * @see #isEnableNat() */ @@ -104,6 +128,22 @@ public class GoogleComputeEngineTemplateOptions extends TemplateOptions { return this; } + /** + * @see #getBootDiskSize() + */ + public GoogleComputeEngineTemplateOptions bootDiskSize(Long bootDiskSize) { + this.bootDiskSize = fromNullable(bootDiskSize); + return this; + } + + /** + * @see #shouldKeepBootDisk() + */ + public GoogleComputeEngineTemplateOptions keepBootDisk(boolean keepBootDisk) { + this.keepBootDisk = keepBootDisk; + return this; + } + /** * {@inheritDoc} */ @@ -279,6 +319,13 @@ public class GoogleComputeEngineTemplateOptions extends TemplateOptions { return serviceAccounts; } + /** + * @return the PersistentDisks for this instance. + */ + public Set getDisks() { + return disks; + } + /** * @return the URI of an existing network the instances will be attached to. If no network URI or network name are * provided a new network will be created for the project. @@ -302,4 +349,18 @@ public class GoogleComputeEngineTemplateOptions extends TemplateOptions { public boolean isEnableNat() { return enableNat; } + + /** + * @return the boot disk size, if specified. Defaults to 10gb. + */ + public Optional getBootDiskSize() { + return bootDiskSize; + } + + /** + * @return whether we should keep the boot disk around when deleting the instance. Defaults to false. + */ + public boolean shouldKeepBootDisk() { + return keepBootDisk; + } } diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineParserModule.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineParserModule.java index 6dc0160dfa..2f5f644449 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineParserModule.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/config/GoogleComputeEngineParserModule.java @@ -87,7 +87,7 @@ public class GoogleComputeEngineParserModule extends AbstractModule { /** * Parser for operations that unwraps errors avoiding an extra intermediate object. * - * @see + * @see */ @Singleton private static class OperationTypeAdapter implements JsonDeserializer { @@ -208,14 +208,14 @@ public class GoogleComputeEngineParserModule extends AbstractModule { private static class InstanceInternal extends Instance { @ConstructorProperties({ - "id", "creationTimestamp", "selfLink", "name", "description", "tags", "image", "machineType", + "id", "creationTimestamp", "selfLink", "name", "description", "tags", "machineType", "status", "statusMessage", "zone", "networkInterfaces", "metadata", "serviceAccounts" }) private InstanceInternal(String id, Date creationTimestamp, URI selfLink, String name, String description, - Tags tags, URI image, URI machineType, Status status, String statusMessage, + Tags tags, URI machineType, Status status, String statusMessage, URI zone, Set networkInterfaces, Metadata metadata, Set serviceAccounts) { - super(id, creationTimestamp, selfLink, name, description, tags, image, machineType, + super(id, creationTimestamp, selfLink, name, description, tags, machineType, status, statusMessage, zone, networkInterfaces, null, metadata, serviceAccounts); } } diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/AbstractDisk.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/AbstractDisk.java index 44e13a24f2..045846b746 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/AbstractDisk.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/AbstractDisk.java @@ -28,7 +28,7 @@ import com.google.common.base.Objects; * A persistent disk resource * * @author David Alves - * @see + * @see */ @Beta public abstract class AbstractDisk extends Resource { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Address.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Address.java index 03e6fabd17..86dde18184 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Address.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Address.java @@ -32,7 +32,7 @@ import com.google.common.base.Optional; * Represents an Address resource. * * @author Andrew Bayer - * @see + * @see */ @Beta public final class Address extends Resource { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java index a986eba5e0..15ecf691dc 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Disk.java @@ -30,7 +30,7 @@ import com.google.common.base.Objects; * A persistent disk resource * * @author David Alves - * @see + * @see */ @Beta public final class Disk extends AbstractDisk { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java index 42d66cff11..64c92219e8 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Firewall.java @@ -40,7 +40,7 @@ import com.google.common.collect.TreeRangeSet; * Represents a network firewall * * @author David Alves - * @see + * @see * @see */ @Beta @@ -243,7 +243,7 @@ public final class Firewall extends Resource { * permitted connection. * * @author David Alves - * @see + * @see */ public static final class Rule { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java index b48afeeb16..0c05cc6deb 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Image.java @@ -33,25 +33,23 @@ import com.google.common.base.Optional; * Represents a disk image to use on an instance. * * @author David Alves - * @see + * @see */ @Beta public final class Image extends Resource { private final String sourceType; - private final Optional preferredKernel; private final RawDisk rawDisk; private final Optional deprecated; @ConstructorProperties({ - "id", "creationTimestamp", "selfLink", "name", "description", "sourceType", "preferredKernel", + "id", "creationTimestamp", "selfLink", "name", "description", "sourceType", "rawDisk", "deprecated" }) protected Image(String id, Date creationTimestamp, URI selfLink, String name, String description, - String sourceType, URI preferredKernel, RawDisk rawDisk, Deprecated deprecated) { + String sourceType, RawDisk rawDisk, Deprecated deprecated) { super(Kind.IMAGE, id, creationTimestamp, selfLink, name, description); this.sourceType = checkNotNull(sourceType, "sourceType of %s", name); - this.preferredKernel = fromNullable(preferredKernel); this.rawDisk = checkNotNull(rawDisk, "rawDisk of %s", name); this.deprecated = fromNullable(deprecated); } @@ -63,13 +61,6 @@ public final class Image extends Resource { return sourceType; } - /** - * @return An optional URL of the preferred kernel for use with this disk image. - */ - public Optional getPreferredKernel() { - return preferredKernel; - } - /** * @return the raw disk image parameters. */ @@ -91,7 +82,6 @@ public final class Image extends Resource { return super.string() .omitNullValues() .add("sourceType", sourceType) - .add("preferredKernel", preferredKernel.orNull()) .add("rawDisk", rawDisk) .add("deprecated", deprecated.orNull()); } @@ -115,7 +105,6 @@ public final class Image extends Resource { public static final class Builder extends Resource.Builder { private String sourceType; - private URI preferredKernel; private RawDisk rawDisk; private Deprecated deprecated; @@ -127,14 +116,6 @@ public final class Image extends Resource { return this; } - /** - * @see Image#getPreferredKernel() - */ - public Builder preferredKernel(URI preferredKernel) { - this.preferredKernel = preferredKernel; - return this; - } - /** * @see Image#getDeprecated() */ @@ -158,13 +139,12 @@ public final class Image extends Resource { public Image build() { return new Image(super.id, super.creationTimestamp, super.selfLink, super.name, - super.description, sourceType, preferredKernel, rawDisk, deprecated); + super.description, sourceType, rawDisk, deprecated); } public Builder fromImage(Image in) { return super.fromResource(in) .sourceType(in.getSourceType()) - .preferredKernel(in.getPreferredKernel().orNull()) .rawDisk(in.getRawDisk()) .deprecated(in.getDeprecated().orNull()); } @@ -175,7 +155,7 @@ public final class Image extends Resource { * A raw disk image, usually the base for an image. * * @author David Alves - * @see + * @see */ public static class RawDisk { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java index 19c9e523dc..ee8f3561d1 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Instance.java @@ -20,6 +20,7 @@ import static com.google.common.base.Objects.equal; import static com.google.common.base.Objects.toStringHelper; import static com.google.common.base.Optional.fromNullable; import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.collect.Iterables.getLast; import java.beans.ConstructorProperties; import java.net.URI; @@ -31,13 +32,14 @@ import org.jclouds.javax.annotation.Nullable; import com.google.common.annotations.Beta; import com.google.common.base.Objects; import com.google.common.base.Optional; +import com.google.common.base.Splitter; import com.google.common.collect.ImmutableSet; /** * Represents a virtual machine. * * @author David Alves - * @see + * @see */ @Beta public class Instance extends Resource { @@ -52,7 +54,6 @@ public class Instance extends Resource { } protected final Tags tags; - protected final URI image; protected final URI machineType; protected final Status status; protected final Optional statusMessage; @@ -63,12 +64,11 @@ public class Instance extends Resource { protected final Set serviceAccounts; protected Instance(String id, Date creationTimestamp, URI selfLink, String name, String description, - Tags tags, URI image, URI machineType, Status status, String statusMessage, + Tags tags, URI machineType, Status status, String statusMessage, URI zone, Set networkInterfaces, Set disks, Metadata metadata, Set serviceAccounts) { super(Kind.INSTANCE, id, creationTimestamp, selfLink, name, description); this.tags = checkNotNull(tags, "tags"); - this.image = checkNotNull(image, "image"); this.machineType = checkNotNull(machineType, "machineType of %s", name); this.status = checkNotNull(status, "status"); this.statusMessage = fromNullable(statusMessage); @@ -89,13 +89,6 @@ public class Instance extends Resource { return tags; } - /** - * @return the URL of the disk image resource to be to be installed on this instance. - */ - public URI getImage() { - return image; - } - /** * @return URL of the machine type resource describing which machine type to use to host the instance. */ @@ -178,7 +171,6 @@ public class Instance extends Resource { return super.string() .omitNullValues() .add("items", tags) - .add("image", image) .add("machineType", machineType) .add("status", status) .add("statusMessage", statusMessage.orNull()) @@ -208,7 +200,6 @@ public class Instance extends Resource { public static final class Builder extends Resource.Builder { private Tags tags; - private URI image; private URI machineType; private Status status; private String statusMessage; @@ -227,14 +218,6 @@ public class Instance extends Resource { return this; } - /** - * @see Instance#getImage() - */ - public Builder image(URI image) { - this.image = image; - return this; - } - /** * @see Instance#getMachineType() */ @@ -331,14 +314,13 @@ public class Instance extends Resource { public Instance build() { return new Instance(super.id, super.creationTimestamp, super.selfLink, super.name, - super.description, tags, image, machineType, status, statusMessage, zone, + super.description, tags, machineType, status, statusMessage, zone, networkInterfaces.build(), disks.build(), metadata, serviceAccounts.build()); } public Builder fromInstance(Instance in) { return super.fromResource(in) .tags(in.getTags()) - .image(in.getImage()) .machineType(in.getMachineType()) .status(in.getStatus()) .statusMessage(in.getStatusMessage().orNull()) @@ -469,7 +451,7 @@ public class Instance extends Resource { /** * A disk attached to an Instance. * - * @see + * @see */ public static class AttachedDisk { @@ -537,20 +519,23 @@ public class Instance extends Resource { READ_ONLY; } - @ConstructorProperties({"mode", "source", "deviceName", "index", "deleteOnTerminate"}) + @ConstructorProperties({"mode", "source", "deviceName", "index", "deleteOnTerminate", + "boot"}) public PersistentAttachedDisk(Mode mode, URI source, String deviceName, Integer index, - boolean deleteOnTerminate) { + boolean deleteOnTerminate, boolean boot) { super(index); this.mode = checkNotNull(mode, "mode"); this.source = checkNotNull(source, "source"); this.deviceName = fromNullable(deviceName); this.deleteOnTerminate = deleteOnTerminate; + this.boot = boot; } private final Mode mode; private final URI source; private final boolean deleteOnTerminate; private final Optional deviceName; + private final boolean boot; @Override public boolean isPersistent() { @@ -571,6 +556,13 @@ public class Instance extends Resource { return source; } + /** + * @return the Name of the persistent disk resource + */ + public String getSourceDiskName() { + return getLast(Splitter.on("/").split(source.toString()), null); + } + /** * @return Must be unique within the instance when specified. This represents a unique * device name that is reflected into the /dev/ tree of a Linux operating system running within the @@ -588,10 +580,25 @@ public class Instance extends Resource { return deleteOnTerminate; } + /** + * @return If true, this is the boot disk for this instance. + */ + public boolean isBoot() { + return boot; + } + public static Builder builder() { return new Builder(); } + /** + * {@inheritDoc} + */ + protected Objects.ToStringHelper string() { + return toStringHelper(this).add("boot", boot); + } + + public static final class Builder { private Mode mode; @@ -599,6 +606,7 @@ public class Instance extends Resource { private String deviceName; private Integer index; private boolean deleteOnTerminate; + private boolean boot; /** * @see org.jclouds.googlecomputeengine.domain.Instance.PersistentAttachedDisk#getMode() @@ -640,9 +648,17 @@ public class Instance extends Resource { return this; } + /** + * @see org.jclouds.googlecomputeengine.domain.Instance.PersistentAttachedDisk#isBoot() + */ + public Builder boot(Boolean boot) { + this.boot = boot; + return this; + } + public PersistentAttachedDisk build() { return new PersistentAttachedDisk(this.mode, this.source, this.deviceName, this.index, - this.deleteOnTerminate); + this.deleteOnTerminate, this.boot); } public Builder fromPersistentAttachedDisk(PersistentAttachedDisk in) { @@ -650,7 +666,8 @@ public class Instance extends Resource { .source(in.getSource()) .deviceName(in.getDeviceName().orNull()) .index(in.getIndex()) - .deleteOnTerminate(in.isDeleteOnTerminate()); + .deleteOnTerminate(in.isDeleteOnTerminate()) + .boot(in.isBoot()); } } } @@ -658,7 +675,7 @@ public class Instance extends Resource { /** * A network interface for an Instance. * - * @see + * @see */ public static final class NetworkInterface { @@ -952,7 +969,7 @@ public class Instance extends Resource { * The output of an instance's serial port; * * @author David Alves - * @see + * @see */ public static final class SerialPortOutput { @@ -1060,7 +1077,7 @@ public class Instance extends Resource { * A service account for which access tokens are to be made available to the instance through metadata queries. * * @author David Alves - * @see + * @see */ public static final class ServiceAccount { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/InstanceTemplate.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/InstanceTemplate.java index a8d52c2f76..328b0bc2bd 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/InstanceTemplate.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/InstanceTemplate.java @@ -21,11 +21,13 @@ import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.googlecomputeengine.domain.Instance.NetworkInterface.AccessConfig.Type; import java.net.URI; +import java.util.List; import java.util.Map; import java.util.Set; import com.google.common.base.Objects; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; @@ -42,7 +44,7 @@ public class InstanceTemplate { protected URI image; protected Set serviceAccounts = Sets.newLinkedHashSet(); - protected transient Set disks = Sets.newLinkedHashSet(); + protected transient List disks = Lists.newArrayList(); protected transient Set networkInterfaces = Sets.newLinkedHashSet(); protected transient Map metadata = Maps.newLinkedHashMap(); protected transient String machineTypeName; @@ -100,7 +102,15 @@ public class InstanceTemplate { * @see org.jclouds.googlecomputeengine.domain.Instance#getDisks() */ public InstanceTemplate addDisk(PersistentDisk.Mode mode, URI source) { - this.disks.add(new PersistentDisk(mode, source, null, null)); + this.disks.add(new PersistentDisk(mode, source, null, false, false)); + return this; + } + + /** + * @see org.jclouds.googlecomputeengine.domain.Instance#getDisks() + */ + public InstanceTemplate addDisk(PersistentDisk.Mode mode, URI source, Boolean deleteOnTerminate) { + this.disks.add(new PersistentDisk(mode, source, null, deleteOnTerminate, false)); return this; } @@ -108,15 +118,24 @@ public class InstanceTemplate { * @see org.jclouds.googlecomputeengine.domain.Instance#getDisks() */ public InstanceTemplate addDisk(PersistentDisk.Mode mode, URI source, String deviceName, Boolean deleteOnTerminate) { - this.disks.add(new PersistentDisk(mode, source, deviceName, deleteOnTerminate)); + this.disks.add(new PersistentDisk(mode, source, deviceName, deleteOnTerminate, false)); return this; } /** * @see org.jclouds.googlecomputeengine.domain.Instance#getDisks() */ - public InstanceTemplate disks(Set disks) { - this.disks = Sets.newLinkedHashSet(); + public InstanceTemplate addDisk(PersistentDisk.Mode mode, URI source, String deviceName, + Boolean deleteOnTerminate, Boolean boot) { + this.disks.add(new PersistentDisk(mode, source, deviceName, deleteOnTerminate, boot)); + return this; + } + + /** + * @see org.jclouds.googlecomputeengine.domain.Instance#getDisks() + */ + public InstanceTemplate disks(List disks) { + this.disks = Lists.newArrayList(); this.disks.addAll(checkNotNull(disks, "disks")); return this; } @@ -198,7 +217,7 @@ public class InstanceTemplate { /** * @see org.jclouds.googlecomputeengine.domain.Instance#getDisks() */ - public Set getDisks() { + public List getDisks() { return disks; } @@ -290,17 +309,20 @@ public class InstanceTemplate { READ_ONLY } - public PersistentDisk(Mode mode, URI source, String deviceName, Boolean deleteOnTerminate) { + public PersistentDisk(Mode mode, URI source, String deviceName, Boolean deleteOnTerminate, + Boolean boot) { this.mode = checkNotNull(mode, "mode"); this.source = checkNotNull(source, "source"); this.deviceName = deviceName; - this.deleteOnTerminate = deleteOnTerminate; + this.deleteOnTerminate = checkNotNull(deleteOnTerminate, "deleteOnTerminate"); + this.boot = checkNotNull(boot, "boot"); } private final Mode mode; private final URI source; private final Boolean deleteOnTerminate; private final String deviceName; + private final Boolean boot; /** * @return the mode in which to attach this disk, either READ_WRITE or READ_ONLY. @@ -332,6 +354,13 @@ public class InstanceTemplate { public boolean isDeleteOnTerminate() { return deleteOnTerminate; } + + /** + * @return If true, boot from this disk. + */ + public boolean isBoot() { + return boot; + } } public static class NetworkInterface { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Kernel.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Kernel.java deleted file mode 100644 index 127ebddbf6..0000000000 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Kernel.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.googlecomputeengine.domain; - -import static com.google.common.base.Optional.fromNullable; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.beans.ConstructorProperties; -import java.net.URI; -import java.util.Date; - -import com.google.common.annotations.Beta; -import com.google.common.base.Optional; - -/** - * Represents a kernel. - * - * @author David Alves - * @see - */ -@Beta -public final class Kernel extends Resource { - private final Optional deprecated; - - @ConstructorProperties({ - "id", "creationTimestamp", "selfLink", "name", "description", "deprecated" - }) - private Kernel(String id, Date creationTimestamp, URI selfLink, String name, String description, - Deprecated deprecated) { - super(Kind.KERNEL, id, creationTimestamp, selfLink, name, description); - this.deprecated = fromNullable(deprecated); - } - - /** - * @return the deprecation information for this kernel - */ - public Optional getDeprecated() { - return deprecated; - } - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromKernel(this); - } - - public static final class Builder extends Resource.Builder { - - private Deprecated deprecated; - - /** - * @see Kernel#getDeprecated() - */ - public Builder deprecated(Deprecated deprecated) { - this.deprecated = checkNotNull(deprecated, "deprecated"); - return this; - } - - @Override - protected Builder self() { - return this; - } - - public Kernel build() { - return new Kernel(super.id, super.creationTimestamp, super.selfLink, super.name, - super.description, deprecated); - } - - public Builder fromKernel(Kernel in) { - return super.fromResource(in) - .deprecated(in.getDeprecated().orNull()); - } - } - -} diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/MachineType.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/MachineType.java index 86b1a2ce0f..c18ec58752 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/MachineType.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/MachineType.java @@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableList; * Represents a machine type used to host an instance. * * @author David Alves - * @see + * @see */ @Beta public final class MachineType extends Resource { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Network.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Network.java index 2235873063..166fa89949 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Network.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Network.java @@ -32,7 +32,7 @@ import com.google.common.base.Optional; * Represents a network used to enable instance communication. * * @author David Alves - * @see + * @see */ @Beta public final class Network extends Resource { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Operation.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Operation.java index b3547ce195..ee292cd494 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Operation.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Operation.java @@ -38,7 +38,7 @@ import com.google.common.collect.ImmutableList; * Describes an operation being executed on some Resource * * @author David Alves - * @see + * @see */ @Beta public class Operation extends Resource { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Quota.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Quota.java index 7b036a06cd..3c171307c7 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Quota.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Quota.java @@ -27,7 +27,7 @@ import com.google.common.base.Objects.ToStringHelper; /** * Quotas assigned to a given project or region. * - * @see + * @see */ @Beta public class Quota { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Region.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Region.java index 4bd260b3f2..c8d80940eb 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Region.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Region.java @@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableSet; * Represents a region resource. * * @author David Alves - * @see + * @see */ @Beta public final class Region extends Resource { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Resource.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Resource.java index 8abb3813fd..98cb3685de 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Resource.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Resource.java @@ -57,8 +57,6 @@ public class Resource { OPERATION_LIST, INSTANCE, INSTANCE_LIST, - KERNEL, - KERNEL_LIST, MACHINE_TYPE, MACHINE_TYPE_LIST, PROJECT, diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Route.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Route.java index 73acd26cb5..a981b75627 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Route.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Route.java @@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableSet; * Represents a route resource. * * @author Andrew Bayer - * @see + * @see */ @Beta public final class Route extends Resource { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Snapshot.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Snapshot.java index 55280474c9..821eebb841 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Snapshot.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Snapshot.java @@ -31,7 +31,7 @@ import com.google.common.base.Optional; * A Persistent Disk Snapshot resource. * * @author Andrew Bayer - * @see + * @see */ @Beta public final class Snapshot extends AbstractDisk { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Zone.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Zone.java index c67222211e..1bf7df3273 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Zone.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/domain/Zone.java @@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableSet; * Represents a zone resource. * * @author David Alves - * @see + * @see */ @Beta public final class Zone extends Resource { @@ -182,7 +182,7 @@ public final class Zone extends Resource { * Scheduled maintenance windows for the zone. When the zone is in a maintenance window, * all resources which reside in the zone will be unavailable. * - * @see + * @see */ public static final class MaintenanceWindow { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java index 042fc593cd..abf08eb64a 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/AddressApi.java @@ -55,7 +55,7 @@ import org.jclouds.rest.binders.BindToJsonPayload; * Provides access to Addresses via their REST API. * * @author Andrew Bayer - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java index 5c49de1900..028edbc050 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/DiskApi.java @@ -55,7 +55,7 @@ import org.jclouds.rest.binders.BindToJsonPayload; * Provides access to Disks via their REST API. * * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) @@ -97,6 +97,50 @@ public interface DiskApi { @PayloadParam("sizeGb") int sizeGb, @PathParam("zone") String zone); + /** + * Creates a persistent disk resource from the specified image, in the specified project, + * specifying the size of the disk. + * + * @param sourceImage fully qualified URL for the image to be copied. + * @param diskName the name of disk. + * @param sizeGb the size of the disk + * @param zone the name of the zone where the disk is to be created. + * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to + * you, and look for the status field. + */ + @Named("Disks:insert") + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @Path("/zones/{zone}/disks") + @OAuthScopes({COMPUTE_SCOPE}) + @MapBinder(BindToJsonPayload.class) + Operation createFromImageWithSizeInZone(@QueryParam("sourceImage") String sourceImage, + @PayloadParam("name") String diskName, + @PayloadParam("sizeGb") int sizeGb, + @PathParam("zone") String zone); + + /** + * Creates a persistent disk resource from the specified image, in the specified project, + * with the default disk size. + * + * @param sourceImage fully qualified URL for the image to be copied. + * @param diskName the name of disk. + * @param zone the name of the zone where the disk is to be created. + * @return an Operation resource. To check on the status of an operation, poll the Operations resource returned to + * you, and look for the status field. + */ + @Named("Disks:insert") + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @Path("/zones/{zone}/disks") + @OAuthScopes({COMPUTE_SCOPE}) + @MapBinder(BindToJsonPayload.class) + Operation createFromImageInZone(@QueryParam("sourceImage") String sourceImage, + @PayloadParam("name") String diskName, + @PathParam("zone") String zone); + /** * Deletes the specified persistent disk resource. * diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java index df034e46b3..3b607e36a0 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/FirewallApi.java @@ -63,7 +63,7 @@ import org.jclouds.rest.binders.BindToJsonPayload; *

* * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/GlobalOperationApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/GlobalOperationApi.java index 7a9a5b48d2..fd0251a90a 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/GlobalOperationApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/GlobalOperationApi.java @@ -49,7 +49,7 @@ import org.jclouds.rest.annotations.Transform; * Provides access to Global Operations via their REST API. * * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java index ff55184b24..23d32510af 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ImageApi.java @@ -51,7 +51,7 @@ import org.jclouds.rest.annotations.Transform; *

* * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java index 88a4f83692..dbcc366a56 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/InstanceApi.java @@ -63,7 +63,7 @@ import org.jclouds.rest.binders.BindToJsonPayload; * Provides access to Instances via their REST API. * * @author David Alves - * @see + * @see * @see InstanceApi */ @SkipEncoding({'/', '='}) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/KernelApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/KernelApi.java deleted file mode 100644 index 99df99c0d0..0000000000 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/KernelApi.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.googlecomputeengine.features; - -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; - -import javax.inject.Named; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - -import org.jclouds.Fallbacks.EmptyIterableWithMarkerOnNotFoundOr404; -import org.jclouds.Fallbacks.EmptyPagedIterableOnNotFoundOr404; -import org.jclouds.Fallbacks.NullOnNotFoundOr404; -import org.jclouds.collect.PagedIterable; -import org.jclouds.googlecomputeengine.domain.Kernel; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.functions.internal.ParseKernels; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.oauth.v2.config.OAuthScopes; -import org.jclouds.oauth.v2.filters.OAuthAuthenticator; -import org.jclouds.rest.annotations.Fallback; -import org.jclouds.rest.annotations.RequestFilters; -import org.jclouds.rest.annotations.ResponseParser; -import org.jclouds.rest.annotations.SkipEncoding; -import org.jclouds.rest.annotations.Transform; - -/** - * Provides access to Kernels via their REST API. - * - * @author David Alves - * @see - */ -@SkipEncoding({'/', '='}) -@RequestFilters(OAuthAuthenticator.class) -@Consumes(MediaType.APPLICATION_JSON) -public interface KernelApi { - - /** - * Returns the specified kernel resource - * - * @param kernelName name of the kernel resource to return. - * @return If successful, this method returns a Kernel resource - */ - @Named("Kernels:get") - @GET - @Path("/global/kernels/{kernel}") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @Fallback(NullOnNotFoundOr404.class) - Kernel get(@PathParam("kernel") String kernelName); - - /** - * @see KernelApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Kernels:list") - @GET - @Path("/global/kernels") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseKernels.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage listFirstPage(); - - /** - * @see KernelApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Kernels:list") - @GET - @Path("/global/kernels") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseKernels.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage listAtMarker(@QueryParam("pageToken") @Nullable String marker); - - /** - * Retrieves the list of kernel resources available to the specified project. - * By default the list as a maximum size of 100, if no options are provided or ListOptions#getMaxResults() has not - * been set. - * - * @param marker marks the beginning of the next list page - * @param listOptions listing options - * @return a page of the list - * @see ListOptions - * @see org.jclouds.googlecomputeengine.domain.ListPage - */ - @Named("Kernels:list") - @GET - @Path("/global/kernels") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseKernels.class) - @Fallback(EmptyIterableWithMarkerOnNotFoundOr404.class) - ListPage listAtMarker(@QueryParam("pageToken") @Nullable String marker, - ListOptions listOptions); - - /** - * @see KernelApi#list(org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Kernels:list") - @GET - @Path("/global/kernels") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseKernels.class) - @Transform(ParseKernels.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable list(); - - /** - * A paged version of KernelApi#list() - * - * @return a Paged, Fluent Iterable that is able to fetch additional pages when required - * @see PagedIterable - * @see KernelApi#listAtMarker(String, org.jclouds.googlecomputeengine.options.ListOptions) - */ - @Named("Kernels:list") - @GET - @Path("/global/kernels") - @OAuthScopes(COMPUTE_READONLY_SCOPE) - @ResponseParser(ParseKernels.class) - @Transform(ParseKernels.ToPagedIterable.class) - @Fallback(EmptyPagedIterableOnNotFoundOr404.class) - PagedIterable list(ListOptions listOptions); - -} diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java index 8d4aa53195..d34f3ddd37 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/MachineTypeApi.java @@ -47,7 +47,7 @@ import org.jclouds.rest.annotations.Transform; * Provides access to MachineTypes via their REST API. * * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java index b4de2acb24..da1c8e90a2 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/NetworkApi.java @@ -55,7 +55,7 @@ import org.jclouds.rest.binders.BindToJsonPayload; * Provides access to Networks via their REST API. * * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java index 84d47ad12b..c08979d313 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ProjectApi.java @@ -46,7 +46,7 @@ import org.jclouds.rest.annotations.SkipEncoding; * Provides access to Projects via their REST API. * * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java index 33a9494118..5c0a4da822 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionApi.java @@ -45,7 +45,7 @@ import org.jclouds.rest.annotations.Transform; * Provides access to Regions via their REST API. * * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java index b2bd6d8d3c..d5c2d022bb 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RegionOperationApi.java @@ -49,7 +49,7 @@ import org.jclouds.rest.annotations.Transform; * Provides access to Operations via their REST API. * * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java index 231f813f91..9557cf6c77 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/RouteApi.java @@ -57,7 +57,7 @@ import org.jclouds.rest.annotations.Transform; * Provides access to Routes via their REST API. * * @author Andrew Bayer - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java index e3de540496..8bf01eef02 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/SnapshotApi.java @@ -50,7 +50,7 @@ import org.jclouds.rest.annotations.Transform; * Provides access to Snapshots via their REST API. * * @author Andrew Bayer - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java index c3c01e24d9..79aaf5c9a8 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneApi.java @@ -45,7 +45,7 @@ import org.jclouds.rest.annotations.Transform; * Provides access to Zones via their REST API. * * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java index b23ee13690..9345983763 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/features/ZoneOperationApi.java @@ -49,7 +49,7 @@ import org.jclouds.rest.annotations.Transform; * Provides access to Operations via their REST API. * * @author David Alves - * @see + * @see */ @SkipEncoding({'/', '='}) @RequestFilters(OAuthAuthenticator.class) diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseKernels.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseKernels.java deleted file mode 100644 index 121677f508..0000000000 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/functions/internal/ParseKernels.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.googlecomputeengine.functions.internal; - -import static com.google.common.base.Preconditions.checkNotNull; - -import javax.inject.Inject; - -import org.jclouds.collect.IterableWithMarker; -import org.jclouds.googlecomputeengine.GoogleComputeEngineApi; -import org.jclouds.googlecomputeengine.domain.Kernel; -import org.jclouds.googlecomputeengine.domain.ListPage; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.jclouds.http.functions.ParseJson; -import org.jclouds.json.Json; - -import com.google.common.base.Function; -import com.google.inject.TypeLiteral; - -/** - * @author David Alves - */ -public class ParseKernels extends ParseJson> { - - @Inject - public ParseKernels(Json json) { - super(json, new TypeLiteral>() { - }); - } - - public static class ToPagedIterable extends BaseToPagedIterable { - - private final GoogleComputeEngineApi api; - - @Inject - protected ToPagedIterable(GoogleComputeEngineApi api) { - this.api = checkNotNull(api, "api"); - } - - @Override - protected Function> fetchNextPage(final String projectName, - final ListOptions options) { - return new Function>() { - - @Override - public IterableWithMarker apply(Object input) { - return api.getKernelApiForProject(projectName).listAtMarker(input.toString(), options); - } - }; - } - } -} diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java index 43055799b9..919a20e9b4 100644 --- a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/options/ListOptions.java @@ -24,7 +24,7 @@ import org.jclouds.http.options.BaseHttpRequestOptions; * Allows to optionally specify a filter, max results and a page token for listFirstPage() REST methods. * * @author David Alves - * @see + * @see */ public class ListOptions extends BaseHttpRequestOptions { diff --git a/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/InstancePredicates.java b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/InstancePredicates.java new file mode 100644 index 0000000000..8cde680f51 --- /dev/null +++ b/providers/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/predicates/InstancePredicates.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.googlecomputeengine.predicates; + +import org.jclouds.googlecomputeengine.domain.InstanceTemplate.PersistentDisk; + +import com.google.common.base.Predicate; + +public class InstancePredicates { + + public static Predicate isBootDisk() { + return new Predicate() { + @Override + public boolean apply(PersistentDisk input) { + return input.isBoot(); + } + }; + } +} diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/PageSystemExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/PageSystemExpectTest.java index 880252afd0..d66b1930ce 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/PageSystemExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/PageSystemExpectTest.java @@ -43,7 +43,7 @@ public class PageSystemExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/images") + ".com/compute/v1/projects/myproject/global/images") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -66,7 +66,7 @@ public class PageSystemExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/images?maxResults=3") + ".com/compute/v1/projects/myproject/global/images?maxResults=3") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -74,7 +74,7 @@ public class PageSystemExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/images?pageToken" + + ".com/compute/v1/projects/myproject/global/images?pageToken" + "=CgVJTUFHRRIbZ29vZ2xlLmNlbnRvcy02LTItdjIwMTIwNjIx&maxResults=3") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -83,7 +83,7 @@ public class PageSystemExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/images?pageToken" + + ".com/compute/v1/projects/myproject/global/images?pageToken" + "=CgVJTUFHRRIbZ29vZ2xlLmdjZWwtMTAtMDQtdjIwMTIxMTA2&maxResults=3") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceExpectTest.java index c6ea7eba6e..8a91223b0e 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/GoogleComputeEngineServiceExpectTest.java @@ -19,10 +19,13 @@ package org.jclouds.googlecomputeengine.compute; import static com.google.common.collect.Iterables.getOnlyElement; import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_SCOPE; +import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.GCE_BOOT_DISK_SUFFIX; import static org.jclouds.googlecomputeengine.features.GlobalOperationApiExpectTest.GET_GLOBAL_OPERATION_REQUEST; import static org.jclouds.googlecomputeengine.features.GlobalOperationApiExpectTest.GET_GLOBAL_OPERATION_RESPONSE; -import static org.jclouds.googlecomputeengine.features.ImageApiExpectTest.LIST_GOOGLE_IMAGES_REQUEST; -import static org.jclouds.googlecomputeengine.features.ImageApiExpectTest.LIST_GOOGLE_IMAGES_RESPONSE; +import static org.jclouds.googlecomputeengine.features.ImageApiExpectTest.LIST_DEBIAN_IMAGES_REQUEST; +import static org.jclouds.googlecomputeengine.features.ImageApiExpectTest.LIST_DEBIAN_IMAGES_RESPONSE; +import static org.jclouds.googlecomputeengine.features.ImageApiExpectTest.LIST_CENTOS_IMAGES_REQUEST; +import static org.jclouds.googlecomputeengine.features.ImageApiExpectTest.LIST_CENTOS_IMAGES_RESPONSE; import static org.jclouds.googlecomputeengine.features.ImageApiExpectTest.LIST_PROJECT_IMAGES_REQUEST; import static org.jclouds.googlecomputeengine.features.ImageApiExpectTest.LIST_PROJECT_IMAGES_RESPONSE; import static org.jclouds.googlecomputeengine.features.InstanceApiExpectTest.LIST_CENTRAL1B_INSTANCES_REQUEST; @@ -55,6 +58,7 @@ import javax.ws.rs.core.MediaType; import org.jclouds.compute.ComputeService; import org.jclouds.compute.RunNodesException; import org.jclouds.compute.domain.Hardware; +import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.domain.Template; import org.jclouds.domain.Location; import org.jclouds.googlecomputeengine.compute.options.GoogleComputeEngineTemplateOptions; @@ -82,7 +86,7 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin private HttpRequest INSERT_NETWORK_REQUEST = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/networks") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromStringWithContentType("{\"name\":\"jclouds-test\",\"IPv4Range\":\"10.0.0.0/8\"}", @@ -92,11 +96,11 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin private HttpRequest INSERT_FIREWALL_REQUEST = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromStringWithContentType("{\"name\":\"jclouds-test\",\"network\":\"https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/jclouds-test\"," + + ".com/compute/v1/projects/myproject/global/networks/jclouds-test\"," + "\"sourceRanges\":[\"10.0.0.0/8\",\"0.0.0.0/0\"],\"sourceTags\":[\"aTag\"],\"allowed\":[{\"IPProtocol\":\"tcp\"," + "\"ports\":[\"22\"]}," + "{\"IPProtocol\":\"udp\",\"ports\":[\"22\"]}]}", @@ -109,7 +113,7 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin " \"id\": \"13024414170909937976\",\n" + " \"creationTimestamp\": \"2012-10-24T20:13:19.967\",\n" + " \"selfLink\": \"https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/jclouds-test\",\n" + + ".com/compute/v1/projects/myproject/global/networks/jclouds-test\",\n" + " \"name\": \"jclouds-test\",\n" + " \"description\": \"test network\",\n" + " \"IPv4Range\": \"10.0.0.0/8\",\n" + @@ -121,7 +125,7 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin private HttpRequest SET_TAGS_REQUEST = HttpRequest.builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/setTags") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/setTags") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromStringWithContentType("{\"items\":[\"aTag\"],\"fingerprint\":\"abcd\"}", @@ -151,38 +155,83 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin "application/json")).build(); } - private String replaceInstanceNameNetworkAndStatusOnResource(String resourceName, String instanceName, - String networkName, String status) { + private HttpResponse getDiskResponseForInstance(String instanceName) { + return HttpResponse.builder().statusCode(200) + .payload(payloadFromStringWithContentType( + replaceDiskNameOnResource("/disk_get.json", instanceName + "-" + GCE_BOOT_DISK_SUFFIX), + "application/json")).build(); + } + + private String replaceDiskNameOnResource(String resourceName, String diskName) { try { - return Strings2.toStringAndClose(this.getClass().getResourceAsStream(resourceName)).replace("test-0", - instanceName).replace("default", networkName).replace("RUNNING", status); + return Strings2.toStringAndClose(this.getClass().getResourceAsStream(resourceName)) + .replace("testimage1", diskName); } catch (IOException e) { throw Throwables.propagate(e); } } + private String replaceInstanceNameNetworkAndStatusOnResource(String resourceName, String instanceName, + String networkName, String status) { + try { + return Strings2.toStringAndClose(this.getClass().getResourceAsStream(resourceName)).replace("test-0", + instanceName).replace("default", networkName).replace("RUNNING", status); + } catch (IOException e) { + throw Throwables.propagate(e); + } + } + + private HttpRequest createDiskRequestForInstance(String instanceName) { + return HttpRequest + .builder() + .method("POST") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks" + + "?sourceImage=https%3A//www.googleapis.com/compute/v1/projects/centos-cloud/global/images/gcel-12-04-v20121106") + .addHeader("Accept", "application/json") + .addHeader("Authorization", "Bearer " + TOKEN) + .payload(payloadFromStringWithContentType("{\"name\":\"" + instanceName + "-" + GCE_BOOT_DISK_SUFFIX + "\"," + + "\"sizeGb\":10}", + MediaType.APPLICATION_JSON)).build(); + } + + private HttpRequest getDiskRequestForInstance(String instanceName) { + return HttpRequest + .builder() + .method("GET") + .endpoint("https://www.googleapis" + + ".com/compute/v1/projects/myproject/zones/us-central1-a/disks/" + + instanceName + "-" + GCE_BOOT_DISK_SUFFIX) + .addHeader("Accept", "application/json") + .addHeader("Authorization", "Bearer " + TOKEN).build(); + } + + + private HttpRequest createInstanceRequestForInstance(String instanceName, String groupName, String networkName, String publicKey) { return HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromStringWithContentType("{\"name\":\"" + instanceName + "\"," + - "\"machineType\":\"https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1\"," + - "\"image\":\"https://www.googleapis" + - ".com/compute/v1beta16/projects/google/global/images/gcel-12-04-v20121106\"," + - "\"serviceAccounts\":[]," + - "\"networkInterfaces\":[{\"network\":\"https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/" + networkName + "\"," + - "\"accessConfigs\":[{\"type\":\"ONE_TO_ONE_NAT\"}]}]," + - "\"metadata\":{\"kind\":\"compute#metadata\",\"items\":[{\"key\":\"sshKeys\"," + - "\"value\":\"jclouds:" + - publicKey + " jclouds@localhost\"},{\"key\":\"jclouds-group\"," + - "\"value\":\"" + groupName + "\"}]}}", - MediaType.APPLICATION_JSON)).build(); + "\"machineType\":\"https://www.googleapis" + + ".com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1\"," + + "\"serviceAccounts\":[]," + + "\"networkInterfaces\":[{\"network\":\"https://www.googleapis" + + ".com/compute/v1/projects/myproject/global/networks/" + networkName + "\"," + + "\"accessConfigs\":[{\"type\":\"ONE_TO_ONE_NAT\"}]}]," + + "\"disks\":[{\"mode\":\"READ_WRITE\",\"source\":\"https://www.googleapis.com/" + + "compute/v1/projects/myproject/zones/us-central1-a/disks/" + instanceName + + "-" + GCE_BOOT_DISK_SUFFIX + "\",\"deleteOnTerminate\":true,\"boot\":true,\"type\":\"PERSISTENT\"}]," + + "\"metadata\":{\"kind\":\"compute#metadata\",\"items\":[{\"key\":\"sshKeys\"," + + "\"value\":\"jclouds:" + + publicKey + " jclouds@localhost\"},{\"key\":\"jclouds-group\"," + + "\"value\":\"" + groupName + "\"},{\"key\":\"jclouds-image\",\"value\":\"https://www.googleapis" + + ".com/compute/v1/projects/centos-cloud/global/images/gcel-12-04-v20121106\"}," + + "{\"key\":\"jclouds-delete-boot-disk\",\"value\":\"true\"}]}}", + MediaType.APPLICATION_JSON)).build(); } private HttpRequest getInstanceRequestForInstance(String instanceName) { @@ -190,7 +239,7 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/" + instanceName) + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/" + instanceName) .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); } @@ -230,7 +279,8 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .put(GET_PROJECT_REQUEST, GET_PROJECT_RESPONSE) .put(LIST_ZONES_REQ, LIST_ZONES_RESPONSE) .put(LIST_PROJECT_IMAGES_REQUEST, LIST_PROJECT_IMAGES_RESPONSE) - .put(LIST_GOOGLE_IMAGES_REQUEST, LIST_GOOGLE_IMAGES_RESPONSE) + .put(LIST_DEBIAN_IMAGES_REQUEST, LIST_DEBIAN_IMAGES_RESPONSE) + .put(LIST_CENTOS_IMAGES_REQUEST, LIST_CENTOS_IMAGES_RESPONSE) .put(LIST_MACHINE_TYPES_REQUEST, LIST_MACHINE_TYPES_RESPONSE) .put(LIST_CENTRAL1B_MACHINE_TYPES_REQUEST, LIST_CENTRAL1B_MACHINE_TYPES_RESPONSE) .build(); @@ -259,21 +309,21 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin HttpRequest deleteNodeRequest = HttpRequest.builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-delete-networks") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-delete-networks") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); HttpRequest deleteFirewallRequest = HttpRequest.builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test-delete") + ".com/compute/v1/projects/myproject/global/firewalls/jclouds-test-delete") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); HttpRequest getNetworkRequest = HttpRequest.builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/jclouds-test-delete") + ".com/compute/v1/projects/myproject/global/networks/jclouds-test-delete") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -283,7 +333,7 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin HttpRequest listFirewallsRequest = HttpRequest.builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/firewalls") + ".com/compute/v1/projects/myproject/global/firewalls") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -293,21 +343,32 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin HttpRequest deleteNetworkReqquest = HttpRequest.builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/jclouds-test-delete") + ".com/compute/v1/projects/myproject/global/networks/jclouds-test-delete") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); + HttpRequest deleteDiskRequest= HttpRequest.builder() + .method("DELETE") + .endpoint("https://www.googleapis" + + ".com/compute/v1/projects/myproject/zones/us-central1-a/disks/test") + .addHeader("Accept", "application/json") + .addHeader("Authorization", "Bearer " + TOKEN).build(); + List orderedRequests = ImmutableList.builder() .add(requestForScopes(COMPUTE_READONLY_SCOPE)) .add(GET_PROJECT_REQUEST) .add(getInstanceRequestForInstance("test-delete-networks")) - .add(LIST_PROJECT_IMAGES_REQUEST) - .add(LIST_GOOGLE_IMAGES_REQUEST) .add(LIST_ZONES_REQ) .add(LIST_MACHINE_TYPES_REQUEST) + .add(LIST_PROJECT_IMAGES_REQUEST) + .add(LIST_DEBIAN_IMAGES_REQUEST) + .add(LIST_CENTOS_IMAGES_REQUEST) + .add(getInstanceRequestForInstance("test-delete-networks")) .add(requestForScopes(COMPUTE_SCOPE)) .add(deleteNodeRequest) .add(GET_ZONE_OPERATION_REQUEST) + .add(deleteDiskRequest) + .add(GET_ZONE_OPERATION_REQUEST) .add(getInstanceRequestForInstance("test-delete-networks")) .add(LIST_INSTANCES_REQUEST) .add(getNetworkRequest) @@ -324,13 +385,18 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .add(GET_PROJECT_RESPONSE) .add(getInstanceResponseForInstanceAndNetworkAndStatus("test-delete-networks", "test-network", Instance .Status.RUNNING.name())) - .add(LIST_PROJECT_IMAGES_RESPONSE) - .add(LIST_GOOGLE_IMAGES_RESPONSE) .add(LIST_ZONES_SHORT_RESPONSE) .add(LIST_MACHINE_TYPES_RESPONSE) + .add(LIST_PROJECT_IMAGES_RESPONSE) + .add(LIST_DEBIAN_IMAGES_RESPONSE) + .add(LIST_CENTOS_IMAGES_RESPONSE) + .add(getInstanceResponseForInstanceAndNetworkAndStatus("test-delete-networks", "test-network", Instance + .Status.RUNNING.name())) .add(TOKEN_RESPONSE) .add(SUCESSFULL_OPERATION_RESPONSE) .add(GET_ZONE_OPERATION_RESPONSE) + .add(SUCESSFULL_OPERATION_RESPONSE) + .add(GET_ZONE_OPERATION_RESPONSE) .add(getInstanceResponseForInstanceAndNetworkAndStatus("test-delete-networks", "test-network", Instance .Status.TERMINATED.name())) .add(getListInstancesResponseForSingleInstanceAndNetworkAndStatus("test-delete-networks", @@ -359,7 +425,8 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .put(LIST_INSTANCES_REQUEST, LIST_INSTANCES_RESPONSE) .put(LIST_CENTRAL1B_INSTANCES_REQUEST, LIST_CENTRAL1B_INSTANCES_RESPONSE) .put(LIST_PROJECT_IMAGES_REQUEST, LIST_PROJECT_IMAGES_RESPONSE) - .put(LIST_GOOGLE_IMAGES_REQUEST, LIST_GOOGLE_IMAGES_RESPONSE) + .put(LIST_DEBIAN_IMAGES_REQUEST, LIST_DEBIAN_IMAGES_RESPONSE) + .put(LIST_CENTOS_IMAGES_REQUEST, LIST_CENTOS_IMAGES_RESPONSE) .put(LIST_MACHINE_TYPES_REQUEST, LIST_MACHINE_TYPES_RESPONSE) .put(LIST_CENTRAL1B_MACHINE_TYPES_REQUEST, LIST_CENTRAL1B_MACHINE_TYPES_RESPONSE) .build(); @@ -392,18 +459,18 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test-port-22") + ".com/compute/v1/projects/myproject/global/firewalls/jclouds-test-port-22") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); HttpRequest insertFirewallRequest = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromStringWithContentType("{\"name\":\"jclouds-test-port-22\",\"network\":\"https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/jclouds-test\"," + + ".com/compute/v1/projects/myproject/global/networks/jclouds-test\"," + "\"sourceRanges\":[\"10.0.0.0/8\",\"0.0.0.0/0\"],\"sourceTags\":[\"aTag\"],\"targetTags\":[\"jclouds-test-port-22\"],\"allowed\":[{\"IPProtocol\":\"tcp\"," + "\"ports\":[\"22\"]}," + "{\"IPProtocol\":\"udp\",\"ports\":[\"22\"]}]}", @@ -413,7 +480,7 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin HttpRequest setTagsRequest = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/setTags") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/setTags") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromStringWithContentType("{\"items\":[\"jclouds-test-port-22\"],\"fingerprint\":\"abcd\"}", @@ -425,7 +492,8 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .add(GET_PROJECT_REQUEST) .add(LIST_ZONES_REQ) .add(LIST_PROJECT_IMAGES_REQUEST) - .add(LIST_GOOGLE_IMAGES_REQUEST) + .add(LIST_DEBIAN_IMAGES_REQUEST) + .add(LIST_CENTOS_IMAGES_REQUEST) .add(LIST_ZONES_REQ) .add(LIST_MACHINE_TYPES_REQUEST) .add(GET_NETWORK_REQUEST) @@ -438,9 +506,13 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .add(insertFirewallRequest) .add(GET_GLOBAL_OPERATION_REQUEST) .add(LIST_INSTANCES_REQUEST) - .add(LIST_PROJECT_IMAGES_REQUEST) - .add(LIST_GOOGLE_IMAGES_REQUEST) .add(LIST_MACHINE_TYPES_REQUEST) + .add(LIST_PROJECT_IMAGES_REQUEST) + .add(LIST_DEBIAN_IMAGES_REQUEST) + .add(LIST_CENTOS_IMAGES_REQUEST) + .add(createDiskRequestForInstance("test-1")) + .add(GET_ZONE_OPERATION_REQUEST) + .add(getDiskRequestForInstance("test-1")) .add(createInstanceRequestForInstance("test-1", "test", "jclouds-test", openSshKey)) .add(GET_ZONE_OPERATION_REQUEST) .add(getInstanceRequestForInstance("test-1")) @@ -448,6 +520,9 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .add(GET_ZONE_OPERATION_REQUEST) .add(getInstanceRequestForInstance("test-1")) .add(setTagsRequest) + .add(LIST_PROJECT_IMAGES_REQUEST) + .add(LIST_DEBIAN_IMAGES_REQUEST) + .add(LIST_CENTOS_IMAGES_REQUEST) .add(setTagsRequest) .build(); @@ -456,7 +531,8 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .add(GET_PROJECT_RESPONSE) .add(LIST_ZONES_SHORT_RESPONSE) .add(LIST_PROJECT_IMAGES_RESPONSE) - .add(LIST_GOOGLE_IMAGES_RESPONSE) + .add(LIST_DEBIAN_IMAGES_RESPONSE) + .add(LIST_CENTOS_IMAGES_RESPONSE) .add(LIST_ZONES_SHORT_RESPONSE) .add(LIST_MACHINE_TYPES_RESPONSE) .add(HttpResponse.builder().statusCode(404).build()) @@ -469,9 +545,13 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .add(SUCESSFULL_OPERATION_RESPONSE) .add(GET_GLOBAL_OPERATION_RESPONSE) .add(LIST_INSTANCES_RESPONSE) - .add(LIST_PROJECT_IMAGES_RESPONSE) - .add(LIST_GOOGLE_IMAGES_RESPONSE) .add(LIST_MACHINE_TYPES_RESPONSE) + .add(LIST_PROJECT_IMAGES_RESPONSE) + .add(LIST_DEBIAN_IMAGES_RESPONSE) + .add(LIST_CENTOS_IMAGES_RESPONSE) + .add(SUCESSFULL_OPERATION_RESPONSE) + .add(GET_ZONE_OPERATION_RESPONSE) + .add(getDiskResponseForInstance("test-1")) .add(SUCESSFULL_OPERATION_RESPONSE) .add(GET_ZONE_OPERATION_RESPONSE) .add(getInstanceResponse) @@ -479,6 +559,9 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin .add(GET_ZONE_OPERATION_RESPONSE) .add(getInstanceResponse) .add(SUCESSFULL_OPERATION_RESPONSE) + .add(LIST_PROJECT_IMAGES_RESPONSE) + .add(LIST_DEBIAN_IMAGES_RESPONSE) + .add(LIST_CENTOS_IMAGES_RESPONSE) .add(SUCESSFULL_OPERATION_RESPONSE) .build(); @@ -487,7 +570,8 @@ public class GoogleComputeEngineServiceExpectTest extends BaseGoogleComputeEngin GoogleComputeEngineTemplateOptions options = computeService.templateOptions().as(GoogleComputeEngineTemplateOptions.class); options.tags(ImmutableSet.of("aTag")); - getOnlyElement(computeService.createNodesInGroup("test", 1, options)); + NodeMetadata node = getOnlyElement(computeService.createNodesInGroup("test", 1, options)); + assertEquals(node.getImageId(), "gcel-12-04-v20121106"); } } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/FirewallToIpPermissionTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/FirewallToIpPermissionTest.java index 78089e6872..62f92600d8 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/FirewallToIpPermissionTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/FirewallToIpPermissionTest.java @@ -62,8 +62,8 @@ public class FirewallToIpPermissionTest { .addPort(33).build()); builder.addAllowed(Firewall.Rule.builder().IpProtocol(IpProtocol.ICMP).build()); builder.id("abcd"); - builder.selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test")); - builder.network(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test")); + builder.selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls/jclouds-test")); + builder.network(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test")); builder.creationTimestamp(new Date()); builder.name("jclouds-test"); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/NetworkToSecurityGroupTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/NetworkToSecurityGroupTest.java index 6f655c1617..795c98998f 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/NetworkToSecurityGroupTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/functions/NetworkToSecurityGroupTest.java @@ -68,7 +68,7 @@ public class NetworkToSecurityGroupTest { Network.Builder builder = Network.builder(); builder.id("abcd"); - builder.selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test")); + builder.selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test")); builder.creationTimestamp(new Date()); builder.description("some description"); builder.gatewayIPv4("1.2.3.4"); @@ -82,7 +82,7 @@ public class NetworkToSecurityGroupTest { SecurityGroup group = netToSg.apply(network); assertEquals(group.getId(), "jclouds-test"); - assertEquals(group.getUri(), URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test")); + assertEquals(group.getUri(), URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test")); assertEquals(group.getIpPermissions().size(), 3); assertTrue(Iterables.any(group.getIpPermissions(), Predicates.and(hasProtocol(IpProtocol.TCP), hasStartAndEndPort(1, 10))), "No permission found for TCP, ports 1-10"); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/loaders/FindNetworkOrCreateTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/loaders/FindNetworkOrCreateTest.java index 7fe7249449..dc94989f2a 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/loaders/FindNetworkOrCreateTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/compute/loaders/FindNetworkOrCreateTest.java @@ -52,7 +52,7 @@ public class FindNetworkOrCreateTest { Network network = Network.builder().IPv4Range("0.0.0.0/0") .id("abcd").name("this-network") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/this-network")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/this-network")) .build(); final Supplier userProject = new Supplier() { @@ -94,7 +94,7 @@ public class FindNetworkOrCreateTest { Network network = Network.builder().IPv4Range("0.0.0.0/0") .id("abcd").name("this-network") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/this-network")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/this-network")) .build(); Operation createOp = createMock(Operation.class); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiExpectTest.java index d29a2a02d2..8b69df112f 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/AddressApiExpectTest.java @@ -42,7 +42,7 @@ public class AddressApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { HttpRequest get = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-ip1") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-ip1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -60,7 +60,7 @@ public class AddressApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { HttpRequest get = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-ip1") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-ip1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -76,7 +76,7 @@ public class AddressApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { HttpRequest insert = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromResourceWithContentType("/address_insert.json", MediaType.APPLICATION_JSON)) @@ -97,7 +97,7 @@ public class AddressApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-ip1") + ".com/compute/v1/projects/myproject/regions/us-central1/addresses/test-ip1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -116,7 +116,7 @@ public class AddressApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-ip1") + ".com/compute/v1/projects/myproject/regions/us-central1/addresses/test-ip1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -133,7 +133,7 @@ public class AddressApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/regions/us-central1/addresses") + ".com/compute/v1/projects/myproject/regions/us-central1/addresses") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -152,7 +152,7 @@ public class AddressApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/regions/us-central1/addresses") + ".com/compute/v1/projects/myproject/regions/us-central1/addresses") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiExpectTest.java index 60f34796ec..450e079923 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/DiskApiExpectTest.java @@ -37,12 +37,13 @@ import org.testng.annotations.Test; */ @Test(groups = "unit") public class DiskApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { + public static final String IMAGE_URL = "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/images/foo"; public void testGetDiskResponseIs2xx() throws Exception { HttpRequest get = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -60,7 +61,7 @@ public class DiskApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { HttpRequest get = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -76,7 +77,7 @@ public class DiskApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { HttpRequest insert = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromResourceWithContentType("/disk_insert.json", MediaType.APPLICATION_JSON)) @@ -92,11 +93,32 @@ public class DiskApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { assertEquals(api.createInZone("testimage1", 1, "us-central1-a"), new ParseOperationTest().expected()); } + public void testInsertDiskFromImageResponseIs2xx() { + HttpRequest insert = HttpRequest + .builder() + .method("POST") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks" + + "?sourceImage=" + IMAGE_URL.replaceAll(":", "%3A")) + .addHeader("Accept", "application/json") + .addHeader("Authorization", "Bearer " + TOKEN) + .payload(payloadFromResourceWithContentType("/disk_insert.json", MediaType.APPLICATION_JSON)) + .build(); + + HttpResponse insertDiskResponse = HttpResponse.builder().statusCode(200) + .payload(payloadFromResource("/zone_operation.json")).build(); + + DiskApi api = requestsSendResponses(requestForScopes(COMPUTE_SCOPE), + TOKEN_RESPONSE, insert, + insertDiskResponse).getDiskApiForProject("myproject"); + + assertEquals(api.createFromImageWithSizeInZone(IMAGE_URL, "testimage1", 1, "us-central1-a"), new ParseOperationTest().expected()); + } + public void testCreateSnapshotResponseIs2xx() { HttpRequest createSnapshotRequest = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks" + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks" + "/testimage1/createSnapshot") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) @@ -117,7 +139,7 @@ public class DiskApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { HttpRequest createSnapshotRequest = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks" + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks" + "/testimage1/createSnapshot") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) @@ -138,7 +160,7 @@ public class DiskApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1") + ".com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -157,7 +179,7 @@ public class DiskApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1") + ".com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -174,7 +196,7 @@ public class DiskApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks") + ".com/compute/v1/projects/myproject/zones/us-central1-a/disks") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -193,7 +215,7 @@ public class DiskApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks") + ".com/compute/v1/projects/myproject/zones/us-central1-a/disks") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java index e21254da6e..d41d153aad 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/FirewallApiExpectTest.java @@ -58,7 +58,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test") + ".com/compute/v1/projects/myproject/global/firewalls/jclouds-test") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -108,7 +108,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test") + ".com/compute/v1/projects/myproject/global/firewalls/jclouds-test") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -125,7 +125,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest HttpRequest request = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(firewallPayloadFirewallOfName( @@ -144,7 +144,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest TOKEN_RESPONSE, request, insertFirewallResponse).getFirewallApiForProject("myproject"); assertEquals(api.createInNetwork("myfw", URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/default"), + ".com/compute/v1/projects/myproject/global/networks/default"), new FirewallOptions() .addAllowedRule(Firewall.Rule.builder() .IpProtocol(IpProtocol.TCP) @@ -160,7 +160,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest HttpRequest update = HttpRequest .builder() .method("PUT") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls/myfw") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls/myfw") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(firewallPayloadFirewallOfName( @@ -183,7 +183,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest new FirewallOptions() .name("myfw") .network(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/default")) + ".com/compute/v1/projects/myproject/global/networks/default")) .addAllowedRule(Firewall.Rule.builder() .IpProtocol(IpProtocol.TCP) .addPort(22) @@ -197,7 +197,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest HttpRequest update = HttpRequest .builder() .method("PATCH") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls/myfw") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls/myfw") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(firewallPayloadFirewallOfName( @@ -220,7 +220,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest new FirewallOptions() .name("myfw") .network(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/default")) + ".com/compute/v1/projects/myproject/global/networks/default")) .addAllowedRule(Firewall.Rule.builder() .IpProtocol(IpProtocol.TCP) .addPort(22) @@ -235,7 +235,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/firewalls/default-allow-internal") + ".com/compute/v1/projects/myproject/global/firewalls/default-allow-internal") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -254,7 +254,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/firewalls/default-allow-internal") + ".com/compute/v1/projects/myproject/global/firewalls/default-allow-internal") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -271,7 +271,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/firewalls") + ".com/compute/v1/projects/myproject/global/firewalls") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -290,7 +290,7 @@ public class FirewallApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/firewalls") + ".com/compute/v1/projects/myproject/global/firewalls") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalOperationApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalOperationApiExpectTest.java index e6bf13a195..ef7c03f95d 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalOperationApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/GlobalOperationApiExpectTest.java @@ -37,7 +37,7 @@ import org.testng.annotations.Test; public class GlobalOperationApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { private static final String OPERATIONS_URL_PREFIX = "https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/operations"; + ".com/compute/v1/projects/myproject/global/operations"; public static final HttpRequest GET_GLOBAL_OPERATION_REQUEST = HttpRequest .builder() diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiExpectTest.java index 1dacd22c8f..30449f0ff6 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiExpectTest.java @@ -40,30 +40,40 @@ public class ImageApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/images") + ".com/compute/v1/projects/myproject/global/images") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); public static final HttpResponse LIST_PROJECT_IMAGES_RESPONSE = HttpResponse.builder().statusCode(200) .payload(staticPayloadFromResource("/image_list.json")).build(); - public static final HttpRequest LIST_GOOGLE_IMAGES_REQUEST = HttpRequest + public static final HttpRequest LIST_CENTOS_IMAGES_REQUEST = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/google/global/images") + .endpoint("https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); - public static final HttpResponse LIST_GOOGLE_IMAGES_RESPONSE = HttpResponse.builder().statusCode(200) + public static final HttpResponse LIST_CENTOS_IMAGES_RESPONSE = HttpResponse.builder().statusCode(200) .payload(staticPayloadFromResource("/image_list_single_page.json")).build(); + public static final HttpRequest LIST_DEBIAN_IMAGES_REQUEST = HttpRequest + .builder() + .method("GET") + .endpoint("https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images") + .addHeader("Accept", "application/json") + .addHeader("Authorization", "Bearer " + TOKEN).build(); + + public static final HttpResponse LIST_DEBIAN_IMAGES_RESPONSE = + HttpResponse.builder().statusCode(200) + .payload(staticPayloadFromResource("/image_list_empty.json")).build(); public void testGetImageResponseIs2xx() throws Exception { HttpRequest get = HttpRequest .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/google/global/images/centos-6-2-v20120326") + ".com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -71,7 +81,7 @@ public class ImageApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .payload(payloadFromResource("/image_get.json")).build(); ImageApi imageApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, get, operationResponse).getImageApiForProject("google"); + TOKEN_RESPONSE, get, operationResponse).getImageApiForProject("centos-cloud"); assertEquals(imageApi.get("centos-6-2-v20120326"), new ParseImageTest().expected()); @@ -82,14 +92,14 @@ public class ImageApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/google/global/images/centos-6-2-v20120326") + ".com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); HttpResponse operationResponse = HttpResponse.builder().statusCode(404).build(); ImageApi imageApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, get, operationResponse).getImageApiForProject("google"); + TOKEN_RESPONSE, get, operationResponse).getImageApiForProject("centos-cloud"); assertNull(imageApi.get("centos-6-2-v20120326")); } @@ -99,7 +109,7 @@ public class ImageApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/images/centos-6-2-v20120326") + ".com/compute/v1/projects/myproject/global/images/centos-6-2-v20120326") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -118,7 +128,7 @@ public class ImageApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/images/centos-6-2-v20120326") + ".com/compute/v1/projects/myproject/global/images/centos-6-2-v20120326") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiLiveTest.java index 11809493fe..0ca6ad0754 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ImageApiLiveTest.java @@ -42,7 +42,7 @@ public class ImageApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { private Image image; private ImageApi api() { - return api.getImageApiForProject("google"); + return api.getImageApiForProject("centos-cloud"); } @Test(groups = "live") diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiExpectTest.java index 5bb5f88090..03802265b9 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiExpectTest.java @@ -55,7 +55,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -67,7 +67,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -78,7 +78,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-b/instances") + ".com/compute/v1/projects/myproject/zones/us-central1-b/instances") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -113,7 +113,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/serialPort") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/serialPort") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -131,7 +131,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest HttpRequest insert = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromResourceWithContentType("/instance_insert_simple.json", MediaType.APPLICATION_JSON)) @@ -144,9 +144,8 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest CREATE_INSTANCE_RESPONSE)).getInstanceApiForProject("myproject"); InstanceTemplate options = InstanceTemplate.builder().forMachineType("us-central1-a/n1-standard-1") - .image(URI.create("https://www.googleapis.com/compute/v1beta16/projects/google/global/images/gcel-12-04-v20121106")) .addNetworkInterface(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/default")); + ".com/compute/v1/projects/myproject/global/networks/default")); assertEquals(api.createInZone("test-1", "us-central1-a", options), new ParseOperationTest().expected()); } @@ -155,7 +154,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest HttpRequest insert = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromResourceWithContentType("/instance_insert.json", MediaType.APPLICATION_JSON)) @@ -171,12 +170,11 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest InstanceTemplate options = InstanceTemplate.builder().forMachineType("us-central1-a/n1-standard-1") .addNetworkInterface(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/default"), Instance.NetworkInterface.AccessConfig.Type.ONE_TO_ONE_NAT) + ".com/compute/v1/projects/myproject/global/networks/default"), Instance.NetworkInterface.AccessConfig.Type.ONE_TO_ONE_NAT) .description("desc") - .image(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/google/global/images/gcel-12-04-v20121106")) .addDisk(InstanceTemplate.PersistentDisk.Mode.READ_WRITE, - create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/test")) + create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/test"), + true) .addServiceAccount(Instance.ServiceAccount.builder().email("default").addScopes("myscope").build()) .addMetadata("aKey", "aValue"); @@ -189,7 +187,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -208,7 +206,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -235,7 +233,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -252,7 +250,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("POST") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/setMetadata") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/setMetadata") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromResourceWithContentType("/instance_set_metadata.json", MediaType.APPLICATION_JSON)) @@ -273,7 +271,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("POST") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/setMetadata") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/setMetadata") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromResourceWithContentType("/instance_set_metadata.json", MediaType.APPLICATION_JSON)) @@ -292,7 +290,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("POST") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/reset") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/reset") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -311,7 +309,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("POST") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/reset") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/reset") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -328,7 +326,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("POST") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/attachDisk") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/attachDisk") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromResourceWithContentType("/instance_attach_disk.json", MediaType.APPLICATION_JSON)) @@ -343,7 +341,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest assertEquals(api.attachDiskInZone("us-central1-a", "test-1", new AttachDiskOptions() .mode(DiskMode.READ_ONLY) - .source(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1")) + .source(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1")) .type(DiskType.PERSISTENT)), new ParseOperationTest().expected()); } @@ -353,7 +351,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("POST") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/attachDisk") + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/attachDisk") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromResourceWithContentType("/instance_attach_disk.json", MediaType.APPLICATION_JSON)) @@ -367,7 +365,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest assertNull(api.attachDiskInZone("us-central1-a", "test-1", new AttachDiskOptions() .mode(DiskMode.READ_ONLY) - .source(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1")) + .source(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1")) .type(DiskType.PERSISTENT))); } @@ -377,7 +375,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("POST") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/detachDisk" + + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/detachDisk" + "?deviceName=test-disk-1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) @@ -398,7 +396,7 @@ public class InstanceApiExpectTest extends BaseGoogleComputeEngineApiExpectTest .builder() .method("POST") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-1/detachDisk" + + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-1/detachDisk" + "?deviceName=test-disk-1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java index 8be4a54742..4df03bfa1d 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java @@ -36,6 +36,7 @@ import org.jclouds.googlecomputeengine.options.AttachDiskOptions; import org.jclouds.googlecomputeengine.options.AttachDiskOptions.DiskMode; import org.jclouds.googlecomputeengine.options.AttachDiskOptions.DiskType; import org.jclouds.googlecomputeengine.options.ListOptions; +import org.testng.annotations.AfterClass; import org.testng.annotations.Test; import com.google.common.base.Predicate; @@ -51,6 +52,7 @@ public class InstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { private static final String INSTANCE_NETWORK_NAME = "instance-api-live-test-network"; private static final String INSTANCE_NAME = "instance-api-live-test-instance"; + private static final String BOOT_DISK_NAME = INSTANCE_NAME + "-boot-disk"; private static final String DISK_NAME = "instance-live-test-disk"; private static final String IPV4_RANGE = "10.0.0.0/8"; private static final String METADATA_ITEM_KEY = "instanceLiveTestTestProp"; @@ -65,29 +67,27 @@ public class InstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { @Override protected GoogleComputeEngineApi create(Properties props, Iterable modules) { GoogleComputeEngineApi api = super.create(props, modules); - URI imageUri = api.getImageApiForProject("google") - .list(new ListOptions.Builder().filter("name eq gcel.*")) - .concat() - .filter(new Predicate() { - @Override - public boolean apply(Image input) { - // filter out only images with deprecation state other than "DEPRECATED" - if (input.getDeprecated().isPresent() && input.getDeprecated().get().getState().isPresent()) { - return input.getDeprecated().get().getState().get().equals("DEPRECATED"); - } - return true; - - } - }) - .first() - .get() - .getSelfLink(); + URI imageUri = api.getImageApiForProject("centos-cloud") + .list(new ListOptions.Builder().filter("name eq centos.*")) + .concat() + .filter(new Predicate() { + @Override + public boolean apply(Image input) { + // filter out all deprecated images + return !(input.getDeprecated().isPresent() && input.getDeprecated().get().getState().isPresent()); + } + }) + .first() + .get() + .getSelfLink(); instance = InstanceTemplate.builder() .forMachineType(getDefaultMachineTypeUrl(userProject.get())) .addNetworkInterface(getNetworkUrl(userProject.get(), INSTANCE_NETWORK_NAME), - Instance.NetworkInterface.AccessConfig.Type.ONE_TO_ONE_NAT) + Instance.NetworkInterface.AccessConfig.Type.ONE_TO_ONE_NAT) .addMetadata("mykey", "myvalue") .description("a description") + .addDisk(InstanceTemplate.PersistentDisk.Mode.READ_WRITE, getDiskUrl(userProject.get(), BOOT_DISK_NAME), + null, true, true) .addDisk(InstanceTemplate.PersistentDisk.Mode.READ_WRITE, getDiskUrl(userProject.get(), DISK_NAME)) .image(imageUri); @@ -109,6 +109,14 @@ public class InstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertGlobalOperationDoneSucessfully(api.getNetworkApiForProject(userProject.get()).createInIPv4Range (INSTANCE_NETWORK_NAME, IPV4_RANGE), TIME_WAIT); + + assertZoneOperationDoneSucessfully(api.getDiskApiForProject(userProject.get()) + .createFromImageInZone(instance.getImage().toString(), + BOOT_DISK_NAME, + DEFAULT_ZONE_NAME), + TIME_WAIT); + + assertZoneOperationDoneSucessfully(diskApi().createInZone ("instance-live-test-disk", 10, DEFAULT_ZONE_NAME), TIME_WAIT); @@ -161,7 +169,8 @@ public class InstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { @Override public boolean apply(AttachedDisk disk) { return disk instanceof PersistentAttachedDisk && - ((PersistentAttachedDisk) disk).getDeviceName().orNull().equals(ATTACH_DISK_DEVICE_NAME); + ((PersistentAttachedDisk) disk).getDeviceName().isPresent() && + ((PersistentAttachedDisk) disk).getDeviceName().get().equals(ATTACH_DISK_DEVICE_NAME); } })); } @@ -205,6 +214,8 @@ public class InstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertZoneOperationDoneSucessfully(api().deleteInZone(DEFAULT_ZONE_NAME, INSTANCE_NAME), TIME_WAIT); assertZoneOperationDoneSucessfully(api.getDiskApiForProject(userProject.get()).deleteInZone(DEFAULT_ZONE_NAME, DISK_NAME), TIME_WAIT); + assertZoneOperationDoneSucessfully(api.getDiskApiForProject(userProject.get()).deleteInZone(DEFAULT_ZONE_NAME, BOOT_DISK_NAME), + TIME_WAIT); assertGlobalOperationDoneSucessfully(api.getNetworkApiForProject(userProject.get()).delete (INSTANCE_NETWORK_NAME), TIME_WAIT); } @@ -213,4 +224,20 @@ public class InstanceApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { assertEquals(result.getName(), expected.getName()); assertEquals(result.getMetadata().getItems(), expected.getMetadata()); } + + @AfterClass(groups = { "integration", "live" }) + protected void tearDownContext() { + try { + waitZoneOperationDone(api().deleteInZone(DEFAULT_ZONE_NAME, INSTANCE_NAME), TIME_WAIT); + waitZoneOperationDone(api.getDiskApiForProject(userProject.get()).deleteInZone(DEFAULT_ZONE_NAME, DISK_NAME), + TIME_WAIT); + waitZoneOperationDone(api.getDiskApiForProject(userProject.get()).deleteInZone(DEFAULT_ZONE_NAME, BOOT_DISK_NAME), + TIME_WAIT); + waitGlobalOperationDone(api.getNetworkApiForProject(userProject.get()).delete + (INSTANCE_NETWORK_NAME), TIME_WAIT); + } catch (Exception e) { + // we don't really care about any exception here, so just delete away. + } + } + } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/KernelApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/KernelApiExpectTest.java deleted file mode 100644 index 89a2979b83..0000000000 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/KernelApiExpectTest.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.googlecomputeengine.features; - -import static org.jclouds.googlecomputeengine.GoogleComputeEngineConstants.COMPUTE_READONLY_SCOPE; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNull; -import static org.testng.Assert.assertTrue; - -import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiExpectTest; -import org.jclouds.googlecomputeengine.parse.ParseKernelListTest; -import org.jclouds.googlecomputeengine.parse.ParseKernelTest; -import org.jclouds.http.HttpRequest; -import org.jclouds.http.HttpResponse; -import org.testng.annotations.Test; - -/** - * @author David Alves - */ -@Test(groups = "unit") -public class KernelApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { - - public void testGetKernelResponseIs2xx() throws Exception { - HttpRequest get = HttpRequest - .builder() - .method("GET") - .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/kernels/12941177846308850718") - .addHeader("Accept", "application/json") - .addHeader("Authorization", "Bearer " + TOKEN).build(); - - HttpResponse operationResponse = HttpResponse.builder().statusCode(200) - .payload(payloadFromResource("/kernel.json")).build(); - - KernelApi kernelApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, get, operationResponse).getKernelApiForProject("myproject"); - - assertEquals(kernelApi.get("12941177846308850718"), - new ParseKernelTest().expected()); - } - - public void testGetKernelResponseIs4xx() throws Exception { - HttpRequest get = HttpRequest - .builder() - .method("GET") - .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/kernels/12941177846308850718") - .addHeader("Accept", "application/json") - .addHeader("Authorization", "Bearer " + TOKEN).build(); - - HttpResponse operationResponse = HttpResponse.builder().statusCode(404).build(); - - KernelApi kernelApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, get, operationResponse).getKernelApiForProject("myproject"); - - assertNull(kernelApi.get("12941177846308850718")); - } - - public void testListKernelNoOptionsResponseIs2xx() throws Exception { - HttpRequest list = HttpRequest - .builder() - .method("GET") - .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/kernels") - .addHeader("Accept", "application/json") - .addHeader("Authorization", "Bearer " + TOKEN).build(); - - HttpResponse operationResponse = HttpResponse.builder().statusCode(200) - .payload(payloadFromResource("/kernel_list.json")).build(); - - KernelApi kernelApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, list, operationResponse).getKernelApiForProject("myproject"); - - assertEquals(kernelApi.listFirstPage().toString(), - new ParseKernelListTest().expected().toString()); - } - - public void testListKernelsResponseIs4xx() { - HttpRequest list = HttpRequest - .builder() - .method("GET") - .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/kernels") - .addHeader("Accept", "application/json") - .addHeader("Authorization", "Bearer " + TOKEN).build(); - - HttpResponse operationResponse = HttpResponse.builder().statusCode(404).build(); - - KernelApi kernelApi = requestsSendResponses(requestForScopes(COMPUTE_READONLY_SCOPE), - TOKEN_RESPONSE, list, operationResponse).getKernelApiForProject("myproject"); - - assertTrue(kernelApi.list().concat().isEmpty()); - } - -} diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/KernelApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/KernelApiLiveTest.java deleted file mode 100644 index 53eaed2e21..0000000000 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/KernelApiLiveTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.googlecomputeengine.features; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertSame; -import static org.testng.Assert.assertTrue; - -import java.util.Iterator; -import java.util.List; - -import org.jclouds.collect.IterableWithMarker; -import org.jclouds.collect.PagedIterable; -import org.jclouds.googlecomputeengine.domain.Kernel; -import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineApiLiveTest; -import org.jclouds.googlecomputeengine.options.ListOptions; -import org.testng.annotations.Test; - -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; - -/** - * @author David Alves - */ -public class KernelApiLiveTest extends BaseGoogleComputeEngineApiLiveTest { - - private Kernel kernel; - - private KernelApi api() { - return api.getKernelApiForProject("google"); - } - - @Test(groups = "live") - public void testListKernel() { - - PagedIterable kernels = api().list(new ListOptions.Builder() - .maxResults(1)); - - Iterator> pageIterator = kernels.iterator(); - assertTrue(pageIterator.hasNext()); - - IterableWithMarker singlePageIterator = pageIterator.next(); - List kernelAsList = Lists.newArrayList(singlePageIterator); - - assertSame(kernelAsList.size(), 1); - - this.kernel = Iterables.getOnlyElement(kernelAsList); - } - - - @Test(groups = "live", dependsOnMethods = "testListKernel") - public void testGetKernel() { - Kernel kernel = api().get(this.kernel.getName()); - assertNotNull(kernel); - assertKernelEquals(kernel, this.kernel); - } - - private void assertKernelEquals(Kernel result, Kernel expected) { - assertEquals(result.getName(), expected.getName()); - } - -} diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiExpectTest.java index fe4f3b9f4e..960407dfcf 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/MachineTypeApiExpectTest.java @@ -37,7 +37,7 @@ public class MachineTypeApiExpectTest extends BaseGoogleComputeEngineApiExpectTe public static final HttpRequest LIST_MACHINE_TYPES_REQUEST = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -49,7 +49,7 @@ public class MachineTypeApiExpectTest extends BaseGoogleComputeEngineApiExpectTe public static final HttpRequest LIST_CENTRAL1B_MACHINE_TYPES_REQUEST = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-b/machineTypes") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b/machineTypes") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -63,7 +63,7 @@ public class MachineTypeApiExpectTest extends BaseGoogleComputeEngineApiExpectTe .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1") + ".com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -82,7 +82,7 @@ public class MachineTypeApiExpectTest extends BaseGoogleComputeEngineApiExpectTe .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1") + ".com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiExpectTest.java index af571592a4..914a5fc0cb 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/NetworkApiExpectTest.java @@ -41,7 +41,7 @@ public class NetworkApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { public static final HttpRequest GET_NETWORK_REQUEST = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -61,7 +61,7 @@ public class NetworkApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { HttpRequest get = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -77,7 +77,7 @@ public class NetworkApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { HttpRequest insert = HttpRequest .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/networks") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromResourceWithContentType("/network_insert.json", MediaType.APPLICATION_JSON)) @@ -98,7 +98,7 @@ public class NetworkApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/jclouds-test") + ".com/compute/v1/projects/myproject/global/networks/jclouds-test") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -117,7 +117,7 @@ public class NetworkApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks/jclouds-test") + ".com/compute/v1/projects/myproject/global/networks/jclouds-test") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -134,7 +134,7 @@ public class NetworkApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks") + ".com/compute/v1/projects/myproject/global/networks") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -153,7 +153,7 @@ public class NetworkApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/networks") + ".com/compute/v1/projects/myproject/global/networks") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiExpectTest.java index 654d90ca0f..f2f673a37e 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ProjectApiExpectTest.java @@ -38,7 +38,7 @@ import org.testng.annotations.Test; @Test(groups = "unit") public class ProjectApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { - public static final String PROJECTS_URL_PREFIX = "https://www.googleapis.com/compute/v1beta16/projects"; + public static final String PROJECTS_URL_PREFIX = "https://www.googleapis.com/compute/v1/projects"; public static final HttpRequest GET_PROJECT_REQUEST = HttpRequest .builder() diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiExpectTest.java index d361525492..2119ebc268 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionApiExpectTest.java @@ -34,7 +34,7 @@ import org.testng.annotations.Test; @Test(groups = "unit") public class RegionApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { - public static final String REGIONS_URL_PREFIX = "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions"; + public static final String REGIONS_URL_PREFIX = "https://www.googleapis.com/compute/v1/projects/myproject/regions"; public static final HttpRequest GET_REGION_REQ = HttpRequest .builder() diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionOperationApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionOperationApiExpectTest.java index fc496a6d90..8932d5eee8 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionOperationApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RegionOperationApiExpectTest.java @@ -41,10 +41,10 @@ import org.testng.annotations.Test; public class RegionOperationApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { private static final String OPERATIONS_URL_PREFIX = "https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/regions/us-central1/operations"; + ".com/compute/v1/projects/myproject/regions/us-central1/operations"; private static final String DELETE_OPERATIONS_URL_PREFIX = "https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/regions/us-central1/operations"; + ".com/compute/v1/projects/myproject/regions/us-central1/operations"; public static final HttpRequest GET_OPERATION_REQUEST = HttpRequest .builder() @@ -60,11 +60,11 @@ public class RegionOperationApiExpectTest extends BaseGoogleComputeEngineApiExpe SimpleDateFormatDateService dateService = new SimpleDateFormatDateService(); return Operation.builder().id("13053095055850848306") .selfLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/regions/us-central1/operations/operation-1354084865060-4cf88735faeb8" + + ".com/compute/v1/projects/myproject/regions/us-central1/operations/operation-1354084865060-4cf88735faeb8" + "-bbbb12cb")) .name("operation-1354084865060-4cf88735faeb8-bbbb12cb") .targetLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-address")) + ".com/compute/v1/projects/myproject/regions/us-central1/addresses/test-address")) .targetId("13053094017547040099") .status(Operation.Status.DONE) .user("user@developer.gserviceaccount.com") @@ -73,7 +73,7 @@ public class RegionOperationApiExpectTest extends BaseGoogleComputeEngineApiExpe .startTime(dateService.iso8601DateParse("2012-11-28T06:41:05.142")) .endTime(dateService.iso8601DateParse("2012-11-28T06:41:06.142")) .operationType("insert") - .region(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1")) + .region(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1")) .build(); } @@ -81,7 +81,7 @@ public class RegionOperationApiExpectTest extends BaseGoogleComputeEngineApiExpe return ListPage.builder() .kind(Resource.Kind.OPERATION_LIST) .id("projects/myproject/regions/us-central1/operations") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/operations")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/operations")) .addItem(expected()) .build(); } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiExpectTest.java index 8e89f6c169..e9c4f3dd8c 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/RouteApiExpectTest.java @@ -45,7 +45,7 @@ public class RouteApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { HttpRequest get = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/routes/default-route-c99ebfbed0e1f375") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/routes/default-route-c99ebfbed0e1f375") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -63,7 +63,7 @@ public class RouteApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { HttpRequest get = HttpRequest .builder() .method("GET") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/routes/default-route-c99ebfbed0e1f375") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/routes/default-route-c99ebfbed0e1f375") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -80,7 +80,7 @@ public class RouteApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("POST") - .endpoint("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/routes") + .endpoint("https://www.googleapis.com/compute/v1/projects/myproject/global/routes") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN) .payload(payloadFromResourceWithContentType("/route_insert.json", MediaType.APPLICATION_JSON)) @@ -94,13 +94,13 @@ public class RouteApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { insertRouteResponse).getRouteApiForProject("myproject"); assertEquals(api.createInNetwork("default-route-c99ebfbed0e1f375", - URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default"), + URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default"), new RouteOptions().addTag("fooTag") .addTag("barTag") .description("Default route to the virtual network.") .destRange("10.240.0.0/16") .priority(1000) - .nextHopNetwork(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default")) + .nextHopNetwork(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default")) ), new ParseOperationTest().expected()); } @@ -109,7 +109,7 @@ public class RouteApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/routes/default-route-c99ebfbed0e1f375") + ".com/compute/v1/projects/myproject/global/routes/default-route-c99ebfbed0e1f375") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -128,7 +128,7 @@ public class RouteApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("DELETE") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/routes/default-route-c99ebfbed0e1f375") + ".com/compute/v1/projects/myproject/global/routes/default-route-c99ebfbed0e1f375") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -145,7 +145,7 @@ public class RouteApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/routes") + ".com/compute/v1/projects/myproject/global/routes") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); @@ -164,7 +164,7 @@ public class RouteApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { .builder() .method("GET") .endpoint("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/routes") + ".com/compute/v1/projects/myproject/global/routes") .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer " + TOKEN).build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiExpectTest.java index c524d9987c..acd58e2529 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/SnapshotApiExpectTest.java @@ -34,7 +34,7 @@ import org.testng.annotations.Test; @Test(groups = "unit") public class SnapshotApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { - public static final String SNAPSHOT_URL_PREFIX = "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/snapshots"; + public static final String SNAPSHOT_URL_PREFIX = "https://www.googleapis.com/compute/v1/projects/myproject/global/snapshots"; public static final HttpRequest GET_SNAPSHOT_REQ = HttpRequest .builder() diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiExpectTest.java index 8ecc532111..8996dec80c 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneApiExpectTest.java @@ -34,7 +34,7 @@ import org.testng.annotations.Test; @Test(groups = "unit") public class ZoneApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { - public static final String ZONES_URL_PREFIX = "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones"; + public static final String ZONES_URL_PREFIX = "https://www.googleapis.com/compute/v1/projects/myproject/zones"; public static final HttpRequest GET_ZONE_REQ = HttpRequest .builder() diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneOperationApiExpectTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneOperationApiExpectTest.java index cfd49adf28..40ade48ca9 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneOperationApiExpectTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/ZoneOperationApiExpectTest.java @@ -41,7 +41,7 @@ import org.testng.annotations.Test; public class ZoneOperationApiExpectTest extends BaseGoogleComputeEngineApiExpectTest { private static final String OPERATIONS_URL_PREFIX = "https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/operations"; + ".com/compute/v1/projects/myproject/zones/us-central1-a/operations"; public static final HttpRequest GET_ZONE_OPERATION_REQUEST = HttpRequest .builder() @@ -57,11 +57,11 @@ public class ZoneOperationApiExpectTest extends BaseGoogleComputeEngineApiExpect SimpleDateFormatDateService dateService = new SimpleDateFormatDateService(); return Operation.builder().id("13053095055850848306") .selfLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8" + + ".com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8" + "-bbbb12cb")) .name("operation-1354084865060-4cf88735faeb8-bbbb12cb") .targetLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance")) + ".com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance")) .targetId("13053094017547040099") .status(Operation.Status.DONE) .user("user@developer.gserviceaccount.com") @@ -70,7 +70,7 @@ public class ZoneOperationApiExpectTest extends BaseGoogleComputeEngineApiExpect .startTime(dateService.iso8601DateParse("2012-11-28T06:41:05.142")) .endTime(dateService.iso8601DateParse("2012-11-28T06:41:06.142")) .operationType("insert") - .zone(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a")) + .zone(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a")) .build(); } @@ -78,7 +78,7 @@ public class ZoneOperationApiExpectTest extends BaseGoogleComputeEngineApiExpect return ListPage.builder() .kind(Resource.Kind.OPERATION_LIST) .id("projects/myproject/zones/us-central1-a/operations") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/operations")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations")) .addItem(expected()) .build(); } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeededTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeededTest.java index c9a2cff3c3..1001f87dd1 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeededTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/functions/CreateNetworkIfNeededTest.java @@ -50,7 +50,7 @@ public class CreateNetworkIfNeededTest { Network network = Network.builder().IPv4Range("0.0.0.0/0") .id("abcd").name("this-network") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/this-network")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/this-network")) .build(); Operation createOp = createMock(Operation.class); @@ -95,7 +95,7 @@ public class CreateNetworkIfNeededTest { Network network = Network.builder().IPv4Range("0.0.0.0/0") .id("abcd").name("this-network").gatewayIPv4("1.2.3.4") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/this-network")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/this-network")) .build(); Operation createOp = createMock(Operation.class); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandlerTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandlerTest.java index e406da0f1c..5afa7d01e7 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandlerTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/handlers/GoogleComputeEngineErrorHandlerTest.java @@ -40,7 +40,7 @@ public class GoogleComputeEngineErrorHandlerTest { public void test409MakesIllegalStateException() { assertCodeMakes( "POST", - URI.create("https://www.googleapis.com/compute/v1beta16"), + URI.create("https://www.googleapis.com/compute/v1"), 409, "HTTP/1.1 409 Conflict", "\"{\"code\":\"InvalidState\",\"message\":\"An incompatible transition has already been queued for this" + diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiLiveTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiLiveTest.java index 383506f122..449151542e 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiLiveTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/internal/BaseGoogleComputeEngineApiLiveTest.java @@ -45,7 +45,7 @@ import com.google.inject.name.Names; */ public class BaseGoogleComputeEngineApiLiveTest extends BaseApiLiveTest { - protected static final String API_URL_PREFIX = "https://www.googleapis.com/compute/v1beta16/projects/"; + protected static final String API_URL_PREFIX = "https://www.googleapis.com/compute/v1/projects/"; protected static final String ZONE_API_URL_SUFFIX = "/zones/"; protected static final String DEFAULT_ZONE_NAME = "us-central1-a"; diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressListTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressListTest.java index e1673579ab..8450f3f198 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressListTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressListTest.java @@ -47,17 +47,17 @@ public class ParseAddressListTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(Kind.ADDRESS_LIST) .id("projects/myproject/regions/us-central1/addresses") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses")) .items(ImmutableSet.of(new ParseAddressTest().expected(), Address.builder() .id("4881363978908129158") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2013-07-26T14:08:21.552-07:00")) .status("RESERVED") - .region(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1")) + .region(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1")) .name("test-ip2") .description("") .address("173.255.118.115") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-ip2")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-ip2")) .build()) ).build(); } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressTest.java index 7f44345286..0745d40104 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseAddressTest.java @@ -44,11 +44,11 @@ public class ParseAddressTest extends BaseGoogleComputeEngineParseTest

.id("4439373783165447583") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2013-07-26T13:57:20.204-07:00")) .status("RESERVED") - .region(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1")) + .region(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1")) .name("test-ip1") .description("") .address("173.255.115.190") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-ip1")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-ip1")) .build(); } } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskListTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskListTest.java index 825aee5389..a6cc3ab092 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskListTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskListTest.java @@ -47,16 +47,16 @@ public class ParseDiskListTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(Resource.Kind.DISK_LIST) .id("projects/myproject/zones/us-central1-a/disks") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks")) .items(ImmutableSet.of(Disk.builder() .id("13050421646334304115") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2012-11-25T01:38:48.306")) .selfLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1")) + ".com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1")) .name("testimage1") .sizeGb(1) .zone(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a")) + ".com/compute/v1/projects/myproject/zones/us-central1-a")) .status("READY") .build()) ).build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTest.java index 5e84fa9dfd..a60a77e3f2 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseDiskTest.java @@ -43,10 +43,10 @@ public class ParseDiskTest extends BaseGoogleComputeEngineParseTest { return Disk.builder() .id("13050421646334304115") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2012-11-25T01:38:48.306")) - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1")) .name("testimage1") .sizeGb(1) - .zone(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a")) + .zone(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a")) .status("READY") .build(); } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallListTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallListTest.java index 53f5f84c31..fc0dfac83a 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallListTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallListTest.java @@ -48,18 +48,18 @@ public class ParseFirewallListTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(Resource.Kind.FIREWALL_LIST) .id("projects/google/firewalls") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/google/global/firewalls")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/google/global/firewalls")) .items(ImmutableSet.of( new ParseFirewallTest().expected() , Firewall.builder() .id("12862241067393040785") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2012-04-13T03:05:04.365")) .selfLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/google/global/firewalls/default-ssh")) + ".com/compute/v1/projects/google/global/firewalls/default-ssh")) .name("default-ssh") .description("SSH allowed from anywhere") .network(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/google/global/networks/default")) + ".com/compute/v1/projects/google/global/networks/default")) .addSourceRange("0.0.0.0/0") .addAllowed(Firewall.Rule.builder() .IpProtocol(IpProtocol.TCP) diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallTest.java index 4fb1e30f31..20193c5562 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseFirewallTest.java @@ -44,10 +44,10 @@ public class ParseFirewallTest extends BaseGoogleComputeEngineParseTest expected() { return ListPage.builder() .kind(Resource.Kind.IMAGE_LIST) - .id("projects/google/global/images") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/google/global/images")) + .id("projects/centos-cloud/global/images") + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images")) .items(ImmutableSet.of(Image.builder() .id("12941197498378735318") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2012-07-16T22:16:13.468")) .selfLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/google/global/images/centos-6-2-v20120326")) + ".com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326")) .name("centos-6-2-v20120326") .description("DEPRECATED. CentOS 6.2 image; Created Mon, 26 Mar 2012 21:19:09 +0000") .sourceType("RAW") - .preferredKernel(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/google/kernels/gce-20120326")) .deprecated(Deprecated.builder() .state("DEPRECATED") - .replacement(URI.create("https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-v20130104")) + .replacement(URI.create("https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20130104")) .build()) .rawDisk( Image.RawDisk.builder() diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageTest.java index 6f1246fb94..ff3636f9aa 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseImageTest.java @@ -43,13 +43,11 @@ public class ParseImageTest extends BaseGoogleComputeEngineParseTest { return Image.builder() .id("12941197498378735318") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2012-07-16T22:16:13.468")) - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-2" + + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2" + "-v20120326")) .name("centos-6-2-v20120326") .description("DEPRECATED. CentOS 6.2 image; Created Mon, 26 Mar 2012 21:19:09 +0000") .sourceType("RAW") - .preferredKernel(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/google/kernels/gce-20120326")) .rawDisk( Image.RawDisk.builder() .source("") diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceListTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceListTest.java index 4821d2e974..05f3d88c51 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceListTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceListTest.java @@ -44,7 +44,7 @@ public class ParseInstanceListTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(Resource.Kind.INSTANCE_LIST) .id("projects/myproject/zones/us-central1-a/instances") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances")) .items(ImmutableSet.of(new ParseInstanceTest().expected())) .build(); } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceTest.java index 6643915ccc..d17b5b9cfe 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseInstanceTest.java @@ -45,21 +45,19 @@ public class ParseInstanceTest extends BaseGoogleComputeEngineParseTest> { - - @Override - public String resource() { - return "/kernel_list.json"; - } - - @Override - @Consumes(MediaType.APPLICATION_JSON) - public ListPage expected() { - return ListPage.builder() - .kind(Resource.Kind.KERNEL_LIST) - .id("projects/google/global/kernels") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/google/global/kernels")) - .items(ImmutableSet.of( - Kernel.builder() - .id("12941177846308850718") - .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse - ("2012-07-16T21:42:16.950")) - .selfLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/google/global/kernels/gce-20110524")) - .name("gce-20110524") - .description("DEPRECATED. Created Tue, 24 May 2011 00:48:22 +0000").build(), - Kernel.builder() - .id("12941177983348179280") - .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse - ("2012-07-16T21:42:31.166")) - .selfLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/google/global/kernels/gce-20110728")) - .name("gce-20110728") - .description("DEPRECATED. Created Thu, 28 Jul 2011 16:44:38 +0000") - .deprecated(org.jclouds.googlecomputeengine.domain.Deprecated.builder() - .state("OBSOLETE") - .replacement(URI.create("https://www.googleapis.com/compute/v1beta16/projects/google/global/kernels/gce-v20130603")) - .build()) - .build() - )).build(); - } -} diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseKernelTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseKernelTest.java deleted file mode 100644 index 1770b96ba6..0000000000 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseKernelTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.googlecomputeengine.parse; - -import java.net.URI; - -import javax.ws.rs.Consumes; -import javax.ws.rs.core.MediaType; - -import org.jclouds.date.internal.SimpleDateFormatDateService; -import org.jclouds.googlecomputeengine.domain.Kernel; -import org.jclouds.googlecomputeengine.internal.BaseGoogleComputeEngineParseTest; -import org.testng.annotations.Test; - -/** - * @author David Alves - */ -@Test(groups = "unit") -public class ParseKernelTest extends BaseGoogleComputeEngineParseTest { - - @Override - public String resource() { - return "/kernel.json"; - } - - @Override - @Consumes(MediaType.APPLICATION_JSON) - public Kernel expected() { - return Kernel.builder() - .id("12941177846308850718") - .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2012-07-16T21:42:16.950")) - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/google/global/kernels/gce-20110524")) - .name("gce-20110524") - .description("DEPRECATED. Created Tue, 24 May 2011 00:48:22 +0000") - .build(); - } -} diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeListTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeListTest.java index 3896dd31ec..223427b41a 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeListTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseMachineTypeListTest.java @@ -46,12 +46,12 @@ public class ParseMachineTypeListTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(MACHINE_TYPE_LIST) .id("projects/myproject/machineTypes") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes")) .addItem(MachineType.builder() .id("4618642685664990776") .creationTimestamp(dateService.iso8601DateParse("2013-04-25T13:32:49.088-07:00")) .selfLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/f1-micro")) + ".com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/f1-micro")) .zone("us-central1-a") .name("f1-micro") .description("1 vCPU (shared physical core) and 0.6 GB RAM") @@ -65,7 +65,7 @@ public class ParseMachineTypeListTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(Resource.Kind.NETWORK_LIST) .id("projects/myproject/networks") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/networks")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/networks")) .items(ImmutableSet.of(new ParseNetworkTest().expected())) .build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkTest.java index 223955e5d1..17c98b393d 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseNetworkTest.java @@ -41,7 +41,7 @@ public class ParseNetworkTest extends BaseGoogleComputeEngineParseTest return Network.builder() .id("13024414170909937976") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2012-10-24T20:13:19.967")) - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/networks/jclouds-test")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/networks/jclouds-test")) .name("default") .description("Default network for the project") .IPv4Range("10.0.0.0/8") diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationListTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationListTest.java index 1a5520d4ee..258a68101c 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationListTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationListTest.java @@ -42,7 +42,7 @@ public class ParseOperationListTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(Resource.Kind.OPERATION_LIST) .id("projects/myproject/global/operations") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/operations")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/operations")) .addItem(new ParseOperationTest().expected()) .build(); } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationTest.java index 21203fc25f..4114345fdf 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseOperationTest.java @@ -43,11 +43,11 @@ public class ParseOperationTest extends BaseGoogleComputeEngineParseTest return Project.builder() .id("13024414184846275913") .creationTimestamp(new Date(Long.parseLong("1351109596252"))) - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject")) .name("myproject") .description("") .commonInstanceMetadata(Metadata.builder() diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionListTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionListTest.java index 974574829d..06b94154d2 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionListTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRegionListTest.java @@ -47,7 +47,7 @@ public class ParseRegionListTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(Resource.Kind.REGION_LIST) .id("projects/myproject/regions") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/regions")) .items(ImmutableSet.of( new ParseRegionTest().expected(), Region.builder() @@ -55,11 +55,11 @@ public class ParseRegionListTest extends BaseGoogleComputeEngineParseTest { return Region.builder() .id("12912210600542709766") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2013-07-08T14:40:37.939-07:00")) - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1")) .name("us-central1") .description("us-central1") .status(Region.Status.UP) - .zones(ImmutableSet.of(URI.create("https://www.googleapis.com/compute/v1beta16/zones/us-central1-a"), - URI.create("https://www.googleapis.com/compute/v1beta16/zones/us-central1-b"))) + .zones(ImmutableSet.of(URI.create("https://www.googleapis.com/compute/v1/zones/us-central1-a"), + URI.create("https://www.googleapis.com/compute/v1/zones/us-central1-b"))) .addQuota("INSTANCES", 0, 8) .addQuota("CPUS", 0, 8) .addQuota("EPHEMERAL_ADDRESSES", 0, 8) diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteListTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteListTest.java index 6f9783b6b4..8596f23b7e 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteListTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteListTest.java @@ -47,18 +47,18 @@ public class ParseRouteListTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(Kind.ROUTE_LIST) .id("projects/myproject/global/routes") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/routes")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/routes")) .items(ImmutableSet.of(new ParseRouteTest().expected(), Route.builder() - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/routes/default-route-fc92a41ecb5a8d17")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/routes/default-route-fc92a41ecb5a8d17")) .id("507025480040058551") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2013-07-08T14:40:38.502-07:00")) .name("default-route-fc92a41ecb5a8d17") .description("Default route to the Internet.") - .network(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default")) + .network(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default")) .destRange("0.0.0.0/0") .priority(1000) - .nextHopGateway(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/gateways/default-internet-gateway")) + .nextHopGateway(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/gateways/default-internet-gateway")) .build()) ).build(); } diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteTest.java index 1f76d5fc49..f39d8ef45a 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseRouteTest.java @@ -43,15 +43,15 @@ public class ParseRouteTest extends BaseGoogleComputeEngineParseTest { @Consumes(MediaType.APPLICATION_JSON) public Route expected() { return Route.builder() - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/routes/default-route-c99ebfbed0e1f375")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/routes/default-route-c99ebfbed0e1f375")) .id("7241926205630356071") .name("default-route-c99ebfbed0e1f375") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2013-07-08T14:40:38.502-07:00")) .description("Default route to the virtual network.") - .network(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default")) + .network(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default")) .destRange("10.240.0.0/16") .priority(1000) - .nextHopNetwork(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default")) + .nextHopNetwork(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default")) .tags(ImmutableSet.of("fooTag", "barTag")) .build(); diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotListTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotListTest.java index 5df12f42ff..33f8d19288 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotListTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotListTest.java @@ -47,17 +47,17 @@ public class ParseSnapshotListTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(Kind.SNAPSHOT_LIST) .id("projects/myproject/global/snapshots") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/snapshots")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/snapshots")) .items(ImmutableSet.of( new ParseSnapshotTest().expected(), Snapshot.builder() .selfLink(URI.create("https://www.googleapis" + - ".com/compute/v1beta16/projects/myproject/global/snapshots/test-snap2")) + ".com/compute/v1/projects/myproject/global/snapshots/test-snap2")) .id("13895715048576107883") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse ("2013-07-26T12:57:01.927-07:00")) .status("READY") .sizeGb(10) - .sourceDisk(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1")) + .sourceDisk(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1")) .name("test-snap2") .description("") .sourceDiskId("8243603669926824540") diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotTest.java index 7c07a09b5f..ef6ed875a7 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/parse/ParseSnapshotTest.java @@ -41,12 +41,12 @@ public class ParseSnapshotTest extends BaseGoogleComputeEngineParseTestbuilder() .kind(Resource.Kind.ZONE_LIST) .id("projects/myproject/zones") - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones")) .items(ImmutableSet.of( new ParseZoneTest().expected() , Zone.builder() @@ -55,7 +55,7 @@ public class ParseZoneListTest extends BaseGoogleComputeEngineParseTest { return Zone.builder() .id("13020128040171887099") .creationTimestamp(new SimpleDateFormatDateService().iso8601DateParse("2012-10-19T16:42:54.131")) - .selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a")) + .selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a")) .name("us-central1-a") .description("us-central1-a") .status(Zone.Status.DOWN) diff --git a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/predicates/NetworkFirewallPredicatesTest.java b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/predicates/NetworkFirewallPredicatesTest.java index 8ad72a0098..58ed81cd6b 100644 --- a/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/predicates/NetworkFirewallPredicatesTest.java +++ b/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/predicates/NetworkFirewallPredicatesTest.java @@ -42,8 +42,8 @@ public class NetworkFirewallPredicatesTest { public static Firewall getFwForTestSourceTags() { Firewall.Builder builder = Firewall.builder(); - builder.network(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test")); - builder.selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test")); + builder.network(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test")); + builder.selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls/jclouds-test")); builder.addSourceTag("tag-1"); builder.addAllowed(Firewall.Rule.builder().IpProtocol(IpProtocol.TCP) .addPortRange(1, 10).build()); @@ -60,8 +60,8 @@ public class NetworkFirewallPredicatesTest { public static Firewall getFwForTestSourceTagsExact() { Firewall.Builder builder = Firewall.builder(); - builder.network(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test")); - builder.selfLink(URI.create("https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test")); + builder.network(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test")); + builder.selfLink(URI.create("https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls/jclouds-test")); builder.addSourceTag("tag-1"); builder.addAllowed(Firewall.Rule.builder().IpProtocol(IpProtocol.TCP) .addPortRange(1, 10).build()); diff --git a/providers/google-compute-engine/src/test/resources/GoogleComputeEngineServiceExpectTest/firewall_list.json b/providers/google-compute-engine/src/test/resources/GoogleComputeEngineServiceExpectTest/firewall_list.json index 9013dfcbbe..c965349447 100644 --- a/providers/google-compute-engine/src/test/resources/GoogleComputeEngineServiceExpectTest/firewall_list.json +++ b/providers/google-compute-engine/src/test/resources/GoogleComputeEngineServiceExpectTest/firewall_list.json @@ -1,17 +1,17 @@ { "kind": "compute#firewallList", "id": "projects/google/firewalls", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/firewalls", + "selfLink": "https://www.googleapis.com/compute/v1/projects/google/global/firewalls", "items": [ { "kind": "compute#firewall", "id": "12862241031274216284", "creationTimestamp": "2012-04-13T03:05:02.855", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test-delete", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls/jclouds-test-delete", "name": "jclouds-test-delete", "description": "Internal traffic from default allowed", - "network": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test-delete", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test-delete", "sourceRanges": [ "10.0.0.0/8" ], diff --git a/providers/google-compute-engine/src/test/resources/GoogleComputeEngineServiceExpectTest/network_get.json b/providers/google-compute-engine/src/test/resources/GoogleComputeEngineServiceExpectTest/network_get.json index 02a47139a7..e9308f0b91 100644 --- a/providers/google-compute-engine/src/test/resources/GoogleComputeEngineServiceExpectTest/network_get.json +++ b/providers/google-compute-engine/src/test/resources/GoogleComputeEngineServiceExpectTest/network_get.json @@ -2,7 +2,7 @@ "kind": "compute#network", "id": "13024414170909937976", "creationTimestamp": "2012-10-24T20:13:19.967", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test-delete", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test-delete", "name": "jclouds-test-delete", "description": "Default network for the project", "IPv4Range": "10.0.0.0/8", diff --git a/providers/google-compute-engine/src/test/resources/address_get.json b/providers/google-compute-engine/src/test/resources/address_get.json index 8aabc697f8..f93e497bb6 100644 --- a/providers/google-compute-engine/src/test/resources/address_get.json +++ b/providers/google-compute-engine/src/test/resources/address_get.json @@ -4,9 +4,9 @@ "id": "4439373783165447583", "creationTimestamp": "2013-07-26T13:57:20.204-07:00", "status": "RESERVED", - "region": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1", + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", "name": "test-ip1", "description": "", "address": "173.255.115.190", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-ip1" + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-ip1" } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/address_list.json b/providers/google-compute-engine/src/test/resources/address_list.json index 8a2be5c11a..cbfa9d58ff 100644 --- a/providers/google-compute-engine/src/test/resources/address_list.json +++ b/providers/google-compute-engine/src/test/resources/address_list.json @@ -1,6 +1,6 @@ { "kind": "compute#addressList", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses", "id": "projects/myproject/regions/us-central1/addresses", "items": [ { @@ -9,11 +9,11 @@ "id": "4439373783165447583", "creationTimestamp": "2013-07-26T13:57:20.204-07:00", "status": "RESERVED", - "region": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1", + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", "name": "test-ip1", "description": "", "address": "173.255.115.190", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-ip1" + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-ip1" }, { @@ -21,11 +21,11 @@ "id": "4881363978908129158", "creationTimestamp": "2013-07-26T14:08:21.552-07:00", "status": "RESERVED", - "region": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1", + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", "name": "test-ip2", "description": "", "address": "173.255.118.115", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-ip2" + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-ip2" } ] } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/disk_get.json b/providers/google-compute-engine/src/test/resources/disk_get.json index b895279bf3..88ddd54667 100644 --- a/providers/google-compute-engine/src/test/resources/disk_get.json +++ b/providers/google-compute-engine/src/test/resources/disk_get.json @@ -2,9 +2,9 @@ "kind": "compute#disk", "id": "13050421646334304115", "creationTimestamp": "2012-11-25T01:38:48.306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1", "name": "testimage1", "sizeGb": "1", - "zone": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", "status": "READY" } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/disk_list.json b/providers/google-compute-engine/src/test/resources/disk_list.json index e0db2007a2..bdca33d699 100644 --- a/providers/google-compute-engine/src/test/resources/disk_list.json +++ b/providers/google-compute-engine/src/test/resources/disk_list.json @@ -1,16 +1,16 @@ { "kind": "compute#diskList", "id": "projects/myproject/zones/us-central1-a/disks", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks", "items": [ { "kind": "compute#disk", "id": "13050421646334304115", "creationTimestamp": "2012-11-25T01:38:48.306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1", "name": "testimage1", "sizeGb": "1", - "zone": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", "status": "READY" } ] diff --git a/providers/google-compute-engine/src/test/resources/firewall_get.json b/providers/google-compute-engine/src/test/resources/firewall_get.json index 62f8a42136..74ced7447f 100644 --- a/providers/google-compute-engine/src/test/resources/firewall_get.json +++ b/providers/google-compute-engine/src/test/resources/firewall_get.json @@ -3,10 +3,10 @@ "kind": "compute#firewall", "id": "12862241031274216284", "creationTimestamp": "2012-04-13T03:05:02.855", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls/jclouds-test", "name": "jclouds-test", "description": "Internal traffic from default allowed", - "network": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test", "sourceRanges": [ "10.0.0.0/8" ], diff --git a/providers/google-compute-engine/src/test/resources/firewall_insert.json b/providers/google-compute-engine/src/test/resources/firewall_insert.json index da4d5e8f0e..fabe1bddd5 100644 --- a/providers/google-compute-engine/src/test/resources/firewall_insert.json +++ b/providers/google-compute-engine/src/test/resources/firewall_insert.json @@ -1 +1 @@ -{"name":"%s","network":"https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/%s","sourceRanges":[%s],"sourceTags":[%s],"targetTags":[%s],"allowed":[{"IPProtocol":"tcp","ports":[%s]}]} \ No newline at end of file +{"name":"%s","network":"https://www.googleapis.com/compute/v1/projects/myproject/global/networks/%s","sourceRanges":[%s],"sourceTags":[%s],"targetTags":[%s],"allowed":[{"IPProtocol":"tcp","ports":[%s]}]} \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/firewall_list.json b/providers/google-compute-engine/src/test/resources/firewall_list.json index 95d6a41676..ab7d0b7f7b 100644 --- a/providers/google-compute-engine/src/test/resources/firewall_list.json +++ b/providers/google-compute-engine/src/test/resources/firewall_list.json @@ -1,17 +1,17 @@ { "kind": "compute#firewallList", "id": "projects/google/firewalls", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/firewalls", + "selfLink": "https://www.googleapis.com/compute/v1/projects/google/global/firewalls", "items": [ { "kind": "compute#firewall", "id": "12862241031274216284", "creationTimestamp": "2012-04-13T03:05:02.855", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls/jclouds-test", "name": "jclouds-test", "description": "Internal traffic from default allowed", - "network": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/jclouds-test", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/jclouds-test", "sourceRanges": [ "10.0.0.0/8" ], @@ -38,10 +38,10 @@ "kind": "compute#firewall", "id": "12862241067393040785", "creationTimestamp": "2012-04-13T03:05:04.365", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/firewalls/default-ssh", + "selfLink": "https://www.googleapis.com/compute/v1/projects/google/global/firewalls/default-ssh", "name": "default-ssh", "description": "SSH allowed from anywhere", - "network": "https://www.googleapis.com/compute/v1beta16/projects/google/global/networks/default", + "network": "https://www.googleapis.com/compute/v1/projects/google/global/networks/default", "sourceRanges": [ "0.0.0.0/0" ], diff --git a/providers/google-compute-engine/src/test/resources/global_operation.json b/providers/google-compute-engine/src/test/resources/global_operation.json index a54aaf16ca..17d7748301 100644 --- a/providers/google-compute-engine/src/test/resources/global_operation.json +++ b/providers/google-compute-engine/src/test/resources/global_operation.json @@ -1,9 +1,9 @@ { "kind": "compute#operation", "id": "13053095055850848306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", - "targetLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test-delete", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls/jclouds-test-delete", "targetId": "13053094017547040099", "status": "DONE", "user": "user@developer.gserviceaccount.com", diff --git a/providers/google-compute-engine/src/test/resources/global_operation_list.json b/providers/google-compute-engine/src/test/resources/global_operation_list.json index fcc106e470..32b881ad39 100644 --- a/providers/google-compute-engine/src/test/resources/global_operation_list.json +++ b/providers/google-compute-engine/src/test/resources/global_operation_list.json @@ -1,14 +1,14 @@ { "kind": "compute#operationList", "id": "projects/myproject/global/operations", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/operations", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/operations", "items": [ { "kind": "compute#operation", "id": "13053095055850848306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", - "targetLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/firewalls/jclouds-test-delete", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/firewalls/jclouds-test-delete", "targetId": "13053094017547040099", "status": "DONE", "user": "user@developer.gserviceaccount.com", diff --git a/providers/google-compute-engine/src/test/resources/image_get.json b/providers/google-compute-engine/src/test/resources/image_get.json index 25fab88eae..23cb0d202f 100644 --- a/providers/google-compute-engine/src/test/resources/image_get.json +++ b/providers/google-compute-engine/src/test/resources/image_get.json @@ -2,11 +2,10 @@ "kind": "compute#image", "id": "12941197498378735318", "creationTimestamp": "2012-07-16T22:16:13.468", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-2-v20120326", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326", "name": "centos-6-2-v20120326", "description": "DEPRECATED. CentOS 6.2 image; Created Mon, 26 Mar 2012 21:19:09 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-20120326", "rawDisk": { "source": "", "containerType": "TAR" diff --git a/providers/google-compute-engine/src/test/resources/image_list.json b/providers/google-compute-engine/src/test/resources/image_list.json index 4078c04e66..6010f5a38c 100644 --- a/providers/google-compute-engine/src/test/resources/image_list.json +++ b/providers/google-compute-engine/src/test/resources/image_list.json @@ -1,20 +1,19 @@ { "kind": "compute#imageList", - "id": "projects/google/global/images", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images", + "id": "projects/centos-cloud/global/images", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images", "items": [ { "kind": "compute#image", "id": "12941197498378735318", "creationTimestamp": "2012-07-16T22:16:13.468", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-2-v20120326", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326", "name": "centos-6-2-v20120326", "description": "DEPRECATED. CentOS 6.2 image; Created Mon, 26 Mar 2012 21:19:09 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-20120326", "deprecated": { "state": "DEPRECATED", - "replacement": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-v20130104" + "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20130104" }, "rawDisk": { "source": "", diff --git a/providers/google-compute-engine/src/test/resources/image_list_empty.json b/providers/google-compute-engine/src/test/resources/image_list_empty.json new file mode 100644 index 0000000000..f082e082bd --- /dev/null +++ b/providers/google-compute-engine/src/test/resources/image_list_empty.json @@ -0,0 +1,6 @@ +{ + "kind": "compute#imageList", + "id": "projects/debian-cloud/global/images", + "selfLink": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images", + "items": [ ] +} diff --git a/providers/google-compute-engine/src/test/resources/image_list_multiple_page_1.json b/providers/google-compute-engine/src/test/resources/image_list_multiple_page_1.json index 224d0bea52..3ffcfd5e7d 100644 --- a/providers/google-compute-engine/src/test/resources/image_list_multiple_page_1.json +++ b/providers/google-compute-engine/src/test/resources/image_list_multiple_page_1.json @@ -1,21 +1,20 @@ { "kind": "compute#imageList", - "id": "projects/google/global/images", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images", + "id": "projects/centos-cloud/global/images", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images", "nextPageToken": "CgVJTUFHRRIbZ29vZ2xlLmNlbnRvcy02LTItdjIwMTIwNjIx", "items": [ { "kind": "compute#image", "id": "12941197498378735318", "creationTimestamp": "2012-07-16T15:16:13.468-07:00", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-2-v20120326", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120326", "name": "centos-6-2-v20120326", "description": "DEPRECATED. CentOS 6.2 image; Created Mon, 26 Mar 2012 21:19:09 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-20120326", "deprecated": { "state": "DELETED", - "replacement": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-v20130104" + "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20130104" }, "rawDisk": { "source": "", @@ -26,11 +25,10 @@ "kind": "compute#image", "id": "12894486577628239762", "creationTimestamp": "2012-05-21T13:15:37.215-07:00", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-2-v20120503", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120503", "name": "centos-6-2-v20120503", "description": "CentOS 6.2; Created Wed, 09 May 2012 11:55:54 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-20120326", "rawDisk": { "source": "", "containerType": "TAR" @@ -40,14 +38,13 @@ "kind": "compute#image", "id": "12917726455664967299", "creationTimestamp": "2012-06-18T11:05:30.664-07:00", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-2-v20120611", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120611", "name": "centos-6-2-v20120611", "description": "CentOS 6.2; Created Mon, 11 Jun 2012 13:15:44 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-20120611", "deprecated": { "state": "DEPRECATED", - "replacement": "https://www.googleapis.com/compute/v1beta16/projects/debian-cloud/global/images/debian-7-wheezy-20130509" + "replacement": "https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/debian-7-wheezy-20130509" }, "rawDisk": { "source": "", diff --git a/providers/google-compute-engine/src/test/resources/image_list_multiple_page_2.json b/providers/google-compute-engine/src/test/resources/image_list_multiple_page_2.json index c993ff15f5..b7b736ae77 100644 --- a/providers/google-compute-engine/src/test/resources/image_list_multiple_page_2.json +++ b/providers/google-compute-engine/src/test/resources/image_list_multiple_page_2.json @@ -1,18 +1,17 @@ { "kind": "compute#imageList", - "id": "projects/google/global/images", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images", + "id": "projects/centos-cloud/global/images", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images", "nextPageToken": "CgVJTUFHRRIbZ29vZ2xlLmdjZWwtMTAtMDQtdjIwMTIxMTA2", "items": [ { "kind": "compute#image", "id": "12920641029336858796", "creationTimestamp": "2012-06-21T22:59:56.392-07:00", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-2-v20120621", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-2-v20120621", "name": "centos-6-2-v20120621", "description": "CentOS 6.2; Created Thu, 21 Jun 2012 14:22:21 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-20120621", "rawDisk": { "source": "", "containerType": "TAR" @@ -22,11 +21,10 @@ "kind": "compute#image", "id": "12994279803511049620", "creationTimestamp": "2012-09-18T08:52:47.584-07:00", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-v20120912", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20120912", "name": "centos-6-v20120912", "description": "CentOS 6; Created Wed, 12 Sep 2012 00:00:00 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-v20120912", "rawDisk": { "source": "", "containerType": "TAR" @@ -36,11 +34,10 @@ "kind": "compute#image", "id": "13037720516378381209", "creationTimestamp": "2012-11-09T11:40:41.079-08:00", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/centos-6-v20121106", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-6-v20121106", "name": "centos-6-v20121106", "description": "SCSI-enabled CentOS 6; Created Tue, 06 Nov 2012 00:00:00 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-v20121106", "rawDisk": { "source": "", "containerType": "TAR" diff --git a/providers/google-compute-engine/src/test/resources/image_list_single_page.json b/providers/google-compute-engine/src/test/resources/image_list_single_page.json index 06296c1b7f..4136f46d36 100644 --- a/providers/google-compute-engine/src/test/resources/image_list_single_page.json +++ b/providers/google-compute-engine/src/test/resources/image_list_single_page.json @@ -1,17 +1,16 @@ { "kind": "compute#imageList", - "id": "projects/google/global/images", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images", + "id": "projects/centos-cloud/global/images", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images", "items": [ { "kind": "compute#image", "id": "13037722963789596520", "creationTimestamp": "2012-11-09T11:43:28.749-08:00", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/gcel-10-04-v20121106", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/gcel-10-04-v20121106", "name": "gcel-10-04-v20121106", "description": "SCSI-enabled GCEL 10.04 LTS; Created Tue, 06 Nov 2012 00:00:00 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-v20121106", "rawDisk": { "source": "", "containerType": "TAR" @@ -21,11 +20,10 @@ "kind": "compute#image", "id": "13037721421359523565", "creationTimestamp": "2012-11-09T11:40:51.994-08:00", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/gcel-12-04-v20121106", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/gcel-12-04-v20121106", "name": "gcel-12-04-v20121106", "description": "SCSI-enabled GCEL 12.04 LTS; Created Tue, 06 Nov 2012 00:00:00 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-v20121106", "rawDisk": { "source": "", "containerType": "TAR" @@ -35,14 +33,13 @@ "kind": "compute#image", "id": "12941198995845323366", "creationTimestamp": "2012-07-16T15:18:50.405-07:00", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/ubuntu-10-04-v20110728", + "selfLink": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/ubuntu-10-04-v20110728", "name": "ubuntu-10-04-v20110728", "description": "DEPRECATED. GCEL 10.04 LTS; Created Thu, 28 Jul 2011 16:45:51 +0000", "sourceType": "RAW", - "preferredKernel": "https://www.googleapis.com/compute/v1beta16/projects/google/kernels/gce-20110728", "deprecated": { "state": "DELETED", - "replacement": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/gcel-10-04-v20130104" + "replacement": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/gcel-10-04-v20130104" }, "rawDisk": { "source": "", diff --git a/providers/google-compute-engine/src/test/resources/instance_add_access_config.json b/providers/google-compute-engine/src/test/resources/instance_add_access_config.json index 9c709561ee..fe4fcf0228 100644 --- a/providers/google-compute-engine/src/test/resources/instance_add_access_config.json +++ b/providers/google-compute-engine/src/test/resources/instance_add_access_config.json @@ -1,4 +1,4 @@ -POST https://www.googleapis.com/compute/v1beta16/projects/jclouds-gce/zones/us-central1-a/instances/test-instance/addAccessConfig?network_interface=nic0&key={YOUR_API_KEY} +POST https://www.googleapis.com/compute/v1/projects/jclouds-gce/zones/us-central1-a/instances/test-instance/addAccessConfig?network_interface=nic0&key={YOUR_API_KEY} Content-Type: application/json Authorization: Bearer ya29.AHES6ZRyNKVHwnMPUvZitAuA8mR8b0lcWh1bMI5UQ5bgsJ4j diff --git a/providers/google-compute-engine/src/test/resources/instance_attach_disk.json b/providers/google-compute-engine/src/test/resources/instance_attach_disk.json index f38e4c1916..8fc35bcd0a 100644 --- a/providers/google-compute-engine/src/test/resources/instance_attach_disk.json +++ b/providers/google-compute-engine/src/test/resources/instance_attach_disk.json @@ -1,6 +1,6 @@ { "type": "PERSISTENT", "mode": "READ_ONLY", - "source": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1", + "source": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1", "boot": false } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/instance_get.json b/providers/google-compute-engine/src/test/resources/instance_get.json index 215e73dd62..c38ae7779e 100644 --- a/providers/google-compute-engine/src/test/resources/instance_get.json +++ b/providers/google-compute-engine/src/test/resources/instance_get.json @@ -3,18 +3,17 @@ "id": "13051190678907570425", "description": "desc", "creationTimestamp": "2012-11-25T23:48:20.758", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-0", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-0", "name": "test-0", - "image": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/gcel-12-04-v20121106", - "machineType": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", + "machineType": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", "status": "RUNNING", - "zone": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", "networkInterfaces": [ { "kind": "compute#instanceNetworkInterface", "name": "nic0", "networkIP": "10.240.121.115", - "network": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default" + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default" } ], "disks": [ @@ -23,8 +22,9 @@ "type": "PERSISTENT", "mode": "READ_WRITE", "deviceName": "test", - "source": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/test", - "index": 0 + "source": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/test", + "index": 0, + "boot": true } ], "serviceAccounts": [ @@ -41,6 +41,14 @@ { "key": "aKey", "value": "aValue" + }, + { + "key": "jclouds-image", + "value": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/gcel-12-04-v20121106" + }, + { + "key": "jclouds-delete-boot-disk", + "value": "true" } ], "fingerprint": "efgh" diff --git a/providers/google-compute-engine/src/test/resources/instance_insert.json b/providers/google-compute-engine/src/test/resources/instance_insert.json index ad9f8b3d11..0ce3c53927 100644 --- a/providers/google-compute-engine/src/test/resources/instance_insert.json +++ b/providers/google-compute-engine/src/test/resources/instance_insert.json @@ -1 +1 @@ -{"name":"test-0","description":"desc","machineType":"https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1","image":"https://www.googleapis.com/compute/v1beta16/projects/google/global/images/gcel-12-04-v20121106","serviceAccounts":[{"email":"default","scopes":["myscope"]}],"networkInterfaces":[{"network":"https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default","accessConfigs":[{"type":"ONE_TO_ONE_NAT"}]}],"disks":[{"mode":"READ_WRITE","source":"https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/test","type":"PERSISTENT"}],"metadata":{"kind":"compute#metadata","items":[{"key":"aKey","value":"aValue"}]}} \ No newline at end of file +{"name":"test-0","description":"desc","machineType":"https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1","serviceAccounts":[{"email":"default","scopes":["myscope"]}],"networkInterfaces":[{"network":"https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default","accessConfigs":[{"type":"ONE_TO_ONE_NAT"}]}],"disks":[{"mode":"READ_WRITE","source":"https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/test","deleteOnTerminate":true,"boot":false,"type":"PERSISTENT"}],"metadata":{"kind":"compute#metadata","items":[{"key":"aKey","value":"aValue"}]}} \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/instance_insert_simple.json b/providers/google-compute-engine/src/test/resources/instance_insert_simple.json index 6d5bc2849e..038e7f8b43 100644 --- a/providers/google-compute-engine/src/test/resources/instance_insert_simple.json +++ b/providers/google-compute-engine/src/test/resources/instance_insert_simple.json @@ -1 +1 @@ -{"name":"test-1","machineType":"https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1","image":"https://www.googleapis.com/compute/v1beta16/projects/google/global/images/gcel-12-04-v20121106","serviceAccounts":[],"networkInterfaces":[{"network":"https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default","accessConfigs":[]}]} \ No newline at end of file +{"name":"test-1","machineType":"https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1","serviceAccounts":[],"networkInterfaces":[{"network":"https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default","accessConfigs":[]}]} \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/instance_list.json b/providers/google-compute-engine/src/test/resources/instance_list.json index f50f022351..7e9595c52f 100644 --- a/providers/google-compute-engine/src/test/resources/instance_list.json +++ b/providers/google-compute-engine/src/test/resources/instance_list.json @@ -1,25 +1,24 @@ { "kind": "compute#instanceList", "id": "projects/myproject/zones/us-central1-a/instances", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances", "items": [ { "kind": "compute#instance", "id": "13051190678907570425", "description": "desc", "creationTimestamp": "2012-11-25T23:48:20.758", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/test-0", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/test-0", "name": "test-0", - "image": "https://www.googleapis.com/compute/v1beta16/projects/google/global/images/gcel-12-04-v20121106", - "machineType": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", + "machineType": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", "status": "RUNNING", - "zone": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", "networkInterfaces": [ { "kind": "compute#instanceNetworkInterface", "name": "nic0", "networkIP": "10.240.121.115", - "network": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default" + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default" } ], "disks": [ @@ -28,8 +27,9 @@ "type": "PERSISTENT", "mode": "READ_WRITE", "deviceName": "test", - "source": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/test", - "index": 0 + "source": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/test", + "index": 0, + "boot": true } ], "serviceAccounts": [ @@ -46,6 +46,14 @@ { "key": "aKey", "value": "aValue" + }, + { + "key": "jclouds-image", + "value": "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/gcel-12-04-v20121106" + }, + { + "key": "jclouds-delete-boot-disk", + "value": "true" } ], "fingerprint": "efgh" diff --git a/providers/google-compute-engine/src/test/resources/instance_list_central1b_empty.json b/providers/google-compute-engine/src/test/resources/instance_list_central1b_empty.json index e57923b9ec..51c8793c08 100644 --- a/providers/google-compute-engine/src/test/resources/instance_list_central1b_empty.json +++ b/providers/google-compute-engine/src/test/resources/instance_list_central1b_empty.json @@ -1,6 +1,6 @@ { "kind": "compute#instanceList", "id": "projects/myproject/zones/us-central1-b/instances", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-b/instances", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b/instances", "items": [ ] } diff --git a/providers/google-compute-engine/src/test/resources/kernel.json b/providers/google-compute-engine/src/test/resources/kernel.json deleted file mode 100644 index 4a0e525064..0000000000 --- a/providers/google-compute-engine/src/test/resources/kernel.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "kind": "compute#kernel", - "id": "12941177846308850718", - "creationTimestamp": "2012-07-16T21:42:16.950", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/kernels/gce-20110524", - "name": "gce-20110524", - "description": "DEPRECATED. Created Tue, 24 May 2011 00:48:22 +0000" -} \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/kernel_list.json b/providers/google-compute-engine/src/test/resources/kernel_list.json deleted file mode 100644 index 5f1a155a84..0000000000 --- a/providers/google-compute-engine/src/test/resources/kernel_list.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "kind": "compute#kernelList", - "id": "projects/google/global/kernels", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/kernels", - "items": [ - { - "kind": "compute#kernel", - "id": "12941177846308850718", - "creationTimestamp": "2012-07-16T21:42:16.950", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/kernels/gce-20110524", - "name": "gce-20110524", - "description": "DEPRECATED. Created Tue, 24 May 2011 00:48:22 +0000" - }, - { - "kind": "compute#kernel", - "id": "12941177983348179280", - "creationTimestamp": "2012-07-16T21:42:31.166", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/google/global/kernels/gce-20110728", - "name": "gce-20110728", - "description": "DEPRECATED. Created Thu, 28 Jul 2011 16:44:38 +0000", - "deprecated": { - "state": "OBSOLETE", - "replacement": "https://www.googleapis.com/compute/v1beta16/projects/google/global/kernels/gce-v20130603" - } - } - ] -} \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/machinetype.json b/providers/google-compute-engine/src/test/resources/machinetype.json index 5db7cba1b1..01692b33ff 100644 --- a/providers/google-compute-engine/src/test/resources/machinetype.json +++ b/providers/google-compute-engine/src/test/resources/machinetype.json @@ -2,7 +2,7 @@ "kind": "compute#machineType", "id": "12907738072351752276", "creationTimestamp": "2012-06-07T20:48:14.670", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", "name": "n1-standard-1", "description": "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk", "guestCpus": 1, diff --git a/providers/google-compute-engine/src/test/resources/machinetype_list.json b/providers/google-compute-engine/src/test/resources/machinetype_list.json index ba6a17373a..9acb7e0cde 100644 --- a/providers/google-compute-engine/src/test/resources/machinetype_list.json +++ b/providers/google-compute-engine/src/test/resources/machinetype_list.json @@ -1,7 +1,7 @@ { "kind": "compute#machineTypeList", "id": "projects/myproject/machineTypes", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes", "items": [ { "kind": "compute#machineType", @@ -15,13 +15,13 @@ "maximumPersistentDisks": 4, "maximumPersistentDisksSizeGb": "3072", "zone": "us-central1-a", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/f1-micro" + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/f1-micro" }, { "kind": "compute#machineType", "id": "12907738072351752276", "creationTimestamp": "2012-06-07T20:48:14.670", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-1", "name": "n1-standard-1", "description": "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk", "guestCpus": 1, @@ -35,7 +35,7 @@ "kind": "compute#machineType", "id": "12908560709887590691", "creationTimestamp": "2012-06-07T20:51:19.936", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-8-d", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/machineTypes/n1-standard-8-d", "name": "n1-standard-8-d", "description": "8 vCPUs, 30 GB RAM, a 10 GB ephemeral root disk, and 2 extra 1770 GB ephemeral disks", "guestCpus": 8, diff --git a/providers/google-compute-engine/src/test/resources/machinetype_list_central1b.json b/providers/google-compute-engine/src/test/resources/machinetype_list_central1b.json index 9fad0aacff..fe5974a7a6 100644 --- a/providers/google-compute-engine/src/test/resources/machinetype_list_central1b.json +++ b/providers/google-compute-engine/src/test/resources/machinetype_list_central1b.json @@ -1,13 +1,13 @@ { "kind": "compute#machineTypeList", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/abayer-jclouds-test1/zones/us-central1-b/machineTypes", + "selfLink": "https://www.googleapis.com/compute/v1/projects/abayer-jclouds-test1/zones/us-central1-b/machineTypes", "id": "projects/abayer-jclouds-test1/zones/us-central1-b/machineTypes", "items": [ { "kind": "compute#machineType", "id": "12907738072351752276", "creationTimestamp": "2012-06-07T20:48:14.670", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-b/machineTypes/n1-standard-0", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b/machineTypes/n1-standard-0", "name": "n1-standard-0", "description": "1 vCPU, 3.75 GB RAM, and a 10 GB ephemeral root disk", "guestCpus": 1, @@ -21,7 +21,7 @@ "kind": "compute#machineType", "id": "12908560709887590691", "creationTimestamp": "2012-06-07T20:51:19.936", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-b/machineTypes/n1-standard-8-d", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b/machineTypes/n1-standard-8-d", "name": "n1-standard-8-d", "description": "8 vCPUs, 30 GB RAM, a 10 GB ephemeral root disk, and 2 extra 1770 GB ephemeral disks", "guestCpus": 8, diff --git a/providers/google-compute-engine/src/test/resources/machinetype_list_central1b_empty.json b/providers/google-compute-engine/src/test/resources/machinetype_list_central1b_empty.json index f30b8ee171..73fe582435 100644 --- a/providers/google-compute-engine/src/test/resources/machinetype_list_central1b_empty.json +++ b/providers/google-compute-engine/src/test/resources/machinetype_list_central1b_empty.json @@ -1,6 +1,6 @@ { "kind": "compute#machineTypeList", "id": "projects/myproject/zones/us-central1-b/machineTypes", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-b/machineTypes", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b/machineTypes", "items": [] } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/network_get.json b/providers/google-compute-engine/src/test/resources/network_get.json index 1ba015cfcb..4a7a9cc2f8 100644 --- a/providers/google-compute-engine/src/test/resources/network_get.json +++ b/providers/google-compute-engine/src/test/resources/network_get.json @@ -2,7 +2,7 @@ "kind": "compute#network", "id": "13024414170909937976", "creationTimestamp": "2012-10-24T20:13:19.967", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/networks/jclouds-test", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/networks/jclouds-test", "name": "default", "description": "Default network for the project", "IPv4Range": "10.0.0.0/8", diff --git a/providers/google-compute-engine/src/test/resources/network_list.json b/providers/google-compute-engine/src/test/resources/network_list.json index 601ab7f38a..1d15f6e200 100644 --- a/providers/google-compute-engine/src/test/resources/network_list.json +++ b/providers/google-compute-engine/src/test/resources/network_list.json @@ -1,14 +1,14 @@ { "kind": "compute#networkList", "id": "projects/myproject/networks", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/networks", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/networks", "items": [ { "kind": "compute#network", "id": "13024414170909937976", "creationTimestamp": "2012-10-24T20:13:19.967", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/networks/jclouds-test", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/networks/jclouds-test", "name": "default", "description": "Default network for the project", "IPv4Range": "10.0.0.0/8", diff --git a/providers/google-compute-engine/src/test/resources/operation.json b/providers/google-compute-engine/src/test/resources/operation.json index d412876410..7ca83c8c5d 100644 --- a/providers/google-compute-engine/src/test/resources/operation.json +++ b/providers/google-compute-engine/src/test/resources/operation.json @@ -1,9 +1,9 @@ { "kind": "compute#operation", "id": "13053095055850848306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", - "targetLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", "targetId": "13053094017547040099", "status": "DONE", "user": "user@developer.gserviceaccount.com", @@ -12,6 +12,6 @@ "startTime": "2012-11-28T06:41:05.142", "endTime": "2012-11-28T06:41:06.142", "operationType": "insert", - "region": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1", - "zone": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a" + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/operation_error.json b/providers/google-compute-engine/src/test/resources/operation_error.json index f713765937..157f786b46 100644 --- a/providers/google-compute-engine/src/test/resources/operation_error.json +++ b/providers/google-compute-engine/src/test/resources/operation_error.json @@ -1,9 +1,9 @@ { "kind": "compute#operation", "id": "13053095055850848306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", - "targetLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", "targetId": "13053094017547040099", "status": "DONE", "user": "user@developer.gserviceaccount.com", @@ -21,6 +21,6 @@ ] }, "operationType": "insert", - "region": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1", - "zone": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a" + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/operation_list.json b/providers/google-compute-engine/src/test/resources/operation_list.json index 76c53f30de..c83980d2e4 100644 --- a/providers/google-compute-engine/src/test/resources/operation_list.json +++ b/providers/google-compute-engine/src/test/resources/operation_list.json @@ -1,14 +1,14 @@ { "kind": "compute#operationList", "id": "projects/myproject/operations", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/operations", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/operations", "items": [ { "kind": "compute#operation", "id": "13053095055850848306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", - "targetLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", "targetId": "13053094017547040099", "status": "DONE", "user": "user@developer.gserviceaccount.com", @@ -17,8 +17,8 @@ "startTime": "2012-11-28T06:41:05.142", "endTime": "2012-11-28T06:41:06.142", "operationType": "insert", - "region": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1", - "zone": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a" + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" } ] } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/project.json b/providers/google-compute-engine/src/test/resources/project.json index ab67638fd9..c195062227 100644 --- a/providers/google-compute-engine/src/test/resources/project.json +++ b/providers/google-compute-engine/src/test/resources/project.json @@ -2,7 +2,7 @@ "kind": "compute#project", "id": "13024414184846275913", "creationTimestamp": "2012-10-24T20:13:16.252", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject", "name": "myproject", "description": "", "commonInstanceMetadata": { diff --git a/providers/google-compute-engine/src/test/resources/region_get.json b/providers/google-compute-engine/src/test/resources/region_get.json index e72790cfec..069865d2a6 100644 --- a/providers/google-compute-engine/src/test/resources/region_get.json +++ b/providers/google-compute-engine/src/test/resources/region_get.json @@ -1,14 +1,14 @@ { "kind": "compute#region", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", "id": "12912210600542709766", "creationTimestamp": "2013-07-08T14:40:37.939-07:00", "name": "us-central1", "description": "us-central1", "status": "UP", "zones": [ - "https://www.googleapis.com/compute/v1beta16/zones/us-central1-a", - "https://www.googleapis.com/compute/v1beta16/zones/us-central1-b" + "https://www.googleapis.com/compute/v1/zones/us-central1-a", + "https://www.googleapis.com/compute/v1/zones/us-central1-b" ], "quotas": [ { diff --git a/providers/google-compute-engine/src/test/resources/region_list.json b/providers/google-compute-engine/src/test/resources/region_list.json index 4ab17dc348..ae0673e9d0 100644 --- a/providers/google-compute-engine/src/test/resources/region_list.json +++ b/providers/google-compute-engine/src/test/resources/region_list.json @@ -1,19 +1,19 @@ { "kind": "compute#regionList", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions", "id": "projects/myproject/regions", "items": [ { "kind": "compute#region", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1", "id": "12912210600542709766", "creationTimestamp": "2013-07-08T14:40:37.939-07:00", "name": "us-central1", "description": "us-central1", "status": "UP", "zones": [ - "https://www.googleapis.com/compute/v1beta16/zones/us-central1-a", - "https://www.googleapis.com/compute/v1beta16/zones/us-central1-b" + "https://www.googleapis.com/compute/v1/zones/us-central1-a", + "https://www.googleapis.com/compute/v1/zones/us-central1-b" ], "quotas": [ { @@ -65,14 +65,14 @@ }, { "kind": "compute#region", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central2", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central2", "id": "6396763663251190992", "creationTimestamp": "2013-07-08T14:40:37.939-07:00", "name": "us-central2", "description": "us-central2", "status": "UP", "zones": [ - "https://www.googleapis.com/compute/v1beta16/zones/us-central2-a" + "https://www.googleapis.com/compute/v1/zones/us-central2-a" ], "quotas": [ { diff --git a/providers/google-compute-engine/src/test/resources/region_operation.json b/providers/google-compute-engine/src/test/resources/region_operation.json index 6afe2460a5..67ac27d04d 100644 --- a/providers/google-compute-engine/src/test/resources/region_operation.json +++ b/providers/google-compute-engine/src/test/resources/region_operation.json @@ -1,9 +1,9 @@ { "kind": "compute#operation", "id": "13053095055850848306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", - "targetLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-address", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-address", "targetId": "13053094017547040099", "status": "DONE", "user": "user@developer.gserviceaccount.com", @@ -12,5 +12,5 @@ "startTime": "2012-11-28T06:41:05.142", "endTime": "2012-11-28T06:41:06.142", "operationType": "insert", - "region": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1" + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1" } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/region_operation_list.json b/providers/google-compute-engine/src/test/resources/region_operation_list.json index b883615b17..8a6d619ca8 100644 --- a/providers/google-compute-engine/src/test/resources/region_operation_list.json +++ b/providers/google-compute-engine/src/test/resources/region_operation_list.json @@ -1,14 +1,14 @@ { "kind": "compute#operationList", "id": "projects/myproject/regions/us-central1/operations", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/operations", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/operations", "items": [ { "kind": "compute#operation", "id": "13053095055850848306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", - "targetLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1/addresses/test-address", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1/addresses/test-address", "targetId": "13053094017547040099", "status": "DONE", "user": "user@developer.gserviceaccount.com", @@ -17,7 +17,7 @@ "startTime": "2012-11-28T06:41:05.142", "endTime": "2012-11-28T06:41:06.142", "operationType": "insert", - "region": "https://www.googleapis.com/compute/v1beta16/projects/myproject/regions/us-central1" + "region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-central1" } ] } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/route_get.json b/providers/google-compute-engine/src/test/resources/route_get.json index fd2376939b..be544f278d 100644 --- a/providers/google-compute-engine/src/test/resources/route_get.json +++ b/providers/google-compute-engine/src/test/resources/route_get.json @@ -1,14 +1,14 @@ { "kind": "compute#route", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/routes/default-route-c99ebfbed0e1f375", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/routes/default-route-c99ebfbed0e1f375", "id": "7241926205630356071", "creationTimestamp": "2013-07-08T14:40:38.502-07:00", "name": "default-route-c99ebfbed0e1f375", "description": "Default route to the virtual network.", - "network": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default", "destRange": "10.240.0.0/16", "priority": 1000, - "nextHopNetwork": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default", + "nextHopNetwork": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default", "tags": [ "fooTag", "barTag" ] } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/route_insert.json b/providers/google-compute-engine/src/test/resources/route_insert.json index 2c150206b8..68fff7d983 100644 --- a/providers/google-compute-engine/src/test/resources/route_insert.json +++ b/providers/google-compute-engine/src/test/resources/route_insert.json @@ -1 +1 @@ -{"name":"default-route-c99ebfbed0e1f375","description":"Default route to the virtual network.","network":"https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default","destRange":"10.240.0.0/16","priority":1000,"nextHopNetwork":"https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default","tags":["fooTag","barTag"]} \ No newline at end of file +{"name":"default-route-c99ebfbed0e1f375","description":"Default route to the virtual network.","network":"https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default","destRange":"10.240.0.0/16","priority":1000,"nextHopNetwork":"https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default","tags":["fooTag","barTag"]} \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/route_list.json b/providers/google-compute-engine/src/test/resources/route_list.json index bbb54dda60..5126ff1068 100644 --- a/providers/google-compute-engine/src/test/resources/route_list.json +++ b/providers/google-compute-engine/src/test/resources/route_list.json @@ -1,34 +1,34 @@ { "kind": "compute#routeList", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/routes", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/routes", "id": "projects/myproject/global/routes", "items": [ { "kind": "compute#route", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/routes/default-route-c99ebfbed0e1f375", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/routes/default-route-c99ebfbed0e1f375", "id": "7241926205630356071", "creationTimestamp": "2013-07-08T14:40:38.502-07:00", "name": "default-route-c99ebfbed0e1f375", "description": "Default route to the virtual network.", - "network": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default", "destRange": "10.240.0.0/16", "priority": 1000, - "nextHopNetwork": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default", + "nextHopNetwork": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default", "tags": [ "fooTag", "barTag" ] }, { "kind": "compute#route", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/routes/default-route-fc92a41ecb5a8d17", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/routes/default-route-fc92a41ecb5a8d17", "id": "507025480040058551", "creationTimestamp": "2013-07-08T14:40:38.502-07:00", "name": "default-route-fc92a41ecb5a8d17", "description": "Default route to the Internet.", - "network": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/networks/default", + "network": "https://www.googleapis.com/compute/v1/projects/myproject/global/networks/default", "destRange": "0.0.0.0/0", "priority": 1000, - "nextHopGateway": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/gateways/default-internet-gateway" + "nextHopGateway": "https://www.googleapis.com/compute/v1/projects/myproject/global/gateways/default-internet-gateway" } ] } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/snapshot_get.json b/providers/google-compute-engine/src/test/resources/snapshot_get.json index 16c89d266d..3ba287f5d4 100644 --- a/providers/google-compute-engine/src/test/resources/snapshot_get.json +++ b/providers/google-compute-engine/src/test/resources/snapshot_get.json @@ -1,12 +1,12 @@ { "kind": "compute#snapshot", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/snapshots/test-snap", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/snapshots/test-snap", "id": "9734455566806191190", "creationTimestamp": "2013-07-26T12:54:23.173-07:00", "status": "READY", "diskSizeGb": "10", - "sourceDisk": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1", + "sourceDisk": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1", "name": "test-snap", "description": "", "sourceDiskId": "8243603669926824540" diff --git a/providers/google-compute-engine/src/test/resources/snapshot_list.json b/providers/google-compute-engine/src/test/resources/snapshot_list.json index 13f0f99e28..431460f294 100644 --- a/providers/google-compute-engine/src/test/resources/snapshot_list.json +++ b/providers/google-compute-engine/src/test/resources/snapshot_list.json @@ -1,17 +1,17 @@ { "kind": "compute#snapshotList", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/snapshots", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/snapshots", "id": "projects/myproject/global/snapshots", "items": [ { "kind": "compute#snapshot", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/snapshots/test-snap", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/snapshots/test-snap", "id": "9734455566806191190", "creationTimestamp": "2013-07-26T12:54:23.173-07:00", "status": "READY", "diskSizeGb": "10", - "sourceDisk": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1", + "sourceDisk": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1", "name": "test-snap", "description": "", "sourceDiskId": "8243603669926824540" @@ -19,12 +19,12 @@ { "kind": "compute#snapshot", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/global/snapshots/test-snap2", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/global/snapshots/test-snap2", "id": "13895715048576107883", "creationTimestamp": "2013-07-26T12:57:01.927-07:00", "status": "READY", "diskSizeGb": "10", - "sourceDisk": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/disks/testimage1", + "sourceDisk": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/disks/testimage1", "name": "test-snap2", "description": "", "sourceDiskId": "8243603669926824540" diff --git a/providers/google-compute-engine/src/test/resources/zone_get.json b/providers/google-compute-engine/src/test/resources/zone_get.json index 7161e303f2..50cb3755f9 100644 --- a/providers/google-compute-engine/src/test/resources/zone_get.json +++ b/providers/google-compute-engine/src/test/resources/zone_get.json @@ -2,7 +2,7 @@ "kind": "compute#zone", "id": "13020128040171887099", "creationTimestamp": "2012-10-19T16:42:54.131", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", "name": "us-central1-a", "description": "us-central1-a", "status": "DOWN", diff --git a/providers/google-compute-engine/src/test/resources/zone_list.json b/providers/google-compute-engine/src/test/resources/zone_list.json index e696196ecf..ee4e17b9c3 100644 --- a/providers/google-compute-engine/src/test/resources/zone_list.json +++ b/providers/google-compute-engine/src/test/resources/zone_list.json @@ -1,13 +1,13 @@ { "kind": "compute#zoneList", "id": "projects/myproject/zones", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones", "items": [ { "kind": "compute#zone", "id": "13020128040171887099", "creationTimestamp": "2012-10-19T16:42:54.131", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", "name": "us-central1-a", "description": "us-central1-a", "status": "DOWN", @@ -24,7 +24,7 @@ "kind": "compute#zone", "id": "13024414164050619686", "creationTimestamp": "2012-10-24T20:13:19.271", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-b", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-b", "name": "us-central1-b", "description": "us-central1-b", "status": "UP", diff --git a/providers/google-compute-engine/src/test/resources/zone_list_short.json b/providers/google-compute-engine/src/test/resources/zone_list_short.json index e406cef5ab..711af99238 100644 --- a/providers/google-compute-engine/src/test/resources/zone_list_short.json +++ b/providers/google-compute-engine/src/test/resources/zone_list_short.json @@ -1,13 +1,13 @@ { "kind": "compute#zoneList", "id": "projects/myproject/zones", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones", "items": [ { "kind": "compute#zone", "id": "13020128040171887099", "creationTimestamp": "2012-10-19T16:42:54.131", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a", "name": "us-central1-a", "description": "us-central1-a", "status": "DOWN", diff --git a/providers/google-compute-engine/src/test/resources/zone_operation.json b/providers/google-compute-engine/src/test/resources/zone_operation.json index 4db38df845..c0c5b561f1 100644 --- a/providers/google-compute-engine/src/test/resources/zone_operation.json +++ b/providers/google-compute-engine/src/test/resources/zone_operation.json @@ -1,9 +1,9 @@ { "kind": "compute#operation", "id": "13053095055850848306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", - "targetLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", "targetId": "13053094017547040099", "status": "DONE", "user": "user@developer.gserviceaccount.com", @@ -12,5 +12,5 @@ "startTime": "2012-11-28T06:41:05.142", "endTime": "2012-11-28T06:41:06.142", "operationType": "insert", - "zone": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a" + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/zone_operation_error.json b/providers/google-compute-engine/src/test/resources/zone_operation_error.json index c942ae7e3d..d6d054a548 100644 --- a/providers/google-compute-engine/src/test/resources/zone_operation_error.json +++ b/providers/google-compute-engine/src/test/resources/zone_operation_error.json @@ -1,9 +1,9 @@ { "kind": "compute#operation", "id": "13053095055850848306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", - "targetLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", "targetId": "13053094017547040099", "status": "DONE", "user": "user@developer.gserviceaccount.com", @@ -21,5 +21,5 @@ ] }, "operationType": "insert", - "zone": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a" + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" } \ No newline at end of file diff --git a/providers/google-compute-engine/src/test/resources/zone_operation_list.json b/providers/google-compute-engine/src/test/resources/zone_operation_list.json index ef315427b6..77f1656af4 100644 --- a/providers/google-compute-engine/src/test/resources/zone_operation_list.json +++ b/providers/google-compute-engine/src/test/resources/zone_operation_list.json @@ -1,14 +1,14 @@ { "kind": "compute#operationList", "id": "projects/myproject/zones/us-central1-a/operations", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/operations", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations", "items": [ { "kind": "compute#operation", "id": "13053095055850848306", - "selfLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", + "selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/operations/operation-1354084865060-4cf88735faeb8-bbbb12cb", "name": "operation-1354084865060-4cf88735faeb8-bbbb12cb", - "targetLink": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", + "targetLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/instances/instance-api-live-test-instance", "targetId": "13053094017547040099", "status": "DONE", "user": "user@developer.gserviceaccount.com", @@ -17,7 +17,7 @@ "startTime": "2012-11-28T06:41:05.142", "endTime": "2012-11-28T06:41:06.142", "operationType": "insert", - "zone": "https://www.googleapis.com/compute/v1beta16/projects/myproject/zones/us-central1-a" + "zone": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a" } ] } \ No newline at end of file