http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DataDisk.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DataDisk.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DataDisk.java deleted file mode 100644 index 2d61509..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DataDisk.java +++ /dev/null @@ -1,160 +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.azurecompute.arm.domain; - -import org.jclouds.azurecompute.arm.util.GetEnumValue; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; -import com.google.common.base.CaseFormat; - -@AutoValue -public abstract class DataDisk implements Provisionable { - - public enum DiskCreateOptionTypes { - FROM_IMAGE, - EMPTY, - ATTACH, - UNRECOGNIZED; - - public static DiskCreateOptionTypes fromValue(final String text) { - return (DiskCreateOptionTypes) GetEnumValue.fromValueOrDefault(text, UNRECOGNIZED); - } - - @Override - public String toString() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()); - } - } - - public enum CachingTypes { - NONE, - READ_ONLY, - READ_WRITE, - UNRECOGNIZED; - - public static CachingTypes fromValue(final String text) { - for (CachingTypes type : CachingTypes.values()) { - if (type.toString().equals(text)) { - return type; - } - } - return UNRECOGNIZED; - } - - @Override - public String toString() { - return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()); - } - } - - /** - * The name of the data disk - */ - @Nullable public abstract String name(); - - /** - * The size of the data disk - */ - @Nullable public abstract String diskSizeGB(); - - /** - * The lun value of the data disk - */ - @Nullable public abstract Integer lun(); - - /** - * The vhd of the data disk - */ - @Nullable public abstract VHD vhd(); - - /** - * The source user image virtual hard disk. This virtual hard disk will be - * copied before using it to attach to the virtual machine. If SourceImage - * is provided, the destination virtual hard disk must not exist. - */ - @Nullable public abstract VHD image(); - - /** - * The create option of the data disk - */ - public abstract DiskCreateOptionTypes createOption(); - - /** - * The caching type. Possible values include: 'None', 'ReadOnly', - * 'ReadWrite'. - */ - @Nullable public abstract CachingTypes caching(); - - /** - * The managed disk parameters. - */ - @Nullable public abstract ManagedDiskParameters managedDiskParameters(); - - @Nullable - public abstract String provisioningState(); - - @SerializedNames({"name", "diskSizeGB", "lun", "vhd", "image", "createOption", "caching", "managedDisk", "provisioningState"}) - public static DataDisk create(final String name, final String diskSizeGB, final Integer lun, - final VHD vhd, final VHD image, final String createOption, final String caching, - final ManagedDiskParameters managedDiskParamenters, final String provisioningState) { - final Builder builder = builder(); - if (caching != null) { - builder.caching(CachingTypes.fromValue(caching)); - } - return builder.name(name) - .diskSizeGB(diskSizeGB) - .lun(lun) - .vhd(vhd) - .image(image) - .createOption(DiskCreateOptionTypes.fromValue(createOption)) - .managedDiskParameters(managedDiskParamenters) - .provisioningState(provisioningState) - .build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_DataDisk.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder name(String name); - - public abstract Builder diskSizeGB(String diskSizeGB); - - public abstract Builder createOption(DiskCreateOptionTypes createOption); - - public abstract Builder lun(Integer lun); - - public abstract Builder vhd(VHD vhd); - - public abstract Builder image(VHD image); - - public abstract Builder caching(CachingTypes caching); - - public abstract Builder managedDiskParameters(ManagedDiskParameters managedDiskParameters); - - public abstract Builder provisioningState(String provisioningState); - - public abstract DataDisk build(); - } -}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Deployment.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Deployment.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Deployment.java deleted file mode 100644 index fe22591..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Deployment.java +++ /dev/null @@ -1,254 +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.azurecompute.arm.domain; - -import java.util.List; -import java.util.Map; - -import org.jclouds.azurecompute.arm.util.GetEnumValue; -import org.jclouds.domain.JsonBall; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableMap; - -import static com.google.common.collect.ImmutableList.copyOf; - -@AutoValue -public abstract class Deployment { - - public enum ProvisioningState { - ACCEPTED, - READY, - CANCELED, - FAILED, - DELETED, - SUCCEEDED, - RUNNING, - UNRECOGNIZED; - - public static ProvisioningState fromValue(final String text) { - return (ProvisioningState) GetEnumValue.fromValueOrDefault(text, ProvisioningState.UNRECOGNIZED); - } - } - - public enum DeploymentMode { - INCREMENTAL, - COMPLETE, - UNRECOGNIZED; - - public static DeploymentMode fromValue(final String text) { - return (DeploymentMode) GetEnumValue.fromValueOrDefault(text, DeploymentMode.UNRECOGNIZED); - } - } - - @AutoValue - public abstract static class TypeValue { - public abstract String type(); - - public abstract String value(); - - @SerializedNames({"type", "value"}) - public static TypeValue create(final String type, final String value) { - return new AutoValue_Deployment_TypeValue(type, value); - } - } - - @AutoValue - public abstract static class ProviderResourceType { - @Nullable - public abstract String resourceType(); - - @Nullable - public abstract List<String> locations(); - - @Nullable - public abstract List<String> apiVersions(); - - @Nullable - public abstract Map<String, JsonBall> properties(); - - @SerializedNames({"resourceType", "locations", "apiVersions", "properties"}) - public static ProviderResourceType create(final String resourceType, - final List<String> locations, - final List<String> apiVersions, - @Nullable final Map<String, JsonBall> properties) { - return new AutoValue_Deployment_ProviderResourceType(resourceType, - locations == null ? null : copyOf(locations), - apiVersions == null ? null : copyOf(apiVersions), - properties == null ? ImmutableMap.<String, JsonBall>builder().build() : ImmutableMap.copyOf(properties)); - } - } - - @AutoValue - public abstract static class Provider { - @Nullable - public abstract String id(); - - @Nullable - public abstract String namespace(); - - @Nullable - public abstract String registrationState(); - - @Nullable - public abstract List<ProviderResourceType> resourceTypes(); - - @SerializedNames({"id", "namespace", "registrationState", "resourceTypes"}) - public static Provider create(final String id, - final String namespace, - final String registrationState, - final List<ProviderResourceType> resourceTypes) { - return new AutoValue_Deployment_Provider(id, namespace, registrationState, resourceTypes == null ? null : copyOf(resourceTypes)); - } - } - - @AutoValue - public abstract static class Dependency { - @Nullable - public abstract List<Dependency> dependencies(); - - @Nullable - public abstract List<Dependency> dependsOn(); - - @Nullable - public abstract String id(); - - @Nullable - public abstract String resourceType(); - - @Nullable - public abstract String resourceName(); - - @SerializedNames({"dependencies", "dependsOn", "id", "resourceType", "resourceName"}) - public static Dependency create(final List<Dependency> dependencies, - final List<Dependency> dependsOn, - final String id, - final String resourceType, - final String resourceName) { - return new AutoValue_Deployment_Dependency(dependencies == null ? null : copyOf(dependencies), - dependsOn == null ? null : copyOf(dependsOn), id, resourceType, resourceName); - } - } - - @AutoValue - public abstract static class ContentLink { - public abstract String uri(); - - @Nullable - public abstract String contentVersion(); - - @SerializedNames({"uri", "contentVersion"}) - public static ContentLink create(final String uri, final String contentVersion) { - return new AutoValue_Deployment_ContentLink(uri, contentVersion); - } - } - - @AutoValue - public abstract static class DeploymentProperties implements Provisionable { - @Nullable - public abstract String provisioningState(); - - @Nullable - public abstract String correlationId(); - - @Nullable - public abstract String timestamp(); - - @Nullable - public abstract Map<String, JsonBall> outputs(); - - @Nullable - public abstract List<Provider> providers(); - - @Nullable - public abstract List<Dependency> dependencies(); - - @Nullable - public abstract Map<String, JsonBall> template(); - - @Nullable - public abstract ContentLink templateLink(); - - @Nullable - public abstract Map<String, Value> parameters(); - - @Nullable - public abstract ContentLink parametersLink(); - - public abstract String mode(); - - // The entries below seem to be dynamic/not documented in the specification - @Nullable - public abstract String duration(); - - @Nullable - public abstract List<Map<String, String>> outputResources(); - - @SerializedNames({"provisioningState", "correlationId", "timestamp", "outputs", "providers", "dependencies", "template", "templateLink", "parameters", "parametersLink", "mode", "duration", "outputResources"}) - public static DeploymentProperties create(final String provisioningState, - final String correlationId, - final String timestamp, - @Nullable final Map<String, JsonBall> outputs, - final List<Provider> providers, - final List<Dependency> dependencies, - final Map<String, JsonBall> template, - final ContentLink templateLink, - final Map<String, Value> parameters, - final ContentLink parametersLink, - final String mode, - final String duration, - final List<Map<String, String>> outputResources) { - return new AutoValue_Deployment_DeploymentProperties(provisioningState, - correlationId, - timestamp, - outputs == null ? ImmutableMap.<String, JsonBall>builder().build() : ImmutableMap.copyOf(outputs), - providers == null ? null : copyOf(providers), - dependencies == null ? null : copyOf(dependencies), - template == null ? ImmutableMap.<String, JsonBall>builder().build() : ImmutableMap.copyOf(template), - templateLink, - parameters == null ? ImmutableMap.<String, Value>builder().build() : ImmutableMap.copyOf(parameters), - parametersLink, - mode, - duration, - outputResources == null ? null : copyOf(outputResources)); - } - } - - /** - * The ID associated with the template deployment. - */ - @Nullable - public abstract String id(); - - /** - * The name associated with the template deployment. - */ - public abstract String name(); - - /** - * Properties of the deployment. - */ - @Nullable - public abstract DeploymentProperties properties(); - - @SerializedNames({"id", "name", "properties"}) - public static Deployment create(final String id, final String name, final DeploymentProperties properties) { - return new AutoValue_Deployment(id, name, properties); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentBody.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentBody.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentBody.java deleted file mode 100644 index 0f91360..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentBody.java +++ /dev/null @@ -1,42 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; -import org.jclouds.azurecompute.arm.domain.DeploymentTemplate.Parameters; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -@AutoValue -public abstract class DeploymentBody { - - @Nullable - public abstract DeploymentTemplate template(); - - @Nullable - public abstract String mode(); - - @Nullable - public abstract Parameters parameters(); - - @SerializedNames({"template", "mode", "parameters"}) - public static DeploymentBody create(final DeploymentTemplate template, - final String mode, - final Parameters parameters) { - return new AutoValue_DeploymentBody(template, mode, parameters); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentProperties.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentProperties.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentProperties.java deleted file mode 100644 index 94b53c5..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentProperties.java +++ /dev/null @@ -1,31 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; -import org.jclouds.json.SerializedNames; - -@AutoValue -public abstract class DeploymentProperties { - - public abstract DeploymentBody properties(); - - @SerializedNames({"properties"}) - public static DeploymentProperties create(final DeploymentBody properties) { - return new AutoValue_DeploymentProperties(properties); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentTemplate.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentTemplate.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentTemplate.java deleted file mode 100644 index 84e6061..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DeploymentTemplate.java +++ /dev/null @@ -1,125 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; - -import org.jclouds.javax.annotation.Nullable; - -import java.util.List; -import java.util.Map; -import org.jclouds.json.SerializedNames; - -@AutoValue -public abstract class DeploymentTemplate { - - //Empty placeholders as we want to generate the empty JSON object - @AutoValue - public abstract static class Parameters { - - @Nullable - public abstract KeyVaultReference publicKeyFromAzureKeyVault(); - - public static Parameters create(KeyVaultReference reference) - { - return new AutoValue_DeploymentTemplate_Parameters(reference); - } - } - - @AutoValue - public abstract static class TemplateParameters { - - @Nullable - public abstract TemplateParameterType publicKeyFromAzureKeyVault(); - - public static TemplateParameters create(TemplateParameterType publicKeyFromAzureKeyVault) - { - return new AutoValue_DeploymentTemplate_TemplateParameters(publicKeyFromAzureKeyVault); - } - } - - public abstract String schema(); - - public abstract String contentVersion(); - - public abstract TemplateParameters parameters(); - - public abstract Map<String, String> variables(); - - public abstract List<ResourceDefinition> resources(); - - @Nullable - public abstract List<?> outputs(); - - @SerializedNames({"$schema", "contentVersion", "parameters", "variables", "resources" , "outputs"}) - public static DeploymentTemplate create(final String schema, - final String contentVersion, - final TemplateParameters parameters, - final Map<String, String> variables, - final List<ResourceDefinition> resources, - final List<?> outputs) { - - DeploymentTemplate.Builder builder = DeploymentTemplate.builder() - .schema(schema) - .contentVersion(contentVersion) - .parameters(parameters); - - if (variables != null) - builder.variables(variables); - - if (resources != null) - builder.resources(resources); - - builder.outputs(outputs == null ? null : ImmutableList.copyOf(outputs)); - - return builder.build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_DeploymentTemplate.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder schema(String schema); - - public abstract Builder contentVersion(String type); - - public abstract Builder parameters(TemplateParameters parameters); - - public abstract Builder variables(Map<String, String> variables); - - public abstract Builder resources(List<ResourceDefinition> resources); - - public abstract Builder outputs(List<?> outputs); - - abstract Map<String, String> variables(); - abstract List<ResourceDefinition> resources(); - - abstract DeploymentTemplate autoBuild(); - - public DeploymentTemplate build() { - variables(variables() != null ? ImmutableMap.copyOf(variables()) : null); - resources(resources() != null ? ImmutableList.copyOf(resources()) : null); - return autoBuild(); - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DiagnosticsProfile.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DiagnosticsProfile.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DiagnosticsProfile.java deleted file mode 100644 index bd8cb0c..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DiagnosticsProfile.java +++ /dev/null @@ -1,74 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -@AutoValue -public abstract class DiagnosticsProfile { - - @AutoValue - public abstract static class BootDiagnostics{ - - public abstract boolean enabled(); - - @Nullable - public abstract String storageUri(); - - @SerializedNames({"enabled", "storageUri"}) - public static BootDiagnostics create(final boolean enabled, final String storageUri) { - return builder() - .enabled(enabled) - .storageUri(storageUri) - .build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_DiagnosticsProfile_BootDiagnostics.Builder(); - } - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder enabled(boolean enabled); - public abstract Builder storageUri(String storageUri); - public abstract BootDiagnostics build(); - } - } - - public abstract BootDiagnostics bootDiagnostics(); - - @SerializedNames({"bootDiagnostics"}) - public static DiagnosticsProfile create(final BootDiagnostics bootDiagnostics) { - return builder().bootDiagnostics(bootDiagnostics).build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_DiagnosticsProfile.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder bootDiagnostics(BootDiagnostics bootDiagnostics); - public abstract DiagnosticsProfile build(); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Disk.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Disk.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Disk.java deleted file mode 100644 index c090aa8..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Disk.java +++ /dev/null @@ -1,105 +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.azurecompute.arm.domain; - -import java.util.Map; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableMap; - -@AutoValue -public abstract class Disk { - - /** - * The id of the disk - */ - @Nullable public abstract String id(); - - /** - * The name of the disk - */ - @Nullable public abstract String name(); - - /** - * The location of the disk - */ - public abstract String location(); - - /** - * The type of the disk - */ - @Nullable public abstract String type(); - - /** - * The sku of the disk - */ - @Nullable public abstract SKU sku(); - - /** - * The managed disk parameters. - */ - public abstract DiskProperties properties(); - - /** - * the tags of the disk - */ - @Nullable public abstract Map<String, String> tags(); - - @SerializedNames({"id", "name", "location", "type", "sku", "properties", "tags"}) - public static Disk create(final String id, final String name, final String location, - final String type, final SKU sku, - final DiskProperties properties, final Map<String, String> tags) { - return builder() - .id(id) - .name(name) - .location(location) - .type(type) - .sku(sku) - .properties(properties) - .tags(tags) - .build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_Disk.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder id(String id); - public abstract Builder name(String name); - public abstract Builder location(String location); - public abstract Builder type(String type); - public abstract Builder sku(SKU sku); - public abstract Builder properties(DiskProperties properties); - public abstract Builder tags(Map<String, String> tags); - - abstract Map<String, String> tags(); - abstract Disk autoBuild(); - - public Disk build() { - tags(tags() != null ? ImmutableMap.copyOf(tags()) : null); - return autoBuild(); - } - - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DiskProperties.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DiskProperties.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DiskProperties.java deleted file mode 100644 index bcc62ca..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DiskProperties.java +++ /dev/null @@ -1,78 +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.azurecompute.arm.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -@AutoValue -public abstract class DiskProperties implements Provisionable { - - @Nullable - public abstract String provisioningState(); - - @Nullable - public abstract String timeCreated(); - - @Nullable - public abstract String diskState(); - - @Nullable - public abstract Integer diskSizeGB(); - - @Nullable - public abstract Integer lun(); - - @Nullable - public abstract VHD vhd(); - - public abstract CreationData creationData(); - - @SerializedNames({"provisioningState", "timeCreated", "diskState", "diskSizeGB", "lun", "vhd", "creationData"}) - public static DiskProperties create(final String provisioningState, final String timeCreated, final String diskState, final Integer diskSizeGB, final Integer lun, final VHD vhd, final CreationData creationData) { - return builder() - .provisioningState(provisioningState) - .timeCreated(timeCreated) - .diskState(diskState) - .diskSizeGB(diskSizeGB) - .lun(lun) - .vhd(vhd) - .creationData(creationData) - .build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_DiskProperties.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder provisioningState(String provisioningState); - public abstract Builder timeCreated(String timeCreated); - public abstract Builder diskState(String diskState); - public abstract Builder diskSizeGB(Integer diskSizeGB); - public abstract Builder lun(Integer lun); - public abstract Builder vhd(VHD vhd); - public abstract Builder creationData(CreationData creationData); - public abstract DiskProperties build(); - - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DnsSettings.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DnsSettings.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DnsSettings.java deleted file mode 100644 index c06ef22..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/DnsSettings.java +++ /dev/null @@ -1,60 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -@AutoValue -public abstract class DnsSettings { - - public abstract String domainNameLabel(); - - @Nullable - public abstract String fqdn(); - - @Nullable - public abstract String reverseFqdn(); - - @SerializedNames({"domainNameLabel", "fqdn", "reverseFqdn"}) - public static DnsSettings create(final String domainNameLabel, final String fqdn, final String reverseFqdn) { - return builder() - .domainNameLabel(domainNameLabel) - .fqdn(fqdn) - .reverseFqdn(reverseFqdn) - .build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_DnsSettings.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder domainNameLabel(String domainNameLabel); - - public abstract Builder fqdn(String fqdn); - - public abstract Builder reverseFqdn(String reverseFqdn); - - public abstract DnsSettings build(); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Extension.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Extension.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Extension.java deleted file mode 100644 index 5eafb04..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Extension.java +++ /dev/null @@ -1,40 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; -import org.jclouds.json.SerializedNames; - -@AutoValue -public abstract class Extension { - - /** - * The name reference of the extension profile - */ - public abstract String name(); - - /** - * The properties reference of the extension profile - */ - public abstract ExtensionProperties properties(); - - - @SerializedNames({"name", "properties"}) - public static Extension create(final String name, final ExtensionProperties properties) { - return new AutoValue_Extension(name, properties); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProfile.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProfile.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProfile.java deleted file mode 100644 index 92ab4fb..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProfile.java +++ /dev/null @@ -1,39 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableList; -import org.jclouds.json.SerializedNames; - -import java.util.List; - -@AutoValue -public abstract class ExtensionProfile { - - /** - * The list of extensions of the extension profile - */ - public abstract List<Extension> extensions(); - - - @SerializedNames({"extensions"}) - public static ExtensionProfile create(final List<Extension> extensions) { - return new AutoValue_ExtensionProfile(extensions == null ? - ImmutableList.<Extension>of() : ImmutableList.copyOf(extensions)); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProfileSettings.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProfileSettings.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProfileSettings.java deleted file mode 100644 index 265bf76..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProfileSettings.java +++ /dev/null @@ -1,42 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableList; -import org.jclouds.json.SerializedNames; - -import java.util.List; - -@AutoValue -public abstract class ExtensionProfileSettings { - - /** - * The fileUris reference of the extension profile settings - */ - public abstract List<String> fileUris(); - - /** - * The commandToExecute of the extension profile settings - */ - public abstract String commandToExecute(); - - @SerializedNames({"fileUris", "commandToExecute"}) - public static ExtensionProfileSettings create(final List<String> fileUris, final String commandToExecute) { - return new AutoValue_ExtensionProfileSettings(fileUris == null ? ImmutableList.<String>of() : ImmutableList.copyOf(fileUris), commandToExecute); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProperties.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProperties.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProperties.java deleted file mode 100644 index d4e8b7f..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ExtensionProperties.java +++ /dev/null @@ -1,70 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableMap; -import org.jclouds.json.SerializedNames; - -import java.util.Map; - -@AutoValue -public abstract class ExtensionProperties { - - /** - * The publisher reference of the extension properties - */ - public abstract String publisher(); - - /** - * The type reference of the extension properties - */ - public abstract String type(); - - /** - * The typeHandlerVersion reference of the extension properties - */ - public abstract String typeHandlerVersion(); - - /** - * The autoUpgradeMinorVersion reference of the extension properties - */ - public abstract Boolean autoUpgradeMinorVersion(); - - /** - * The ExtensionProfileSettings of the extension properties - */ - public abstract ExtensionProfileSettings settings(); - - /** - * The list of the protectedSettings of the extension properties - */ - public abstract Map<String, String> protectedSettings(); - - @SerializedNames({ "publisher", "type", "typeHandlerVersion", - "autoUpgradeMinorVersion", "settings", "protectedSettings"}) - public static ExtensionProperties create(final String publisher, String type, - final String typeHandlerVersion, - final Boolean autoUpgradeMinorVersion, - final ExtensionProfileSettings settings, - final Map<String, String> protectedSettings) { - return new AutoValue_ExtensionProperties(publisher, type, typeHandlerVersion, autoUpgradeMinorVersion, - settings, protectedSettings == null ? - ImmutableMap.<String, String>of() : ImmutableMap.copyOf(protectedSettings)); - } -} - http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/FrontendIPConfigurations.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/FrontendIPConfigurations.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/FrontendIPConfigurations.java deleted file mode 100644 index fae60c9..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/FrontendIPConfigurations.java +++ /dev/null @@ -1,45 +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.azurecompute.arm.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -@AutoValue -public abstract class FrontendIPConfigurations { - public abstract String name(); - - @Nullable - public abstract String id(); - - @Nullable - public abstract FrontendIPConfigurationsProperties properties(); - - @Nullable - public abstract String etag(); - - @SerializedNames({ "name", "id", "properties", "etag" }) - public static FrontendIPConfigurations create(final String name, final String id, - final FrontendIPConfigurationsProperties properties, - final String etag) { - return new AutoValue_FrontendIPConfigurations(name, id, - properties, etag); - } -} - http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/FrontendIPConfigurationsProperties.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/FrontendIPConfigurationsProperties.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/FrontendIPConfigurationsProperties.java deleted file mode 100644 index b451773..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/FrontendIPConfigurationsProperties.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.azurecompute.arm.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -@AutoValue -public abstract class FrontendIPConfigurationsProperties { - - @Nullable - public abstract IdReference subnet(); - - @Nullable - public abstract String privateIPAddress(); - - @Nullable - public abstract String privateIPAllocationMethod(); - - @Nullable - public abstract IdReference publicIPAddress(); - - - @SerializedNames({ "subnet", "privateIPAddress", "privateIPAllocationMethod", "publicIPAddress" }) - public static FrontendIPConfigurationsProperties create(final IdReference subnet, final String privateIPAddress, - final String privateIPAllocationMethod, final IdReference publicIPAddress) { - return builder().subnet(subnet).publicIPAddress(publicIPAddress).privateIPAddress(privateIPAddress) - .privateIPAllocationMethod(privateIPAllocationMethod).build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_FrontendIPConfigurationsProperties.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder subnet(IdReference subnet); - - public abstract Builder privateIPAddress(String privateIPAddress); - - public abstract Builder privateIPAllocationMethod(String privateIPAllocationMethod); - - public abstract Builder publicIPAddress(IdReference publicIPAddress); - - public abstract FrontendIPConfigurationsProperties build(); - } -} - http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/HardwareProfile.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/HardwareProfile.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/HardwareProfile.java deleted file mode 100644 index 9342202..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/HardwareProfile.java +++ /dev/null @@ -1,48 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; - -import org.jclouds.json.SerializedNames; - -@AutoValue -public abstract class HardwareProfile { - - /** - * The vm size of the virtual machine. - */ - public abstract String vmSize(); - - @SerializedNames({"vmSize"}) - public static HardwareProfile create(final String vmSize) { - return builder().vmSize(vmSize).build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_HardwareProfile.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder vmSize(String vmSize); - - public abstract HardwareProfile build(); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IdReference.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IdReference.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IdReference.java deleted file mode 100644 index f73e3e4..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IdReference.java +++ /dev/null @@ -1,71 +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.azurecompute.arm.domain; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -// Simple helper class to serialize / deserialize id reference. - -@AutoValue -public abstract class IdReference { - - private static final Pattern RESOURCE_GROUP_PATTERN = Pattern.compile("^.*/resourceGroups/([^/]+)(/.*)?$"); - - @Nullable - public abstract String id(); - - @Nullable - public String resourceGroup() { - return extractResourceGroup(id()); - } - - @Nullable - public String name() { - return extractName(id()); - } - - @SerializedNames({"id"}) - public static IdReference create(final String id) { - return new AutoValue_IdReference(id); - } - - /** - * Extracts the name from the given URI. - */ - public static String extractName(String uri) { - if (uri == null) - return null; - String noSlashAtEnd = uri.replaceAll("/+$", ""); - return noSlashAtEnd.substring(noSlashAtEnd.lastIndexOf('/') + 1); - } - - /** - * Extracts the resource group name from the given URI. - */ - public static String extractResourceGroup(String uri) { - if (uri == null) - return null; - Matcher m = RESOURCE_GROUP_PATTERN.matcher(uri); - return m.matches() ? m.group(1) : null; - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Image.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Image.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Image.java deleted file mode 100644 index b442617..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Image.java +++ /dev/null @@ -1,86 +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.azurecompute.arm.domain; - -import java.util.Map; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableMap; - -@AutoValue -public abstract class Image { - - /** - * The id of the image - */ - @Nullable - public abstract String id(); - - /** - * The name of the image - */ - @Nullable - public abstract String name(); - - /** - * The location of the image - */ - public abstract String location(); - - /** - * The image properties. - */ - public abstract ImageProperties properties(); - - /** - * the tags of the image - */ - @Nullable public abstract Map<String, String> tags(); - - @SerializedNames({"id", "name", "location", "properties", "tags"}) - public static Image create(final String id, final String name, final String location, - final ImageProperties properties, final Map<String, String> tags) { - return builder().id(id).name(name).location(location).properties(properties).tags(tags).build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_Image.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder id(String id); - public abstract Builder name(String name); - public abstract Builder location(String location); - public abstract Builder properties(ImageProperties properties); - public abstract Builder tags(Map<String, String> tags); - - abstract Map<String, String> tags(); - - abstract Image autoBuild(); - - public Image build() { - tags(tags() != null ? ImmutableMap.copyOf(tags()) : null); - return autoBuild(); - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ImageProperties.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ImageProperties.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ImageProperties.java deleted file mode 100644 index 44cb16e..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ImageProperties.java +++ /dev/null @@ -1,61 +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.azurecompute.arm.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -@AutoValue -public abstract class ImageProperties implements Provisionable { - - @Nullable - public abstract IdReference sourceVirtualMachine(); - - @Nullable - public abstract StorageProfile storageProfile(); - - @Nullable - public abstract String provisioningState(); - - @SerializedNames({ "sourceVirtualMachine", "storageProfile", "provisioningState"}) - public static ImageProperties create(final IdReference sourceVirtualMachine, - final StorageProfile storageProfile, - final String provisioningState) { - return builder() - .sourceVirtualMachine(sourceVirtualMachine) - .storageProfile(storageProfile) - .provisioningState(provisioningState) - .build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_ImageProperties.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder sourceVirtualMachine(IdReference sourceVirtualMachine); - public abstract Builder storageProfile(StorageProfile storageProfile); - public abstract Builder provisioningState(String provisioningState); - public abstract ImageProperties build(); - - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ImageReference.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ImageReference.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ImageReference.java deleted file mode 100644 index d001949..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/ImageReference.java +++ /dev/null @@ -1,106 +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.azurecompute.arm.domain; - -import static org.jclouds.azurecompute.arm.domain.IdReference.extractName; -import static org.jclouds.azurecompute.arm.domain.IdReference.extractResourceGroup; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -@AutoValue -public abstract class ImageReference { - - /** - * Specifies the resource identifier of a virtual machine image in your subscription. This element is only used - * for virtual machine images, not platform images or marketplace images. - */ - @Nullable - public abstract String customImageId(); - - /** - * The publisher of the image reference. - */ - @Nullable - public abstract String publisher(); - - /** - * The offer of the image reference. - */ - @Nullable - public abstract String offer(); - - /** - * The sku of the image reference. - */ - @Nullable - public abstract String sku(); - - /** - * The version of the image reference. - */ - @Nullable - public abstract String version(); - - ImageReference() { - - } - - @SerializedNames({"id", "publisher", "offer", "sku", "version"}) - public static ImageReference create(final String id, - final String publisher, - final String offer, - final String sku, - final String version) { - - return builder().customImageId(id) - .publisher(publisher) - .offer(offer) - .sku(sku) - .version(version) - .build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_ImageReference.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder customImageId(String ids); - public abstract Builder publisher(String publisher); - public abstract Builder offer(String offer); - public abstract Builder sku(String sku); - public abstract Builder version(String version); - - public abstract ImageReference build(); - } - - public String encodeFieldsToUniqueId(String location) { - return VMImage.azureImage().location(location).publisher(publisher()).offer(offer()).sku(sku()).build() - .encodeFieldsToUniqueId(); - } - - public String encodeFieldsToUniqueIdCustom(String location) { - return VMImage.customImage().resourceGroup(extractResourceGroup(customImageId())).location(location) - .name(extractName(customImageId())).build().encodeFieldsToUniqueIdCustom(); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/InboundNatRule.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/InboundNatRule.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/InboundNatRule.java deleted file mode 100644 index dccc2e9..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/InboundNatRule.java +++ /dev/null @@ -1,43 +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.azurecompute.arm.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -@AutoValue -public abstract class InboundNatRule { - @Nullable - public abstract String name(); - - @Nullable - public abstract String id(); - - @Nullable - public abstract InboundNatRuleProperties properties(); - - @Nullable - public abstract String etag(); - - @SerializedNames({ "name", "id", "properties", "etag" }) - public static InboundNatRule create(final String name, final String id, final InboundNatRuleProperties properties, - final String etag) { - return new AutoValue_InboundNatRule(name, id, properties, etag); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/InboundNatRuleProperties.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/InboundNatRuleProperties.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/InboundNatRuleProperties.java deleted file mode 100644 index 9ed6aed..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/InboundNatRuleProperties.java +++ /dev/null @@ -1,105 +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.azurecompute.arm.domain; - -import org.jclouds.azurecompute.arm.util.GetEnumValue; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -@AutoValue -public abstract class InboundNatRuleProperties implements Provisionable { - public enum Protocol { - Tcp("Tcp"), Udp("Udp"), UNRECOGNIZED("Unrecognized"); - - private final String label; - - private Protocol(final String label) { - this.label = label; - } - - public static Protocol fromValue(final String text) { - return (Protocol) GetEnumValue.fromValueOrDefault(text, Protocol.UNRECOGNIZED); - } - - @Override - public String toString() { - return label; - } - } - - @Nullable - public abstract IdReference frontendIPConfiguration(); - - @Nullable - public abstract IdReference backendIPConfiguration(); - - public abstract Protocol protocol(); - - public abstract int backendPort(); - - public abstract int frontendPort(); - - @Nullable - public abstract Boolean enableFloatingIP(); - - @Nullable - public abstract Integer idleTimeoutInMinutes(); - - @Nullable - public abstract String provisioningState(); - - @SerializedNames({ "frontendIPConfiguration", "backendIPConfiguration", "protocol", "frontendPort", "backendPort", - "provisioningState", "enableFloatingIP", "idleTimeoutInMinutes" }) - public static InboundNatRuleProperties create(final IdReference frontendIPConfiguration, - final IdReference backendIPConfiguration, final Protocol protocol, final int frontendPort, - final int backendPort, final String provisioningState, Boolean enableFloatingIP, Integer idleTimeoutInMinutes) { - return builder().frontendIPConfiguration(frontendIPConfiguration).backendIPConfiguration(backendIPConfiguration) - .protocol(protocol).frontendPort(frontendPort).backendPort(backendPort) - .provisioningState(provisioningState).enableFloatingIP(enableFloatingIP) - .idleTimeoutInMinutes(idleTimeoutInMinutes).build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_InboundNatRuleProperties.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - - public abstract Builder frontendIPConfiguration(IdReference frontendIPConfiguration); - - public abstract Builder backendIPConfiguration(IdReference backendIPConfiguration); - - public abstract Builder protocol(Protocol protocol); - - public abstract Builder frontendPort(int frontendPort); - - public abstract Builder backendPort(int backendPort); - - public abstract Builder provisioningState(String provisioningState); - - public abstract Builder enableFloatingIP(Boolean enableFloatingIP); - - public abstract Builder idleTimeoutInMinutes(Integer idleTimeoutInMinutes); - - public abstract InboundNatRuleProperties build(); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IpConfiguration.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IpConfiguration.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IpConfiguration.java deleted file mode 100644 index e523622..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IpConfiguration.java +++ /dev/null @@ -1,68 +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.azurecompute.arm.domain; - -import com.google.auto.value.AutoValue; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -@AutoValue -public abstract class IpConfiguration { - - @Nullable - public abstract String name(); - - @Nullable - public abstract String id(); - - @Nullable - public abstract String etag(); - - @Nullable - public abstract Boolean primary(); - - @Nullable - public abstract IpConfigurationProperties properties(); - - @SerializedNames({"name", "id", "etag", "primary", "properties"}) - public static IpConfiguration create(final String name, final String id, final String etag, final Boolean primary, final IpConfigurationProperties properties) { - return builder() - .name(name) - .id(id) - .etag(etag) - .primary(primary) - .properties(properties) - .build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_IpConfiguration.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder name(String name); - public abstract Builder id(String id); - public abstract Builder etag(String etag); - public abstract Builder primary(Boolean primary); - public abstract Builder properties(IpConfigurationProperties properties); - public abstract IpConfiguration build(); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ac03bac4/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IpConfigurationProperties.java ---------------------------------------------------------------------- diff --git a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IpConfigurationProperties.java b/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IpConfigurationProperties.java deleted file mode 100644 index 21f494f..0000000 --- a/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/IpConfigurationProperties.java +++ /dev/null @@ -1,105 +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.azurecompute.arm.domain; - -import java.util.List; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableList; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -@AutoValue -public abstract class IpConfigurationProperties implements Provisionable { - - @Nullable - public abstract String provisioningState(); - - @Nullable - public abstract String privateIPAddress(); - - @Nullable - public abstract String privateIPAllocationMethod(); - - @Nullable - public abstract IdReference subnet(); - - @Nullable - public abstract IdReference publicIPAddress(); - - @Nullable - public abstract List<IdReference> loadBalancerBackendAddressPools(); - - @Nullable - public abstract List<IdReference> loadBalancerInboundNatRules(); - - @SerializedNames({ "provisioningState", "privateIPAddress", "privateIPAllocationMethod", "subnet", - "publicIPAddress", "loadBalancerBackendAddressPools", "loadBalancerInboundNatRules" }) - public static IpConfigurationProperties create(final String provisioningState, final String privateIPAddress, - final String privateIPAllocationMethod, final IdReference subnet, final IdReference publicIPAddress, - List<IdReference> loadBalancerBackendAddressPools, List<IdReference> loadBalancerInboundNatRules) { - - return builder() - .provisioningState(provisioningState) - .privateIPAddress(privateIPAddress) - .privateIPAllocationMethod(privateIPAllocationMethod) - .subnet(subnet) - .publicIPAddress(publicIPAddress) - .loadBalancerBackendAddressPools(loadBalancerBackendAddressPools) - .loadBalancerInboundNatRules(loadBalancerInboundNatRules) - .build(); - } - - public abstract Builder toBuilder(); - - public static Builder builder() { - return new AutoValue_IpConfigurationProperties.Builder(); - } - - @AutoValue.Builder - public abstract static class Builder { - public abstract Builder provisioningState(String provisioningState); - - public abstract Builder privateIPAddress(String privateIPAddress); - - public abstract Builder privateIPAllocationMethod(String privateIPAllocationMethod); - - public abstract Builder subnet(IdReference subnet); - - public abstract Builder publicIPAddress(IdReference publicIPAddress); - - public abstract Builder loadBalancerBackendAddressPools(List<IdReference> loadBalancerBackendAddressPools); - - public abstract Builder loadBalancerInboundNatRules(List<IdReference> loadBalancerInboundNatRules); - - abstract List<IdReference> loadBalancerBackendAddressPools(); - - abstract List<IdReference> loadBalancerInboundNatRules(); - - abstract IpConfigurationProperties autoBuild(); - - public IpConfigurationProperties build() { - loadBalancerBackendAddressPools(loadBalancerBackendAddressPools() != null ? ImmutableList - .copyOf(loadBalancerBackendAddressPools()) : null); - loadBalancerInboundNatRules(loadBalancerInboundNatRules() != null ? ImmutableList - .copyOf(loadBalancerInboundNatRules()) : null); - return autoBuild(); - } - } -} -
