diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/pom.xml b/sdk/hdinsight/mgmt-v2015_03_01_preview/pom.xml new file mode 100644 index 0000000000000..b283c12bd7b89 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.hdinsight.v2015_03_01_preview + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-hdinsight + 1.0.0-beta + jar + Microsoft Azure SDK for HDInsight Management + This package contains Microsoft HDInsight Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Application.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Application.java new file mode 100644 index 0000000000000..c904037705015 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Application.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ApplicationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import java.util.Map; + +/** + * Type representing Application. + */ +public interface Application extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + ApplicationProperties properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Application definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCluster, DefinitionStages.WithCreate { + } + + /** + * Grouping of Application definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Application definition. + */ + interface Blank extends WithCluster { + } + + /** + * The stage of the application definition allowing to specify Cluster. + */ + interface WithCluster { + /** + * Specifies resourceGroupName, clusterName. + * @param resourceGroupName The name of the resource group + * @param clusterName The name of the cluster + * @return the next definition stage + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + + /** + * The stage of the application definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag for the application + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the application definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the application + * @return the next definition stage + */ + WithCreate withProperties(ApplicationProperties properties); + } + + /** + * The stage of the application definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the application + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEtag, DefinitionStages.WithProperties, DefinitionStages.WithTags { + } + } + /** + * The template for a Application update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithProperties, UpdateStages.WithTags { + } + + /** + * Grouping of Application update stages. + */ + interface UpdateStages { + /** + * The stage of the application update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag for the application + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the application update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The properties of the application + * @return the next update stage + */ + Update withProperties(ApplicationProperties properties); + } + + /** + * The stage of the application update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the application + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetEndpoint.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetEndpoint.java new file mode 100644 index 0000000000000..30aad4561990c --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetEndpoint.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets the application SSH endpoint. + */ +public class ApplicationGetEndpoint { + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /** + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destination port to connect to. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destination port to connect to. + * + * @param destinationPort the destinationPort value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the public port to connect to. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the public port to connect to. + * + * @param publicPort the publicPort value to set + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetHttpsEndpoint.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetHttpsEndpoint.java new file mode 100644 index 0000000000000..2eae68130aa19 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationGetHttpsEndpoint.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gets the application HTTP endpoints. + */ +public class ApplicationGetHttpsEndpoint { + /** + * The list of access modes for the application. + */ + @JsonProperty(value = "accessModes") + private List accessModes; + + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /** + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * The subdomain suffix of the application. + */ + @JsonProperty(value = "subDomainSuffix") + private String subDomainSuffix; + + /** + * Disable gateway authentication. + */ + @JsonProperty(value = "disableGatewayAuth") + private Boolean disableGatewayAuth; + + /** + * Get the list of access modes for the application. + * + * @return the accessModes value + */ + public List accessModes() { + return this.accessModes; + } + + /** + * Set the list of access modes for the application. + * + * @param accessModes the accessModes value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withAccessModes(List accessModes) { + this.accessModes = accessModes; + return this; + } + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destination port to connect to. + * + * @return the destinationPort value + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destination port to connect to. + * + * @param destinationPort the destinationPort value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the public port to connect to. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the public port to connect to. + * + * @param publicPort the publicPort value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + + /** + * Get the subdomain suffix of the application. + * + * @return the subDomainSuffix value + */ + public String subDomainSuffix() { + return this.subDomainSuffix; + } + + /** + * Set the subdomain suffix of the application. + * + * @param subDomainSuffix the subDomainSuffix value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withSubDomainSuffix(String subDomainSuffix) { + this.subDomainSuffix = subDomainSuffix; + return this; + } + + /** + * Get disable gateway authentication. + * + * @return the disableGatewayAuth value + */ + public Boolean disableGatewayAuth() { + return this.disableGatewayAuth; + } + + /** + * Set disable gateway authentication. + * + * @param disableGatewayAuth the disableGatewayAuth value to set + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withDisableGatewayAuth(Boolean disableGatewayAuth) { + this.disableGatewayAuth = disableGatewayAuth; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationProperties.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationProperties.java new file mode 100644 index 0000000000000..d675073be9947 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ApplicationProperties.java @@ -0,0 +1,260 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HDInsight cluster application GET response. + */ +public class ApplicationProperties { + /** + * The list of roles in the cluster. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The list of install script actions. + */ + @JsonProperty(value = "installScriptActions") + private List installScriptActions; + + /** + * The list of uninstall script actions. + */ + @JsonProperty(value = "uninstallScriptActions") + private List uninstallScriptActions; + + /** + * The list of application HTTPS endpoints. + */ + @JsonProperty(value = "httpsEndpoints") + private List httpsEndpoints; + + /** + * The list of application SSH endpoints. + */ + @JsonProperty(value = "sshEndpoints") + private List sshEndpoints; + + /** + * The provisioning state of the application. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The application type. + */ + @JsonProperty(value = "applicationType") + private String applicationType; + + /** + * The application state. + */ + @JsonProperty(value = "applicationState", access = JsonProperty.Access.WRITE_ONLY) + private String applicationState; + + /** + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * The application create date time. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private String createdDate; + + /** + * The marketplace identifier. + */ + @JsonProperty(value = "marketplaceIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String marketplaceIdentifier; + + /** + * Get the list of roles in the cluster. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the list of roles in the cluster. + * + * @param computeProfile the computeProfile value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the list of install script actions. + * + * @return the installScriptActions value + */ + public List installScriptActions() { + return this.installScriptActions; + } + + /** + * Set the list of install script actions. + * + * @param installScriptActions the installScriptActions value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withInstallScriptActions(List installScriptActions) { + this.installScriptActions = installScriptActions; + return this; + } + + /** + * Get the list of uninstall script actions. + * + * @return the uninstallScriptActions value + */ + public List uninstallScriptActions() { + return this.uninstallScriptActions; + } + + /** + * Set the list of uninstall script actions. + * + * @param uninstallScriptActions the uninstallScriptActions value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withUninstallScriptActions(List uninstallScriptActions) { + this.uninstallScriptActions = uninstallScriptActions; + return this; + } + + /** + * Get the list of application HTTPS endpoints. + * + * @return the httpsEndpoints value + */ + public List httpsEndpoints() { + return this.httpsEndpoints; + } + + /** + * Set the list of application HTTPS endpoints. + * + * @param httpsEndpoints the httpsEndpoints value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withHttpsEndpoints(List httpsEndpoints) { + this.httpsEndpoints = httpsEndpoints; + return this; + } + + /** + * Get the list of application SSH endpoints. + * + * @return the sshEndpoints value + */ + public List sshEndpoints() { + return this.sshEndpoints; + } + + /** + * Set the list of application SSH endpoints. + * + * @param sshEndpoints the sshEndpoints value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withSshEndpoints(List sshEndpoints) { + this.sshEndpoints = sshEndpoints; + return this; + } + + /** + * Get the provisioning state of the application. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the application type. + * + * @return the applicationType value + */ + public String applicationType() { + return this.applicationType; + } + + /** + * Set the application type. + * + * @param applicationType the applicationType value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withApplicationType(String applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get the application state. + * + * @return the applicationState value + */ + public String applicationState() { + return this.applicationState; + } + + /** + * Get the list of errors. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the list of errors. + * + * @param errors the errors value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the application create date time. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Get the marketplace identifier. + * + * @return the marketplaceIdentifier value + */ + public String marketplaceIdentifier() { + return this.marketplaceIdentifier; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Applications.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Applications.java new file mode 100644 index 0000000000000..cd4e43545737b --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Applications.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ApplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Applications. + */ +public interface Applications extends SupportsCreating, HasInner { + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String applicationName); + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String clusterName); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String applicationName); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AsyncOperationState.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AsyncOperationState.java new file mode 100644 index 0000000000000..b4114684d7be9 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AsyncOperationState.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AsyncOperationState. + */ +public enum AsyncOperationState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a AsyncOperationState instance. */ + private String value; + + AsyncOperationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AsyncOperationState instance. + * + * @param value the serialized value to parse. + * @return the parsed AsyncOperationState object, or null if unable to parse. + */ + @JsonCreator + public static AsyncOperationState fromString(String value) { + AsyncOperationState[] items = AsyncOperationState.values(); + for (AsyncOperationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Autoscale.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Autoscale.java new file mode 100644 index 0000000000000..9b158937804ae --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Autoscale.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The autoscale request parameters. + */ +public class Autoscale { + /** + * Parameters for load-based autoscale. + */ + @JsonProperty(value = "capacity") + private AutoscaleCapacity capacity; + + /** + * Parameters for schedule-based autoscale. + */ + @JsonProperty(value = "recurrence") + private AutoscaleRecurrence recurrence; + + /** + * Get parameters for load-based autoscale. + * + * @return the capacity value + */ + public AutoscaleCapacity capacity() { + return this.capacity; + } + + /** + * Set parameters for load-based autoscale. + * + * @param capacity the capacity value to set + * @return the Autoscale object itself. + */ + public Autoscale withCapacity(AutoscaleCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get parameters for schedule-based autoscale. + * + * @return the recurrence value + */ + public AutoscaleRecurrence recurrence() { + return this.recurrence; + } + + /** + * Set parameters for schedule-based autoscale. + * + * @param recurrence the recurrence value to set + * @return the Autoscale object itself. + */ + public Autoscale withRecurrence(AutoscaleRecurrence recurrence) { + this.recurrence = recurrence; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleCapacity.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleCapacity.java new file mode 100644 index 0000000000000..8249388ec3454 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleCapacity.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The load-based autoscale request parameters. + */ +public class AutoscaleCapacity { + /** + * The minimum instance count of the cluster. + */ + @JsonProperty(value = "minInstanceCount") + private Integer minInstanceCount; + + /** + * The maximum instance count of the cluster. + */ + @JsonProperty(value = "maxInstanceCount") + private Integer maxInstanceCount; + + /** + * Get the minimum instance count of the cluster. + * + * @return the minInstanceCount value + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minimum instance count of the cluster. + * + * @param minInstanceCount the minInstanceCount value to set + * @return the AutoscaleCapacity object itself. + */ + public AutoscaleCapacity withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the maximum instance count of the cluster. + * + * @return the maxInstanceCount value + */ + public Integer maxInstanceCount() { + return this.maxInstanceCount; + } + + /** + * Set the maximum instance count of the cluster. + * + * @param maxInstanceCount the maxInstanceCount value to set + * @return the AutoscaleCapacity object itself. + */ + public AutoscaleCapacity withMaxInstanceCount(Integer maxInstanceCount) { + this.maxInstanceCount = maxInstanceCount; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleConfigurationUpdateParameter.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleConfigurationUpdateParameter.java new file mode 100644 index 0000000000000..173731a5a4b28 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleConfigurationUpdateParameter.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The autoscale configuration update parameter. + */ +public class AutoscaleConfigurationUpdateParameter { + /** + * The autoscale configuration. + */ + @JsonProperty(value = "autoscale") + private Autoscale autoscale; + + /** + * Get the autoscale configuration. + * + * @return the autoscale value + */ + public Autoscale autoscale() { + return this.autoscale; + } + + /** + * Set the autoscale configuration. + * + * @param autoscale the autoscale value to set + * @return the AutoscaleConfigurationUpdateParameter object itself. + */ + public AutoscaleConfigurationUpdateParameter withAutoscale(Autoscale autoscale) { + this.autoscale = autoscale; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleRecurrence.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleRecurrence.java new file mode 100644 index 0000000000000..42d0c231fe2aa --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleRecurrence.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schedule-based autoscale request parameters. + */ +public class AutoscaleRecurrence { + /** + * The time zone for the autoscale schedule times. + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /** + * Array of schedule-based autoscale rules. + */ + @JsonProperty(value = "schedule") + private List schedule; + + /** + * Get the time zone for the autoscale schedule times. + * + * @return the timeZone value + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the time zone for the autoscale schedule times. + * + * @param timeZone the timeZone value to set + * @return the AutoscaleRecurrence object itself. + */ + public AutoscaleRecurrence withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get array of schedule-based autoscale rules. + * + * @return the schedule value + */ + public List schedule() { + return this.schedule; + } + + /** + * Set array of schedule-based autoscale rules. + * + * @param schedule the schedule value to set + * @return the AutoscaleRecurrence object itself. + */ + public AutoscaleRecurrence withSchedule(List schedule) { + this.schedule = schedule; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleSchedule.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleSchedule.java new file mode 100644 index 0000000000000..fe8d2e3966bcb --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleSchedule.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for a schedule-based autoscale rule, consisting of an array of + * days + a time and capacity. + */ +public class AutoscaleSchedule { + /** + * Days of the week for a schedule-based autoscale rule. + */ + @JsonProperty(value = "days") + private List days; + + /** + * Time and capacity for a schedule-based autoscale rule. + */ + @JsonProperty(value = "timeAndCapacity") + private AutoscaleTimeAndCapacity timeAndCapacity; + + /** + * Get days of the week for a schedule-based autoscale rule. + * + * @return the days value + */ + public List days() { + return this.days; + } + + /** + * Set days of the week for a schedule-based autoscale rule. + * + * @param days the days value to set + * @return the AutoscaleSchedule object itself. + */ + public AutoscaleSchedule withDays(List days) { + this.days = days; + return this; + } + + /** + * Get time and capacity for a schedule-based autoscale rule. + * + * @return the timeAndCapacity value + */ + public AutoscaleTimeAndCapacity timeAndCapacity() { + return this.timeAndCapacity; + } + + /** + * Set time and capacity for a schedule-based autoscale rule. + * + * @param timeAndCapacity the timeAndCapacity value to set + * @return the AutoscaleSchedule object itself. + */ + public AutoscaleSchedule withTimeAndCapacity(AutoscaleTimeAndCapacity timeAndCapacity) { + this.timeAndCapacity = timeAndCapacity; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleTimeAndCapacity.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleTimeAndCapacity.java new file mode 100644 index 0000000000000..70f42740330d0 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/AutoscaleTimeAndCapacity.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Time and capacity request parameters. + */ +public class AutoscaleTimeAndCapacity { + /** + * 24-hour time in the form xx:xx. + */ + @JsonProperty(value = "time") + private String time; + + /** + * The minimum instance count of the cluster. + */ + @JsonProperty(value = "minInstanceCount") + private Integer minInstanceCount; + + /** + * The maximum instance count of the cluster. + */ + @JsonProperty(value = "maxInstanceCount") + private Integer maxInstanceCount; + + /** + * Get 24-hour time in the form xx:xx. + * + * @return the time value + */ + public String time() { + return this.time; + } + + /** + * Set 24-hour time in the form xx:xx. + * + * @param time the time value to set + * @return the AutoscaleTimeAndCapacity object itself. + */ + public AutoscaleTimeAndCapacity withTime(String time) { + this.time = time; + return this; + } + + /** + * Get the minimum instance count of the cluster. + * + * @return the minInstanceCount value + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minimum instance count of the cluster. + * + * @param minInstanceCount the minInstanceCount value to set + * @return the AutoscaleTimeAndCapacity object itself. + */ + public AutoscaleTimeAndCapacity withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the maximum instance count of the cluster. + * + * @return the maxInstanceCount value + */ + public Integer maxInstanceCount() { + return this.maxInstanceCount; + } + + /** + * Set the maximum instance count of the cluster. + * + * @param maxInstanceCount the maxInstanceCount value to set + * @return the AutoscaleTimeAndCapacity object itself. + */ + public AutoscaleTimeAndCapacity withMaxInstanceCount(Integer maxInstanceCount) { + this.maxInstanceCount = maxInstanceCount; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/BillingMeters.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/BillingMeters.java new file mode 100644 index 0000000000000..9542b815b015d --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/BillingMeters.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The billing meters. + */ +public class BillingMeters { + /** + * The virtual machine sizes. + */ + @JsonProperty(value = "meterParameter") + private String meterParameter; + + /** + * The HDInsight meter guid. + */ + @JsonProperty(value = "meter") + private String meter; + + /** + * The unit of meter, VMHours or CoreHours. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Get the virtual machine sizes. + * + * @return the meterParameter value + */ + public String meterParameter() { + return this.meterParameter; + } + + /** + * Set the virtual machine sizes. + * + * @param meterParameter the meterParameter value to set + * @return the BillingMeters object itself. + */ + public BillingMeters withMeterParameter(String meterParameter) { + this.meterParameter = meterParameter; + return this; + } + + /** + * Get the HDInsight meter guid. + * + * @return the meter value + */ + public String meter() { + return this.meter; + } + + /** + * Set the HDInsight meter guid. + * + * @param meter the meter value to set + * @return the BillingMeters object itself. + */ + public BillingMeters withMeter(String meter) { + this.meter = meter; + return this; + } + + /** + * Get the unit of meter, VMHours or CoreHours. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit of meter, VMHours or CoreHours. + * + * @param unit the unit value to set + * @return the BillingMeters object itself. + */ + public BillingMeters withUnit(String unit) { + this.unit = unit; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/BillingResources.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/BillingResources.java new file mode 100644 index 0000000000000..7ce9bd009b413 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/BillingResources.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The billing resources. + */ +public class BillingResources { + /** + * The region or location. + */ + @JsonProperty(value = "region") + private String region; + + /** + * The billing meter information. + */ + @JsonProperty(value = "billingMeters") + private List billingMeters; + + /** + * The managed disk billing information. + */ + @JsonProperty(value = "diskBillingMeters") + private List diskBillingMeters; + + /** + * Get the region or location. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set the region or location. + * + * @param region the region value to set + * @return the BillingResources object itself. + */ + public BillingResources withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the billing meter information. + * + * @return the billingMeters value + */ + public List billingMeters() { + return this.billingMeters; + } + + /** + * Set the billing meter information. + * + * @param billingMeters the billingMeters value to set + * @return the BillingResources object itself. + */ + public BillingResources withBillingMeters(List billingMeters) { + this.billingMeters = billingMeters; + return this; + } + + /** + * Get the managed disk billing information. + * + * @return the diskBillingMeters value + */ + public List diskBillingMeters() { + return this.diskBillingMeters; + } + + /** + * Set the managed disk billing information. + * + * @param diskBillingMeters the diskBillingMeters value to set + * @return the BillingResources object itself. + */ + public BillingResources withDiskBillingMeters(List diskBillingMeters) { + this.diskBillingMeters = diskBillingMeters; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/BillingResponseListResult.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/BillingResponseListResult.java new file mode 100644 index 0000000000000..42cca81077afd --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/BillingResponseListResult.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.BillingResponseListResultInner; +import java.util.List; + +/** + * Type representing BillingResponseListResult. + */ +public interface BillingResponseListResult extends HasInner, HasManager { + /** + * @return the billingResources value. + */ + List billingResources(); + + /** + * @return the vmSizeFilters value. + */ + List vmSizeFilters(); + + /** + * @return the vmSizes value. + */ + List vmSizes(); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/CapabilitiesResult.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/CapabilitiesResult.java new file mode 100644 index 0000000000000..30af6b8ba26f5 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/CapabilitiesResult.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.CapabilitiesResultInner; +import java.util.List; +import java.util.Map; + +/** + * Type representing CapabilitiesResult. + */ +public interface CapabilitiesResult extends HasInner, HasManager { + /** + * @return the features value. + */ + List features(); + + /** + * @return the quota value. + */ + QuotaCapability quota(); + + /** + * @return the regions value. + */ + Map regions(); + + /** + * @return the versions value. + */ + Map versions(); + + /** + * @return the vmSizeFilters value. + */ + List vmSizeFilters(); + + /** + * @return the vmSizes value. + */ + Map vmSizes(); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClientGroupInfo.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClientGroupInfo.java new file mode 100644 index 0000000000000..cebbed17fbad6 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClientGroupInfo.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information of AAD security group. + */ +public class ClientGroupInfo { + /** + * The AAD security group name. + */ + @JsonProperty(value = "groupName") + private String groupName; + + /** + * The AAD security group id. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /** + * Get the AAD security group name. + * + * @return the groupName value + */ + public String groupName() { + return this.groupName; + } + + /** + * Set the AAD security group name. + * + * @param groupName the groupName value to set + * @return the ClientGroupInfo object itself. + */ + public ClientGroupInfo withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Get the AAD security group id. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the AAD security group id. + * + * @param groupId the groupId value to set + * @return the ClientGroupInfo object itself. + */ + public ClientGroupInfo withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Cluster.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Cluster.java new file mode 100644 index 0000000000000..5e6b0d066dad1 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Cluster.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the identity value. + */ + ClusterIdentity identity(); + + /** + * @return the properties value. + */ + ClusterGetProperties properties(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Cluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Cluster definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Cluster definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the cluster definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the cluster, if configured + * @return the next definition stage + */ + WithCreate withIdentity(ClusterIdentity identity); + } + + /** + * The stage of the cluster definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The cluster create parameters + * @return the next definition stage + */ + WithCreate withProperties(ClusterCreateProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithIdentity, DefinitionStages.WithProperties { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the cluster, if configured + * @return the next update stage + */ + Update withIdentity(ClusterIdentity identity); + } + + /** + * The stage of the cluster update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The cluster create parameters + * @return the next update stage + */ + Update withProperties(ClusterCreateProperties properties); + } + + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterConfigurations.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterConfigurations.java new file mode 100644 index 0000000000000..c7ea11c60ba22 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterConfigurations.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ClusterConfigurationsInner; +import java.util.Map; + +/** + * Type representing ClusterConfigurations. + */ +public interface ClusterConfigurations extends HasInner, HasManager { + /** + * @return the configurations value. + */ + Map> configurations(); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateParametersExtended.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateParametersExtended.java new file mode 100644 index 0000000000000..9adf04bfadc49 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateParametersExtended.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateCluster request parameters. + */ +public class ClusterCreateParametersExtended { + /** + * The location of the cluster. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The cluster create parameters. + */ + @JsonProperty(value = "properties") + private ClusterCreateProperties properties; + + /** + * The identity of the cluster, if configured. + */ + @JsonProperty(value = "identity") + private ClusterIdentity identity; + + /** + * Get the location of the cluster. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the cluster. + * + * @param location the location value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the cluster create parameters. + * + * @return the properties value + */ + public ClusterCreateProperties properties() { + return this.properties; + } + + /** + * Set the cluster create parameters. + * + * @param properties the properties value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withProperties(ClusterCreateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity of the cluster, if configured. + * + * @return the identity value + */ + public ClusterIdentity identity() { + return this.identity; + } + + /** + * Set the identity of the cluster, if configured. + * + * @param identity the identity value to set + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withIdentity(ClusterIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateProperties.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateProperties.java new file mode 100644 index 0000000000000..5f5ff668c00c1 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterCreateProperties.java @@ -0,0 +1,330 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster create parameters. + */ +public class ClusterCreateProperties { + /** + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /** + * The type of operating system. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * The cluster tier. Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition") + private ClusterDefinition clusterDefinition; + + /** + * The cluster kafka rest proxy configuration. + */ + @JsonProperty(value = "kafkaRestProperties") + private KafkaRestProperties kafkaRestProperties; + + /** + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /** + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The storage profile. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /** + * The disk encryption properties. + */ + @JsonProperty(value = "diskEncryptionProperties") + private DiskEncryptionProperties diskEncryptionProperties; + + /** + * The encryption-in-transit properties. + */ + @JsonProperty(value = "encryptionInTransitProperties") + private EncryptionInTransitProperties encryptionInTransitProperties; + + /** + * The minimal supported tls version. + */ + @JsonProperty(value = "minSupportedTlsVersion") + private String minSupportedTlsVersion; + + /** + * The network settings. + */ + @JsonProperty(value = "networkSettings") + private NetworkSettings networkSettings; + + /** + * Get the version of the cluster. + * + * @return the clusterVersion value + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the version of the cluster. + * + * @param clusterVersion the clusterVersion value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the cluster definition. + * + * @return the clusterDefinition value + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the cluster kafka rest proxy configuration. + * + * @return the kafkaRestProperties value + */ + public KafkaRestProperties kafkaRestProperties() { + return this.kafkaRestProperties; + } + + /** + * Set the cluster kafka rest proxy configuration. + * + * @param kafkaRestProperties the kafkaRestProperties value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withKafkaRestProperties(KafkaRestProperties kafkaRestProperties) { + this.kafkaRestProperties = kafkaRestProperties; + return this; + } + + /** + * Get the security profile. + * + * @return the securityProfile value + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the security profile. + * + * @param securityProfile the securityProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the compute profile. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the compute profile. + * + * @param computeProfile the computeProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the storage profile. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storage profile. + * + * @param storageProfile the storageProfile value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the disk encryption properties. + * + * @return the diskEncryptionProperties value + */ + public DiskEncryptionProperties diskEncryptionProperties() { + return this.diskEncryptionProperties; + } + + /** + * Set the disk encryption properties. + * + * @param diskEncryptionProperties the diskEncryptionProperties value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withDiskEncryptionProperties(DiskEncryptionProperties diskEncryptionProperties) { + this.diskEncryptionProperties = diskEncryptionProperties; + return this; + } + + /** + * Get the encryption-in-transit properties. + * + * @return the encryptionInTransitProperties value + */ + public EncryptionInTransitProperties encryptionInTransitProperties() { + return this.encryptionInTransitProperties; + } + + /** + * Set the encryption-in-transit properties. + * + * @param encryptionInTransitProperties the encryptionInTransitProperties value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withEncryptionInTransitProperties(EncryptionInTransitProperties encryptionInTransitProperties) { + this.encryptionInTransitProperties = encryptionInTransitProperties; + return this; + } + + /** + * Get the minimal supported tls version. + * + * @return the minSupportedTlsVersion value + */ + public String minSupportedTlsVersion() { + return this.minSupportedTlsVersion; + } + + /** + * Set the minimal supported tls version. + * + * @param minSupportedTlsVersion the minSupportedTlsVersion value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withMinSupportedTlsVersion(String minSupportedTlsVersion) { + this.minSupportedTlsVersion = minSupportedTlsVersion; + return this; + } + + /** + * Get the network settings. + * + * @return the networkSettings value + */ + public NetworkSettings networkSettings() { + return this.networkSettings; + } + + /** + * Set the network settings. + * + * @param networkSettings the networkSettings value to set + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withNetworkSettings(NetworkSettings networkSettings) { + this.networkSettings = networkSettings; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDefinition.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDefinition.java new file mode 100644 index 0000000000000..33fff49e4d75a --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDefinition.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster definition. + */ +public class ClusterDefinition { + /** + * The link to the blueprint. + */ + @JsonProperty(value = "blueprint") + private String blueprint; + + /** + * The type of cluster. + */ + @JsonProperty(value = "kind") + private String kind; + + /** + * The versions of different services in the cluster. + */ + @JsonProperty(value = "componentVersion") + private Map componentVersion; + + /** + * The cluster configurations. + */ + @JsonProperty(value = "configurations") + private Object configurations; + + /** + * Get the link to the blueprint. + * + * @return the blueprint value + */ + public String blueprint() { + return this.blueprint; + } + + /** + * Set the link to the blueprint. + * + * @param blueprint the blueprint value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withBlueprint(String blueprint) { + this.blueprint = blueprint; + return this; + } + + /** + * Get the type of cluster. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + + /** + * Set the type of cluster. + * + * @param kind the kind value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the versions of different services in the cluster. + * + * @return the componentVersion value + */ + public Map componentVersion() { + return this.componentVersion; + } + + /** + * Set the versions of different services in the cluster. + * + * @param componentVersion the componentVersion value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withComponentVersion(Map componentVersion) { + this.componentVersion = componentVersion; + return this; + } + + /** + * Get the cluster configurations. + * + * @return the configurations value + */ + public Object configurations() { + return this.configurations; + } + + /** + * Set the cluster configurations. + * + * @param configurations the configurations value to set + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withConfigurations(Object configurations) { + this.configurations = configurations; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDiskEncryptionParameters.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDiskEncryptionParameters.java new file mode 100644 index 0000000000000..5f932508239fa --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterDiskEncryptionParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Disk Encryption Cluster request parameters. + */ +public class ClusterDiskEncryptionParameters { + /** + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net. + */ + @JsonProperty(value = "vaultUri") + private String vaultUri; + + /** + * Key name that is used for enabling disk encryption. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * Specific key version that is used for enabling disk encryption. + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /** + * Get base key vault URI where the customers key is located eg. https://myvault.vault.azure.net. + * + * @return the vaultUri value + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set base key vault URI where the customers key is located eg. https://myvault.vault.azure.net. + * + * @param vaultUri the vaultUri value to set + * @return the ClusterDiskEncryptionParameters object itself. + */ + public ClusterDiskEncryptionParameters withVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Get key name that is used for enabling disk encryption. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set key name that is used for enabling disk encryption. + * + * @param keyName the keyName value to set + * @return the ClusterDiskEncryptionParameters object itself. + */ + public ClusterDiskEncryptionParameters withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get specific key version that is used for enabling disk encryption. + * + * @return the keyVersion value + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set specific key version that is used for enabling disk encryption. + * + * @param keyVersion the keyVersion value to set + * @return the ClusterDiskEncryptionParameters object itself. + */ + public ClusterDiskEncryptionParameters withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterGetProperties.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterGetProperties.java new file mode 100644 index 0000000000000..abec06271cd1f --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterGetProperties.java @@ -0,0 +1,463 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of cluster. + */ +public class ClusterGetProperties { + /** + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /** + * The type of operating system. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * The cluster tier. Possible values include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition", required = true) + private ClusterDefinition clusterDefinition; + + /** + * The cluster kafka rest proxy configuration. + */ + @JsonProperty(value = "kafkaRestProperties") + private KafkaRestProperties kafkaRestProperties; + + /** + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /** + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /** + * The provisioning state, which only appears in the response. Possible + * values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', + * 'Deleting'. + */ + @JsonProperty(value = "provisioningState") + private HDInsightClusterProvisioningState provisioningState; + + /** + * The date on which the cluster was created. + */ + @JsonProperty(value = "createdDate") + private String createdDate; + + /** + * The state of the cluster. + */ + @JsonProperty(value = "clusterState") + private String clusterState; + + /** + * The quota information. + */ + @JsonProperty(value = "quotaInfo") + private QuotaInfo quotaInfo; + + /** + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * The list of connectivity endpoints. + */ + @JsonProperty(value = "connectivityEndpoints") + private List connectivityEndpoints; + + /** + * The disk encryption properties. + */ + @JsonProperty(value = "diskEncryptionProperties") + private DiskEncryptionProperties diskEncryptionProperties; + + /** + * The encryption-in-transit properties. + */ + @JsonProperty(value = "encryptionInTransitProperties") + private EncryptionInTransitProperties encryptionInTransitProperties; + + /** + * The minimal supported tls version. + */ + @JsonProperty(value = "minSupportedTlsVersion") + private String minSupportedTlsVersion; + + /** + * The network settings. + */ + @JsonProperty(value = "networkSettings") + private NetworkSettings networkSettings; + + /** + * Get the version of the cluster. + * + * @return the clusterVersion value + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the version of the cluster. + * + * @param clusterVersion the clusterVersion value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the type of operating system. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the cluster tier. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the cluster definition. + * + * @return the clusterDefinition value + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the cluster kafka rest proxy configuration. + * + * @return the kafkaRestProperties value + */ + public KafkaRestProperties kafkaRestProperties() { + return this.kafkaRestProperties; + } + + /** + * Set the cluster kafka rest proxy configuration. + * + * @param kafkaRestProperties the kafkaRestProperties value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withKafkaRestProperties(KafkaRestProperties kafkaRestProperties) { + this.kafkaRestProperties = kafkaRestProperties; + return this; + } + + /** + * Get the security profile. + * + * @return the securityProfile value + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the security profile. + * + * @param securityProfile the securityProfile value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the compute profile. + * + * @return the computeProfile value + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the compute profile. + * + * @param computeProfile the computeProfile value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the provisioning state, which only appears in the response. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', 'Deleting'. + * + * @return the provisioningState value + */ + public HDInsightClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state, which only appears in the response. Possible values include: 'InProgress', 'Failed', 'Succeeded', 'Canceled', 'Deleting'. + * + * @param provisioningState the provisioningState value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withProvisioningState(HDInsightClusterProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the date on which the cluster was created. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Set the date on which the cluster was created. + * + * @param createdDate the createdDate value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withCreatedDate(String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the state of the cluster. + * + * @return the clusterState value + */ + public String clusterState() { + return this.clusterState; + } + + /** + * Set the state of the cluster. + * + * @param clusterState the clusterState value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterState(String clusterState) { + this.clusterState = clusterState; + return this; + } + + /** + * Get the quota information. + * + * @return the quotaInfo value + */ + public QuotaInfo quotaInfo() { + return this.quotaInfo; + } + + /** + * Set the quota information. + * + * @param quotaInfo the quotaInfo value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withQuotaInfo(QuotaInfo quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + /** + * Get the list of errors. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set the list of errors. + * + * @param errors the errors value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the list of connectivity endpoints. + * + * @return the connectivityEndpoints value + */ + public List connectivityEndpoints() { + return this.connectivityEndpoints; + } + + /** + * Set the list of connectivity endpoints. + * + * @param connectivityEndpoints the connectivityEndpoints value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withConnectivityEndpoints(List connectivityEndpoints) { + this.connectivityEndpoints = connectivityEndpoints; + return this; + } + + /** + * Get the disk encryption properties. + * + * @return the diskEncryptionProperties value + */ + public DiskEncryptionProperties diskEncryptionProperties() { + return this.diskEncryptionProperties; + } + + /** + * Set the disk encryption properties. + * + * @param diskEncryptionProperties the diskEncryptionProperties value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withDiskEncryptionProperties(DiskEncryptionProperties diskEncryptionProperties) { + this.diskEncryptionProperties = diskEncryptionProperties; + return this; + } + + /** + * Get the encryption-in-transit properties. + * + * @return the encryptionInTransitProperties value + */ + public EncryptionInTransitProperties encryptionInTransitProperties() { + return this.encryptionInTransitProperties; + } + + /** + * Set the encryption-in-transit properties. + * + * @param encryptionInTransitProperties the encryptionInTransitProperties value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withEncryptionInTransitProperties(EncryptionInTransitProperties encryptionInTransitProperties) { + this.encryptionInTransitProperties = encryptionInTransitProperties; + return this; + } + + /** + * Get the minimal supported tls version. + * + * @return the minSupportedTlsVersion value + */ + public String minSupportedTlsVersion() { + return this.minSupportedTlsVersion; + } + + /** + * Set the minimal supported tls version. + * + * @param minSupportedTlsVersion the minSupportedTlsVersion value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withMinSupportedTlsVersion(String minSupportedTlsVersion) { + this.minSupportedTlsVersion = minSupportedTlsVersion; + return this; + } + + /** + * Get the network settings. + * + * @return the networkSettings value + */ + public NetworkSettings networkSettings() { + return this.networkSettings; + } + + /** + * Set the network settings. + * + * @param networkSettings the networkSettings value to set + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withNetworkSettings(NetworkSettings networkSettings) { + this.networkSettings = networkSettings; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterIdentity.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterIdentity.java new file mode 100644 index 0000000000000..12d05f6302fc9 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterIdentity.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the cluster. + */ +public class ClusterIdentity { + /** + * The principal id of cluster identity. This property will only be + * provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant id associated with the cluster. This property will only be + * provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The type of identity used for the cluster. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user assigned identities. Possible values include: 'SystemAssigned', + * 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * The list of user identities associated with the cluster. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principal id of cluster identity. This property will only be provided for a system assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant id associated with the cluster. This property will only be provided for a system assigned identity. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type of identity used for the cluster. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type of identity used for the cluster. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * + * @param type the type value to set + * @return the ClusterIdentity object itself. + */ + public ClusterIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the list of user identities associated with the cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the list of user identities associated with the cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set + * @return the ClusterIdentity object itself. + */ + public ClusterIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterIdentityUserAssignedIdentitiesValue.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterIdentityUserAssignedIdentitiesValue.java new file mode 100644 index 0000000000000..0003482f2b4ed --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterIdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ClusterIdentityUserAssignedIdentitiesValue model. + */ +public class ClusterIdentityUserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principal id of user assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the client id of user assigned identity. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListPersistedScriptActionsResult.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListPersistedScriptActionsResult.java new file mode 100644 index 0000000000000..4771a38f1a69e --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListPersistedScriptActionsResult.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ListPersistedScriptActions operation response. + */ +public class ClusterListPersistedScriptActionsResult { + /** + * The list of Persisted Script Actions. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of Persisted Script Actions. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of Persisted Script Actions. + * + * @param value the value value to set + * @return the ClusterListPersistedScriptActionsResult object itself. + */ + public ClusterListPersistedScriptActionsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListRuntimeScriptActionDetailResult.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListRuntimeScriptActionDetailResult.java new file mode 100644 index 0000000000000..dddb68eb68a8b --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterListRuntimeScriptActionDetailResult.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.RuntimeScriptActionDetailInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list runtime script action detail response. + */ +public class ClusterListRuntimeScriptActionDetailResult { + /** + * The list of persisted script action details for the cluster. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the list of persisted script action details for the cluster. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Get the link (url) to the next page of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringRequest.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringRequest.java new file mode 100644 index 0000000000000..ff83e029de9ef --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operations Management Suite (OMS) parameters. + */ +public class ClusterMonitoringRequest { + /** + * The Operations Management Suite (OMS) workspace ID. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * The Operations Management Suite (OMS) workspace key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the Operations Management Suite (OMS) workspace ID. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the Operations Management Suite (OMS) workspace ID. + * + * @param workspaceId the workspaceId value to set + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the Operations Management Suite (OMS) workspace key. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the Operations Management Suite (OMS) workspace key. + * + * @param primaryKey the primaryKey value to set + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringResponse.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringResponse.java new file mode 100644 index 0000000000000..2c32a0b24c6f4 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterMonitoringResponse.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ClusterMonitoringResponseInner; + +/** + * Type representing ClusterMonitoringResponse. + */ +public interface ClusterMonitoringResponse extends HasInner, HasManager { + /** + * @return the clusterMonitoringEnabled value. + */ + Boolean clusterMonitoringEnabled(); + + /** + * @return the workspaceId value. + */ + String workspaceId(); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterPatchParameters.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterPatchParameters.java new file mode 100644 index 0000000000000..0a0e38b051775 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterPatchParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The PatchCluster request parameters. + */ +public class ClusterPatchParameters { + /** + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags. + * + * @param tags the tags value to set + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterResizeParameters.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterResizeParameters.java new file mode 100644 index 0000000000000..19d32fc0983b3 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ClusterResizeParameters.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Resize Cluster request parameters. + */ +public class ClusterResizeParameters { + /** + * The target instance count for the operation. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * Get the target instance count for the operation. + * + * @return the targetInstanceCount value + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the target instance count for the operation. + * + * @param targetInstanceCount the targetInstanceCount value to set + * @return the ClusterResizeParameters object itself. + */ + public ClusterResizeParameters withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Clusters.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Clusters.java new file mode 100644 index 0000000000000..7da933a1e8926 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Clusters.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the disk encryption operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable rotateDiskEncryptionKeyAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters); + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getGatewaySettingsAsync(String resourceGroupName, String clusterName); + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable updateGatewaySettingsAsync(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters); + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable resizeAsync(String resourceGroupName, String clusterName); + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable updateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ComputeProfile.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ComputeProfile.java new file mode 100644 index 0000000000000..3b49a2fa7da14 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ComputeProfile.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the compute profile. + */ +public class ComputeProfile { + /** + * The list of roles in the cluster. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * Get the list of roles in the cluster. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles in the cluster. + * + * @param roles the roles value to set + * @return the ComputeProfile object itself. + */ + public ComputeProfile withRoles(List roles) { + this.roles = roles; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Configurations.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Configurations.java new file mode 100644 index 0000000000000..280a01f0ccc0a --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Configurations.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Observable; +import rx.Completable; +import java.util.Map; + +/** + * Type representing Configurations. + */ +public interface Configurations { + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String clusterName); + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters); + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable> getAsync(String resourceGroupName, String clusterName, String configurationName); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ConnectivityEndpoint.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ConnectivityEndpoint.java new file mode 100644 index 0000000000000..027cef539a5ff --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ConnectivityEndpoint.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The connectivity properties. + */ +public class ConnectivityEndpoint { + /** + * The name of the endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The protocol of the endpoint. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /** + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the name of the endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the endpoint. + * + * @param name the name value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocol of the endpoint. + * + * @return the protocol value + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol of the endpoint. + * + * @param protocol the protocol value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the location of the endpoint. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the endpoint. + * + * @param location the location value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the port to connect to. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set the port to connect to. + * + * @param port the port value to set + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DataDisksGroups.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DataDisksGroups.java new file mode 100644 index 0000000000000..31b64622a8a52 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DataDisksGroups.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The data disks groups for the role. + */ +public class DataDisksGroups { + /** + * The number of disks per node. + */ + @JsonProperty(value = "disksPerNode") + private Integer disksPerNode; + + /** + * ReadOnly. The storage account type. Do not set this value. + */ + @JsonProperty(value = "storageAccountType", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountType; + + /** + * ReadOnly. The DiskSize in GB. Do not set this value. + */ + @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer diskSizeGB; + + /** + * Get the number of disks per node. + * + * @return the disksPerNode value + */ + public Integer disksPerNode() { + return this.disksPerNode; + } + + /** + * Set the number of disks per node. + * + * @param disksPerNode the disksPerNode value to set + * @return the DataDisksGroups object itself. + */ + public DataDisksGroups withDisksPerNode(Integer disksPerNode) { + this.disksPerNode = disksPerNode; + return this; + } + + /** + * Get readOnly. The storage account type. Do not set this value. + * + * @return the storageAccountType value + */ + public String storageAccountType() { + return this.storageAccountType; + } + + /** + * Get readOnly. The DiskSize in GB. Do not set this value. + * + * @return the diskSizeGB value + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DaysOfWeek.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DaysOfWeek.java new file mode 100644 index 0000000000000..e54acfbbbf770 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DaysOfWeek.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DaysOfWeek. + */ +public enum DaysOfWeek { + /** Enum value Monday. */ + MONDAY("Monday"), + + /** Enum value Tuesday. */ + TUESDAY("Tuesday"), + + /** Enum value Wednesday. */ + WEDNESDAY("Wednesday"), + + /** Enum value Thursday. */ + THURSDAY("Thursday"), + + /** Enum value Friday. */ + FRIDAY("Friday"), + + /** Enum value Saturday. */ + SATURDAY("Saturday"), + + /** Enum value Sunday. */ + SUNDAY("Sunday"); + + /** The actual serialized value for a DaysOfWeek instance. */ + private String value; + + DaysOfWeek(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DaysOfWeek instance. + * + * @param value the serialized value to parse. + * @return the parsed DaysOfWeek object, or null if unable to parse. + */ + @JsonCreator + public static DaysOfWeek fromString(String value) { + DaysOfWeek[] items = DaysOfWeek.values(); + for (DaysOfWeek item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DirectoryType.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DirectoryType.java new file mode 100644 index 0000000000000..4fe9085467f5b --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DirectoryType.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DirectoryType. + */ +public enum DirectoryType { + /** Enum value ActiveDirectory. */ + ACTIVE_DIRECTORY("ActiveDirectory"); + + /** The actual serialized value for a DirectoryType instance. */ + private String value; + + DirectoryType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DirectoryType instance. + * + * @param value the serialized value to parse. + * @return the parsed DirectoryType object, or null if unable to parse. + */ + @JsonCreator + public static DirectoryType fromString(String value) { + DirectoryType[] items = DirectoryType.values(); + for (DirectoryType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DiskBillingMeters.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DiskBillingMeters.java new file mode 100644 index 0000000000000..81ec577a35071 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DiskBillingMeters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The disk billing meters. + */ +public class DiskBillingMeters { + /** + * The managed disk meter guid. + */ + @JsonProperty(value = "diskRpMeter") + private String diskRpMeter; + + /** + * The managed disk billing sku, P30 or S30. + */ + @JsonProperty(value = "sku") + private String sku; + + /** + * The managed disk billing tier, Standard or Premium. Possible values + * include: 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * Get the managed disk meter guid. + * + * @return the diskRpMeter value + */ + public String diskRpMeter() { + return this.diskRpMeter; + } + + /** + * Set the managed disk meter guid. + * + * @param diskRpMeter the diskRpMeter value to set + * @return the DiskBillingMeters object itself. + */ + public DiskBillingMeters withDiskRpMeter(String diskRpMeter) { + this.diskRpMeter = diskRpMeter; + return this; + } + + /** + * Get the managed disk billing sku, P30 or S30. + * + * @return the sku value + */ + public String sku() { + return this.sku; + } + + /** + * Set the managed disk billing sku, P30 or S30. + * + * @param sku the sku value to set + * @return the DiskBillingMeters object itself. + */ + public DiskBillingMeters withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the managed disk billing tier, Standard or Premium. Possible values include: 'Standard', 'Premium'. + * + * @return the tier value + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the managed disk billing tier, Standard or Premium. Possible values include: 'Standard', 'Premium'. + * + * @param tier the tier value to set + * @return the DiskBillingMeters object itself. + */ + public DiskBillingMeters withTier(Tier tier) { + this.tier = tier; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DiskEncryptionProperties.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DiskEncryptionProperties.java new file mode 100644 index 0000000000000..63f3d8c7f5f61 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/DiskEncryptionProperties.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The disk encryption properties. + */ +public class DiskEncryptionProperties { + /** + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net. + */ + @JsonProperty(value = "vaultUri") + private String vaultUri; + + /** + * Key name that is used for enabling disk encryption. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * Specific key version that is used for enabling disk encryption. + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /** + * Algorithm identifier for encryption, default RSA-OAEP. Possible values + * include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'. + */ + @JsonProperty(value = "encryptionAlgorithm") + private JsonWebKeyEncryptionAlgorithm encryptionAlgorithm; + + /** + * Resource ID of Managed Identity that is used to access the key vault. + */ + @JsonProperty(value = "msiResourceId") + private String msiResourceId; + + /** + * Indicates whether or not resource disk encryption is enabled. + */ + @JsonProperty(value = "encryptionAtHost") + private Boolean encryptionAtHost; + + /** + * Get base key vault URI where the customers key is located eg. https://myvault.vault.azure.net. + * + * @return the vaultUri value + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set base key vault URI where the customers key is located eg. https://myvault.vault.azure.net. + * + * @param vaultUri the vaultUri value to set + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Get key name that is used for enabling disk encryption. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set key name that is used for enabling disk encryption. + * + * @param keyName the keyName value to set + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get specific key version that is used for enabling disk encryption. + * + * @return the keyVersion value + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set specific key version that is used for enabling disk encryption. + * + * @param keyVersion the keyVersion value to set + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get algorithm identifier for encryption, default RSA-OAEP. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'. + * + * @return the encryptionAlgorithm value + */ + public JsonWebKeyEncryptionAlgorithm encryptionAlgorithm() { + return this.encryptionAlgorithm; + } + + /** + * Set algorithm identifier for encryption, default RSA-OAEP. Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'. + * + * @param encryptionAlgorithm the encryptionAlgorithm value to set + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withEncryptionAlgorithm(JsonWebKeyEncryptionAlgorithm encryptionAlgorithm) { + this.encryptionAlgorithm = encryptionAlgorithm; + return this; + } + + /** + * Get resource ID of Managed Identity that is used to access the key vault. + * + * @return the msiResourceId value + */ + public String msiResourceId() { + return this.msiResourceId; + } + + /** + * Set resource ID of Managed Identity that is used to access the key vault. + * + * @param msiResourceId the msiResourceId value to set + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withMsiResourceId(String msiResourceId) { + this.msiResourceId = msiResourceId; + return this; + } + + /** + * Get indicates whether or not resource disk encryption is enabled. + * + * @return the encryptionAtHost value + */ + public Boolean encryptionAtHost() { + return this.encryptionAtHost; + } + + /** + * Set indicates whether or not resource disk encryption is enabled. + * + * @param encryptionAtHost the encryptionAtHost value to set + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withEncryptionAtHost(Boolean encryptionAtHost) { + this.encryptionAtHost = encryptionAtHost; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/EncryptionInTransitProperties.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/EncryptionInTransitProperties.java new file mode 100644 index 0000000000000..3e71f178b51e5 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/EncryptionInTransitProperties.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The encryption-in-transit properties. + */ +public class EncryptionInTransitProperties { + /** + * Indicates whether or not inter cluster node communication is encrypted + * in transit. + */ + @JsonProperty(value = "isEncryptionInTransitEnabled") + private Boolean isEncryptionInTransitEnabled; + + /** + * Get indicates whether or not inter cluster node communication is encrypted in transit. + * + * @return the isEncryptionInTransitEnabled value + */ + public Boolean isEncryptionInTransitEnabled() { + return this.isEncryptionInTransitEnabled; + } + + /** + * Set indicates whether or not inter cluster node communication is encrypted in transit. + * + * @param isEncryptionInTransitEnabled the isEncryptionInTransitEnabled value to set + * @return the EncryptionInTransitProperties object itself. + */ + public EncryptionInTransitProperties withIsEncryptionInTransitEnabled(Boolean isEncryptionInTransitEnabled) { + this.isEncryptionInTransitEnabled = isEncryptionInTransitEnabled; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponse.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponse.java new file mode 100644 index 0000000000000..74b4ce7963de9 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponse.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the format of Error response. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message indicating why the operation failed. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponseException.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponseException.java new file mode 100644 index 0000000000000..6df5999302d6e --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Errors.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Errors.java new file mode 100644 index 0000000000000..b24aeb1153007 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Errors.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error message associated with the cluster creation. + */ +public class Errors { + /** + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error code. + * + * @param code the code value to set + * @return the Errors object itself. + */ + public Errors withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the Errors object itself. + */ + public Errors withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ExecuteScriptActionParameters.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ExecuteScriptActionParameters.java new file mode 100644 index 0000000000000..394d93dd00d63 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ExecuteScriptActionParameters.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for the script actions to execute on a running cluster. + */ +public class ExecuteScriptActionParameters { + /** + * The list of run time script actions. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Gets or sets if the scripts needs to be persisted. + */ + @JsonProperty(value = "persistOnSuccess", required = true) + private boolean persistOnSuccess; + + /** + * Get the list of run time script actions. + * + * @return the scriptActions value + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the list of run time script actions. + * + * @param scriptActions the scriptActions value to set + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + + /** + * Get gets or sets if the scripts needs to be persisted. + * + * @return the persistOnSuccess value + */ + public boolean persistOnSuccess() { + return this.persistOnSuccess; + } + + /** + * Set gets or sets if the scripts needs to be persisted. + * + * @param persistOnSuccess the persistOnSuccess value to set + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withPersistOnSuccess(boolean persistOnSuccess) { + this.persistOnSuccess = persistOnSuccess; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extension.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extension.java new file mode 100644 index 0000000000000..a8bb1a04bc98d --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extension.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ExtensionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; + +/** + * Type representing Extension. + */ +public interface Extension extends HasInner, HasManager { + /** + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * @return the workspaceId value. + */ + String workspaceId(); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extensions.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extensions.java new file mode 100644 index 0000000000000..0c9a5754e7793 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Extensions.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ExtensionsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ExtensionInner; + +/** + * Type representing Extensions. + */ +public interface Extensions extends HasInner { + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable disableMonitoringAsync(String resourceGroupName, String clusterName); + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String clusterName, String extensionName); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String extensionName); + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/FilterMode.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/FilterMode.java new file mode 100644 index 0000000000000..a2305327607e9 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/FilterMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for FilterMode. + */ +public final class FilterMode extends ExpandableStringEnum { + /** Static value Exclude for FilterMode. */ + public static final FilterMode EXCLUDE = fromString("Exclude"); + + /** Static value Include for FilterMode. */ + public static final FilterMode INCLUDE = fromString("Include"); + + /** + * Creates or finds a FilterMode from its string representation. + * @param name a name to look for + * @return the corresponding FilterMode + */ + @JsonCreator + public static FilterMode fromString(String name) { + return fromString(name, FilterMode.class); + } + + /** + * @return known FilterMode values + */ + public static Collection values() { + return values(FilterMode.class); + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/GatewaySettings.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/GatewaySettings.java new file mode 100644 index 0000000000000..342d7589bd090 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/GatewaySettings.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.GatewaySettingsInner; + +/** + * Type representing GatewaySettings. + */ +public interface GatewaySettings extends HasInner, HasManager { + /** + * @return the isCredentialEnabled value. + */ + String isCredentialEnabled(); + + /** + * @return the password value. + */ + String password(); + + /** + * @return the userName value. + */ + String userName(); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HDInsightClusterProvisioningState.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HDInsightClusterProvisioningState.java new file mode 100644 index 0000000000000..9477f8027ca06 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HDInsightClusterProvisioningState.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HDInsightClusterProvisioningState. + */ +public enum HDInsightClusterProvisioningState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Canceled. */ + CANCELED("Canceled"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a HDInsightClusterProvisioningState instance. */ + private String value; + + HDInsightClusterProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HDInsightClusterProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed HDInsightClusterProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static HDInsightClusterProvisioningState fromString(String value) { + HDInsightClusterProvisioningState[] items = HDInsightClusterProvisioningState.values(); + for (HDInsightClusterProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HardwareProfile.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HardwareProfile.java new file mode 100644 index 0000000000000..b62f0ff9c61de --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/HardwareProfile.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The hardware profile. + */ +public class HardwareProfile { + /** + * The size of the VM. + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** + * Get the size of the VM. + * + * @return the vmSize value + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the size of the VM. + * + * @param vmSize the vmSize value to set + * @return the HardwareProfile object itself. + */ + public HardwareProfile withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/JsonWebKeyEncryptionAlgorithm.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/JsonWebKeyEncryptionAlgorithm.java new file mode 100644 index 0000000000000..5d5965be7fcef --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/JsonWebKeyEncryptionAlgorithm.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for JsonWebKeyEncryptionAlgorithm. + */ +public final class JsonWebKeyEncryptionAlgorithm extends ExpandableStringEnum { + /** Static value RSA-OAEP for JsonWebKeyEncryptionAlgorithm. */ + public static final JsonWebKeyEncryptionAlgorithm RSA_OAEP = fromString("RSA-OAEP"); + + /** Static value RSA-OAEP-256 for JsonWebKeyEncryptionAlgorithm. */ + public static final JsonWebKeyEncryptionAlgorithm RSA_OAEP_256 = fromString("RSA-OAEP-256"); + + /** Static value RSA1_5 for JsonWebKeyEncryptionAlgorithm. */ + public static final JsonWebKeyEncryptionAlgorithm RSA1_5 = fromString("RSA1_5"); + + /** + * Creates or finds a JsonWebKeyEncryptionAlgorithm from its string representation. + * @param name a name to look for + * @return the corresponding JsonWebKeyEncryptionAlgorithm + */ + @JsonCreator + public static JsonWebKeyEncryptionAlgorithm fromString(String name) { + return fromString(name, JsonWebKeyEncryptionAlgorithm.class); + } + + /** + * @return known JsonWebKeyEncryptionAlgorithm values + */ + public static Collection values() { + return values(JsonWebKeyEncryptionAlgorithm.class); + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/KafkaRestProperties.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/KafkaRestProperties.java new file mode 100644 index 0000000000000..46b749efb85e9 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/KafkaRestProperties.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The kafka rest proxy configuration which contains AAD security group + * information. + */ +public class KafkaRestProperties { + /** + * The information of AAD security group. + */ + @JsonProperty(value = "clientGroupInfo") + private ClientGroupInfo clientGroupInfo; + + /** + * Get the information of AAD security group. + * + * @return the clientGroupInfo value + */ + public ClientGroupInfo clientGroupInfo() { + return this.clientGroupInfo; + } + + /** + * Set the information of AAD security group. + * + * @param clientGroupInfo the clientGroupInfo value to set + * @return the KafkaRestProperties object itself. + */ + public KafkaRestProperties withClientGroupInfo(ClientGroupInfo clientGroupInfo) { + this.clientGroupInfo = clientGroupInfo; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LinuxOperatingSystemProfile.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LinuxOperatingSystemProfile.java new file mode 100644 index 0000000000000..6b56e20a709bf --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LinuxOperatingSystemProfile.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ssh username, password, and ssh public key. + */ +public class LinuxOperatingSystemProfile { + /** + * The username. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The password. + */ + @JsonProperty(value = "password") + private String password; + + /** + * The SSH profile. + */ + @JsonProperty(value = "sshProfile") + private SshProfile sshProfile; + + /** + * Get the username. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username. + * + * @param username the username value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password. + * + * @param password the password value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the SSH profile. + * + * @return the sshProfile value + */ + public SshProfile sshProfile() { + return this.sshProfile; + } + + /** + * Set the SSH profile. + * + * @param sshProfile the sshProfile value to set + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withSshProfile(SshProfile sshProfile) { + this.sshProfile = sshProfile; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LocalizedName.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LocalizedName.java new file mode 100644 index 0000000000000..e0eb4a3a22381 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/LocalizedName.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details about the localizable name of a type of usage. + */ +public class LocalizedName { + /** + * The name of the used resource. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The localized name of the used resource. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the name of the used resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the name of the used resource. + * + * @param value the value value to set + * @return the LocalizedName object itself. + */ + public LocalizedName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localized name of the used resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localized name of the used resource. + * + * @param localizedValue the localizedValue value to set + * @return the LocalizedName object itself. + */ + public LocalizedName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Locations.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Locations.java new file mode 100644 index 0000000000000..dfad4ca2a0af0 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Locations.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Observable; + +/** + * Type representing Locations. + */ +public interface Locations { + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCapabilitiesAsync(String location); + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String location); + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listBillingSpecsAsync(String location); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/NetworkSettings.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/NetworkSettings.java new file mode 100644 index 0000000000000..2f84f30dd0f61 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/NetworkSettings.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The network settings. + */ +public class NetworkSettings { + /** + * Specifies whether public network access is enabled for inbound and + * outbound, or outbound only. Possible values include: + * 'InboundAndOutbound', 'OutboundOnly'. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * The mechanism through which the cluster will have outbound access to the + * public network. Possible values include: 'PublicLoadBalancer', 'UDR'. + */ + @JsonProperty(value = "outboundOnlyPublicNetworkAccessType") + private OutboundOnlyPublicNetworkAccessType outboundOnlyPublicNetworkAccessType; + + /** + * Get specifies whether public network access is enabled for inbound and outbound, or outbound only. Possible values include: 'InboundAndOutbound', 'OutboundOnly'. + * + * @return the publicNetworkAccess value + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set specifies whether public network access is enabled for inbound and outbound, or outbound only. Possible values include: 'InboundAndOutbound', 'OutboundOnly'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set + * @return the NetworkSettings object itself. + */ + public NetworkSettings withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the mechanism through which the cluster will have outbound access to the public network. Possible values include: 'PublicLoadBalancer', 'UDR'. + * + * @return the outboundOnlyPublicNetworkAccessType value + */ + public OutboundOnlyPublicNetworkAccessType outboundOnlyPublicNetworkAccessType() { + return this.outboundOnlyPublicNetworkAccessType; + } + + /** + * Set the mechanism through which the cluster will have outbound access to the public network. Possible values include: 'PublicLoadBalancer', 'UDR'. + * + * @param outboundOnlyPublicNetworkAccessType the outboundOnlyPublicNetworkAccessType value to set + * @return the NetworkSettings object itself. + */ + public NetworkSettings withOutboundOnlyPublicNetworkAccessType(OutboundOnlyPublicNetworkAccessType outboundOnlyPublicNetworkAccessType) { + this.outboundOnlyPublicNetworkAccessType = outboundOnlyPublicNetworkAccessType; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OSType.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OSType.java new file mode 100644 index 0000000000000..7f5c5621820c4 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OSType.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for OSType. + */ +public enum OSType { + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Linux. */ + LINUX("Linux"); + + /** The actual serialized value for a OSType instance. */ + private String value; + + OSType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OSType instance. + * + * @param value the serialized value to parse. + * @return the parsed OSType object, or null if unable to parse. + */ + @JsonCreator + public static OSType fromString(String value) { + OSType[] items = OSType.values(); + for (OSType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operation.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operation.java new file mode 100644 index 0000000000000..a3aab4ee02907 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationDisplay.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationDisplay.java new file mode 100644 index 0000000000000..02795284f5666 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationDisplay.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * The service provider: Microsoft.HDInsight. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed: Cluster, Applications, + * etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation type: read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Get the service provider: Microsoft.HDInsight. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the service provider: Microsoft.HDInsight. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed: Cluster, Applications, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed: Cluster, Applications, etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation type: read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation type: read, write, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationResource.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationResource.java new file mode 100644 index 0000000000000..873d830bdaa3e --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OperationResource.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The azure async operation response. + */ +public class OperationResource { + /** + * The async operation state. Possible values include: 'InProgress', + * 'Succeeded', 'Failed'. + */ + @JsonProperty(value = "status") + private AsyncOperationState status; + + /** + * The operation error information. + */ + @JsonProperty(value = "error") + private Errors error; + + /** + * Get the async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @return the status value + */ + public AsyncOperationState status() { + return this.status; + } + + /** + * Set the async operation state. Possible values include: 'InProgress', 'Succeeded', 'Failed'. + * + * @param status the status value to set + * @return the OperationResource object itself. + */ + public OperationResource withStatus(AsyncOperationState status) { + this.status = status; + return this; + } + + /** + * Get the operation error information. + * + * @return the error value + */ + public Errors error() { + return this.error; + } + + /** + * Set the operation error information. + * + * @param error the error value to set + * @return the OperationResource object itself. + */ + public OperationResource withError(Errors error) { + this.error = error; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operations.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operations.java new file mode 100644 index 0000000000000..e22be5b83ad6a --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OsProfile.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OsProfile.java new file mode 100644 index 0000000000000..b5f4f2b78c06a --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OsProfile.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Linux operation systems profile. + */ +public class OsProfile { + /** + * The Linux OS profile. + */ + @JsonProperty(value = "linuxOperatingSystemProfile") + private LinuxOperatingSystemProfile linuxOperatingSystemProfile; + + /** + * Get the Linux OS profile. + * + * @return the linuxOperatingSystemProfile value + */ + public LinuxOperatingSystemProfile linuxOperatingSystemProfile() { + return this.linuxOperatingSystemProfile; + } + + /** + * Set the Linux OS profile. + * + * @param linuxOperatingSystemProfile the linuxOperatingSystemProfile value to set + * @return the OsProfile object itself. + */ + public OsProfile withLinuxOperatingSystemProfile(LinuxOperatingSystemProfile linuxOperatingSystemProfile) { + this.linuxOperatingSystemProfile = linuxOperatingSystemProfile; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OutboundOnlyPublicNetworkAccessType.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OutboundOnlyPublicNetworkAccessType.java new file mode 100644 index 0000000000000..be80f79193191 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/OutboundOnlyPublicNetworkAccessType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OutboundOnlyPublicNetworkAccessType. + */ +public final class OutboundOnlyPublicNetworkAccessType extends ExpandableStringEnum { + /** Static value PublicLoadBalancer for OutboundOnlyPublicNetworkAccessType. */ + public static final OutboundOnlyPublicNetworkAccessType PUBLIC_LOAD_BALANCER = fromString("PublicLoadBalancer"); + + /** Static value UDR for OutboundOnlyPublicNetworkAccessType. */ + public static final OutboundOnlyPublicNetworkAccessType UDR = fromString("UDR"); + + /** + * Creates or finds a OutboundOnlyPublicNetworkAccessType from its string representation. + * @param name a name to look for + * @return the corresponding OutboundOnlyPublicNetworkAccessType + */ + @JsonCreator + public static OutboundOnlyPublicNetworkAccessType fromString(String name) { + return fromString(name, OutboundOnlyPublicNetworkAccessType.class); + } + + /** + * @return known OutboundOnlyPublicNetworkAccessType values + */ + public static Collection values() { + return values(OutboundOnlyPublicNetworkAccessType.class); + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/PublicNetworkAccess.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/PublicNetworkAccess.java new file mode 100644 index 0000000000000..d339ea0800cb5 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/PublicNetworkAccess.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicNetworkAccess. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value InboundAndOutbound for PublicNetworkAccess. */ + public static final PublicNetworkAccess INBOUND_AND_OUTBOUND = fromString("InboundAndOutbound"); + + /** Static value OutboundOnly for PublicNetworkAccess. */ + public static final PublicNetworkAccess OUTBOUND_ONLY = fromString("OutboundOnly"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * @param name a name to look for + * @return the corresponding PublicNetworkAccess + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * @return known PublicNetworkAccess values + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaCapability.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaCapability.java new file mode 100644 index 0000000000000..6c459b739d096 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaCapability.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regional quota capability. + */ +public class QuotaCapability { + /** + * The number of cores used in the subscription. + */ + @JsonProperty(value = "cores_used") + private Long coresUsed; + + /** + * The number of cores that the subscription allowed. + */ + @JsonProperty(value = "max_cores_allowed") + private Long maxCoresAllowed; + + /** + * The list of region quota capabilities. + */ + @JsonProperty(value = "regionalQuotas") + private List regionalQuotas; + + /** + * Get the number of cores used in the subscription. + * + * @return the coresUsed value + */ + public Long coresUsed() { + return this.coresUsed; + } + + /** + * Set the number of cores used in the subscription. + * + * @param coresUsed the coresUsed value to set + * @return the QuotaCapability object itself. + */ + public QuotaCapability withCoresUsed(Long coresUsed) { + this.coresUsed = coresUsed; + return this; + } + + /** + * Get the number of cores that the subscription allowed. + * + * @return the maxCoresAllowed value + */ + public Long maxCoresAllowed() { + return this.maxCoresAllowed; + } + + /** + * Set the number of cores that the subscription allowed. + * + * @param maxCoresAllowed the maxCoresAllowed value to set + * @return the QuotaCapability object itself. + */ + public QuotaCapability withMaxCoresAllowed(Long maxCoresAllowed) { + this.maxCoresAllowed = maxCoresAllowed; + return this; + } + + /** + * Get the list of region quota capabilities. + * + * @return the regionalQuotas value + */ + public List regionalQuotas() { + return this.regionalQuotas; + } + + /** + * Set the list of region quota capabilities. + * + * @param regionalQuotas the regionalQuotas value to set + * @return the QuotaCapability object itself. + */ + public QuotaCapability withRegionalQuotas(List regionalQuotas) { + this.regionalQuotas = regionalQuotas; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaInfo.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaInfo.java new file mode 100644 index 0000000000000..6a8c9f0558089 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/QuotaInfo.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota properties for the cluster. + */ +public class QuotaInfo { + /** + * The cores used by the cluster. + */ + @JsonProperty(value = "coresUsed") + private Integer coresUsed; + + /** + * Get the cores used by the cluster. + * + * @return the coresUsed value + */ + public Integer coresUsed() { + return this.coresUsed; + } + + /** + * Set the cores used by the cluster. + * + * @param coresUsed the coresUsed value to set + * @return the QuotaInfo object itself. + */ + public QuotaInfo withCoresUsed(Integer coresUsed) { + this.coresUsed = coresUsed; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionalQuotaCapability.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionalQuotaCapability.java new file mode 100644 index 0000000000000..ef45cbae68e93 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionalQuotaCapability.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regional quota capacity. + */ +public class RegionalQuotaCapability { + /** + * The region name. + */ + @JsonProperty(value = "region_name") + private String regionName; + + /** + * The number of cores used in the region. + */ + @JsonProperty(value = "cores_used") + private Long coresUsed; + + /** + * The number of cores available in the region. + */ + @JsonProperty(value = "cores_available") + private Long coresAvailable; + + /** + * Get the region name. + * + * @return the regionName value + */ + public String regionName() { + return this.regionName; + } + + /** + * Set the region name. + * + * @param regionName the regionName value to set + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withRegionName(String regionName) { + this.regionName = regionName; + return this; + } + + /** + * Get the number of cores used in the region. + * + * @return the coresUsed value + */ + public Long coresUsed() { + return this.coresUsed; + } + + /** + * Set the number of cores used in the region. + * + * @param coresUsed the coresUsed value to set + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withCoresUsed(Long coresUsed) { + this.coresUsed = coresUsed; + return this; + } + + /** + * Get the number of cores available in the region. + * + * @return the coresAvailable value + */ + public Long coresAvailable() { + return this.coresAvailable; + } + + /** + * Set the number of cores available in the region. + * + * @param coresAvailable the coresAvailable value to set + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withCoresAvailable(Long coresAvailable) { + this.coresAvailable = coresAvailable; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionsCapability.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionsCapability.java new file mode 100644 index 0000000000000..88d0126b8b36b --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RegionsCapability.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regions capability. + */ +public class RegionsCapability { + /** + * The list of region capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the list of region capabilities. + * + * @return the available value + */ + public List available() { + return this.available; + } + + /** + * Set the list of region capabilities. + * + * @param available the available value to set + * @return the RegionsCapability object itself. + */ + public RegionsCapability withAvailable(List available) { + this.available = available; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ResourceIdentityType.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ResourceIdentityType.java new file mode 100644 index 0000000000000..9cbdfca741efd --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ResourceIdentityType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceIdentityType. + */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Role.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Role.java new file mode 100644 index 0000000000000..86cfff6ce90c5 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Role.java @@ -0,0 +1,253 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ScriptActionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a role on the cluster. + */ +public class Role { + /** + * The name of the role. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The minimum instance count of the cluster. + */ + @JsonProperty(value = "minInstanceCount") + private Integer minInstanceCount; + + /** + * The instance count of the cluster. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * The autoscale configurations. + */ + @JsonProperty(value = "autoscale") + private Autoscale autoscaleConfiguration; + + /** + * The hardware profile. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /** + * The operating system profile. + */ + @JsonProperty(value = "osProfile") + private OsProfile osProfile; + + /** + * The virtual network profile. + */ + @JsonProperty(value = "virtualNetworkProfile") + private VirtualNetworkProfile virtualNetworkProfile; + + /** + * The data disks groups for the role. + */ + @JsonProperty(value = "dataDisksGroups") + private List dataDisksGroups; + + /** + * The list of script actions on the role. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Get the name of the role. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the role. + * + * @param name the name value to set + * @return the Role object itself. + */ + public Role withName(String name) { + this.name = name; + return this; + } + + /** + * Get the minimum instance count of the cluster. + * + * @return the minInstanceCount value + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minimum instance count of the cluster. + * + * @param minInstanceCount the minInstanceCount value to set + * @return the Role object itself. + */ + public Role withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the instance count of the cluster. + * + * @return the targetInstanceCount value + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the instance count of the cluster. + * + * @param targetInstanceCount the targetInstanceCount value to set + * @return the Role object itself. + */ + public Role withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + + /** + * Get the autoscale configurations. + * + * @return the autoscaleConfiguration value + */ + public Autoscale autoscaleConfiguration() { + return this.autoscaleConfiguration; + } + + /** + * Set the autoscale configurations. + * + * @param autoscaleConfiguration the autoscaleConfiguration value to set + * @return the Role object itself. + */ + public Role withAutoscaleConfiguration(Autoscale autoscaleConfiguration) { + this.autoscaleConfiguration = autoscaleConfiguration; + return this; + } + + /** + * Get the hardware profile. + * + * @return the hardwareProfile value + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardware profile. + * + * @param hardwareProfile the hardwareProfile value to set + * @return the Role object itself. + */ + public Role withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the operating system profile. + * + * @return the osProfile value + */ + public OsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the operating system profile. + * + * @param osProfile the osProfile value to set + * @return the Role object itself. + */ + public Role withOsProfile(OsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the virtual network profile. + * + * @return the virtualNetworkProfile value + */ + public VirtualNetworkProfile virtualNetworkProfile() { + return this.virtualNetworkProfile; + } + + /** + * Set the virtual network profile. + * + * @param virtualNetworkProfile the virtualNetworkProfile value to set + * @return the Role object itself. + */ + public Role withVirtualNetworkProfile(VirtualNetworkProfile virtualNetworkProfile) { + this.virtualNetworkProfile = virtualNetworkProfile; + return this; + } + + /** + * Get the data disks groups for the role. + * + * @return the dataDisksGroups value + */ + public List dataDisksGroups() { + return this.dataDisksGroups; + } + + /** + * Set the data disks groups for the role. + * + * @param dataDisksGroups the dataDisksGroups value to set + * @return the Role object itself. + */ + public Role withDataDisksGroups(List dataDisksGroups) { + this.dataDisksGroups = dataDisksGroups; + return this; + } + + /** + * Get the list of script actions on the role. + * + * @return the scriptActions value + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the list of script actions on the role. + * + * @param scriptActions the scriptActions value to set + * @return the Role object itself. + */ + public Role withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptAction.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptAction.java new file mode 100644 index 0000000000000..7f48cba55d6f9 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptAction.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a script action on a running cluster. + */ +public class RuntimeScriptAction { + /** + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * The parameters for the script. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles", required = true) + private List roles; + + /** + * The application name of the script action, if any. + */ + @JsonProperty(value = "applicationName", access = JsonProperty.Access.WRITE_ONLY) + private String applicationName; + + /** + * Get the name of the script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the script action. + * + * @param name the name value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script. + * + * @param parameters the parameters value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the list of roles where script will be executed. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles where script will be executed. + * + * @param roles the roles value to set + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the application name of the script action, if any. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptActionDetail.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptActionDetail.java new file mode 100644 index 0000000000000..1ebb47d93dff1 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/RuntimeScriptActionDetail.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.RuntimeScriptActionDetailInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import java.util.List; + +/** + * Type representing RuntimeScriptActionDetail. + */ +public interface RuntimeScriptActionDetail extends HasInner, HasManager { + /** + * @return the applicationName value. + */ + String applicationName(); + + /** + * @return the debugInformation value. + */ + String debugInformation(); + + /** + * @return the endTime value. + */ + String endTime(); + + /** + * @return the executionSummary value. + */ + List executionSummary(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the operation value. + */ + String operation(); + + /** + * @return the parameters value. + */ + String parameters(); + + /** + * @return the roles value. + */ + List roles(); + + /** + * @return the scriptExecutionId value. + */ + Long scriptExecutionId(); + + /** + * @return the startTime value. + */ + String startTime(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the uri value. + */ + String uri(); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionExecutionSummary.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionExecutionSummary.java new file mode 100644 index 0000000000000..47500214d1b6d --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionExecutionSummary.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The execution summary of a script action. + */ +public class ScriptActionExecutionSummary { + /** + * The status of script action execution. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The instance count for a given script action execution status. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** + * Get the status of script action execution. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the instance count for a given script action execution status. + * + * @return the instanceCount value + */ + public Integer instanceCount() { + return this.instanceCount; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionPersistedGetResponseSpec.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionPersistedGetResponseSpec.java new file mode 100644 index 0000000000000..61c41edfe6087 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActionPersistedGetResponseSpec.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The persisted script action for cluster. + */ +public class ScriptActionPersistedGetResponseSpec { + /** + * The name of script action. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /** + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * The application name for the script action. + */ + @JsonProperty(value = "applicationName") + private String applicationName; + + /** + * Get the name of script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of script action. + * + * @param name the name value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script provided. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script provided. + * + * @param parameters the parameters value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the list of roles where script will be executed. + * + * @return the roles value + */ + public List roles() { + return this.roles; + } + + /** + * Set the list of roles where script will be executed. + * + * @param roles the roles value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the application name for the script action. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the application name for the script action. + * + * @param applicationName the applicationName value to set + * @return the ScriptActionPersistedGetResponseSpec object itself. + */ + public ScriptActionPersistedGetResponseSpec withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActions.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActions.java new file mode 100644 index 0000000000000..1c17347a6add1 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptActions.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ScriptActionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScriptActions. + */ +public interface ScriptActions extends HasInner { + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listPersistedScriptsAsync(final String resourceGroupName, final String clusterName); + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName); + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptExecutionHistorys.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptExecutionHistorys.java new file mode 100644 index 0000000000000..43e9d4c92a135 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/ScriptExecutionHistorys.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.ScriptExecutionHistorysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScriptExecutionHistorys. + */ +public interface ScriptExecutionHistorys extends HasInner { + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String clusterName); + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SecurityProfile.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SecurityProfile.java new file mode 100644 index 0000000000000..f0f9b4fa04290 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SecurityProfile.java @@ -0,0 +1,255 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The security profile which contains Ssh public key for the HDInsight + * cluster. + */ +public class SecurityProfile { + /** + * The directory type. Possible values include: 'ActiveDirectory'. + */ + @JsonProperty(value = "directoryType") + private DirectoryType directoryType; + + /** + * The organization's active directory domain. + */ + @JsonProperty(value = "domain") + private String domain; + + /** + * The organizational unit within the Active Directory to place the cluster + * and service accounts. + */ + @JsonProperty(value = "organizationalUnitDN") + private String organizationalUnitDN; + + /** + * The LDAPS protocol URLs to communicate with the Active Directory. + */ + @JsonProperty(value = "ldapsUrls") + private List ldapsUrls; + + /** + * The domain user account that will have admin privileges on the cluster. + */ + @JsonProperty(value = "domainUsername") + private String domainUsername; + + /** + * The domain admin password. + */ + @JsonProperty(value = "domainUserPassword") + private String domainUserPassword; + + /** + * Optional. The Distinguished Names for cluster user groups. + */ + @JsonProperty(value = "clusterUsersGroupDNs") + private List clusterUsersGroupDNs; + + /** + * The resource ID of the user's Azure Active Directory Domain Service. + */ + @JsonProperty(value = "aaddsResourceId") + private String aaddsResourceId; + + /** + * User assigned identity that has permissions to read and create + * cluster-related artifacts in the user's AADDS. + */ + @JsonProperty(value = "msiResourceId") + private String msiResourceId; + + /** + * Get the directory type. Possible values include: 'ActiveDirectory'. + * + * @return the directoryType value + */ + public DirectoryType directoryType() { + return this.directoryType; + } + + /** + * Set the directory type. Possible values include: 'ActiveDirectory'. + * + * @param directoryType the directoryType value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDirectoryType(DirectoryType directoryType) { + this.directoryType = directoryType; + return this; + } + + /** + * Get the organization's active directory domain. + * + * @return the domain value + */ + public String domain() { + return this.domain; + } + + /** + * Set the organization's active directory domain. + * + * @param domain the domain value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the organizational unit within the Active Directory to place the cluster and service accounts. + * + * @return the organizationalUnitDN value + */ + public String organizationalUnitDN() { + return this.organizationalUnitDN; + } + + /** + * Set the organizational unit within the Active Directory to place the cluster and service accounts. + * + * @param organizationalUnitDN the organizationalUnitDN value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withOrganizationalUnitDN(String organizationalUnitDN) { + this.organizationalUnitDN = organizationalUnitDN; + return this; + } + + /** + * Get the LDAPS protocol URLs to communicate with the Active Directory. + * + * @return the ldapsUrls value + */ + public List ldapsUrls() { + return this.ldapsUrls; + } + + /** + * Set the LDAPS protocol URLs to communicate with the Active Directory. + * + * @param ldapsUrls the ldapsUrls value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withLdapsUrls(List ldapsUrls) { + this.ldapsUrls = ldapsUrls; + return this; + } + + /** + * Get the domain user account that will have admin privileges on the cluster. + * + * @return the domainUsername value + */ + public String domainUsername() { + return this.domainUsername; + } + + /** + * Set the domain user account that will have admin privileges on the cluster. + * + * @param domainUsername the domainUsername value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUsername(String domainUsername) { + this.domainUsername = domainUsername; + return this; + } + + /** + * Get the domain admin password. + * + * @return the domainUserPassword value + */ + public String domainUserPassword() { + return this.domainUserPassword; + } + + /** + * Set the domain admin password. + * + * @param domainUserPassword the domainUserPassword value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUserPassword(String domainUserPassword) { + this.domainUserPassword = domainUserPassword; + return this; + } + + /** + * Get optional. The Distinguished Names for cluster user groups. + * + * @return the clusterUsersGroupDNs value + */ + public List clusterUsersGroupDNs() { + return this.clusterUsersGroupDNs; + } + + /** + * Set optional. The Distinguished Names for cluster user groups. + * + * @param clusterUsersGroupDNs the clusterUsersGroupDNs value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withClusterUsersGroupDNs(List clusterUsersGroupDNs) { + this.clusterUsersGroupDNs = clusterUsersGroupDNs; + return this; + } + + /** + * Get the resource ID of the user's Azure Active Directory Domain Service. + * + * @return the aaddsResourceId value + */ + public String aaddsResourceId() { + return this.aaddsResourceId; + } + + /** + * Set the resource ID of the user's Azure Active Directory Domain Service. + * + * @param aaddsResourceId the aaddsResourceId value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withAaddsResourceId(String aaddsResourceId) { + this.aaddsResourceId = aaddsResourceId; + return this; + } + + /** + * Get user assigned identity that has permissions to read and create cluster-related artifacts in the user's AADDS. + * + * @return the msiResourceId value + */ + public String msiResourceId() { + return this.msiResourceId; + } + + /** + * Set user assigned identity that has permissions to read and create cluster-related artifacts in the user's AADDS. + * + * @param msiResourceId the msiResourceId value to set + * @return the SecurityProfile object itself. + */ + public SecurityProfile withMsiResourceId(String msiResourceId) { + this.msiResourceId = msiResourceId; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshProfile.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshProfile.java new file mode 100644 index 0000000000000..630e034ccdc87 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshProfile.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of SSH public keys. + */ +public class SshProfile { + /** + * The list of SSH public keys. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the list of SSH public keys. + * + * @return the publicKeys value + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the list of SSH public keys. + * + * @param publicKeys the publicKeys value to set + * @return the SshProfile object itself. + */ + public SshProfile withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshPublicKey.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshPublicKey.java new file mode 100644 index 0000000000000..4cd02c94237fe --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/SshPublicKey.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SSH public key for the cluster nodes. + */ +public class SshPublicKey { + /** + * The certificate for SSH. + */ + @JsonProperty(value = "certificateData") + private String certificateData; + + /** + * Get the certificate for SSH. + * + * @return the certificateData value + */ + public String certificateData() { + return this.certificateData; + } + + /** + * Set the certificate for SSH. + * + * @param certificateData the certificateData value to set + * @return the SshPublicKey object itself. + */ + public SshPublicKey withCertificateData(String certificateData) { + this.certificateData = certificateData; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageAccount.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageAccount.java new file mode 100644 index 0000000000000..779f7758e16ae --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageAccount.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage Account. + */ +public class StorageAccount { + /** + * The name of the storage account. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Whether or not the storage account is the default storage account. + */ + @JsonProperty(value = "isDefault") + private Boolean isDefault; + + /** + * The container in the storage account, only to be specified for WASB + * storage accounts. + */ + @JsonProperty(value = "container") + private String container; + + /** + * The filesystem, only to be specified for Azure Data Lake Storage Gen 2. + */ + @JsonProperty(value = "fileSystem") + private String fileSystem; + + /** + * The storage account access key. + */ + @JsonProperty(value = "key") + private String key; + + /** + * The resource ID of storage account, only to be specified for Azure Data + * Lake Storage Gen 2. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The managed identity (MSI) that is allowed to access the storage + * account, only to be specified for Azure Data Lake Storage Gen 2. + */ + @JsonProperty(value = "msiResourceId") + private String msiResourceId; + + /** + * Get the name of the storage account. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the storage account. + * + * @param name the name value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withName(String name) { + this.name = name; + return this; + } + + /** + * Get whether or not the storage account is the default storage account. + * + * @return the isDefault value + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Set whether or not the storage account is the default storage account. + * + * @param isDefault the isDefault value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the container in the storage account, only to be specified for WASB storage accounts. + * + * @return the container value + */ + public String container() { + return this.container; + } + + /** + * Set the container in the storage account, only to be specified for WASB storage accounts. + * + * @param container the container value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the filesystem, only to be specified for Azure Data Lake Storage Gen 2. + * + * @return the fileSystem value + */ + public String fileSystem() { + return this.fileSystem; + } + + /** + * Set the filesystem, only to be specified for Azure Data Lake Storage Gen 2. + * + * @param fileSystem the fileSystem value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withFileSystem(String fileSystem) { + this.fileSystem = fileSystem; + return this; + } + + /** + * Get the storage account access key. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the storage account access key. + * + * @param key the key value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the resource ID of storage account, only to be specified for Azure Data Lake Storage Gen 2. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resource ID of storage account, only to be specified for Azure Data Lake Storage Gen 2. + * + * @param resourceId the resourceId value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the managed identity (MSI) that is allowed to access the storage account, only to be specified for Azure Data Lake Storage Gen 2. + * + * @return the msiResourceId value + */ + public String msiResourceId() { + return this.msiResourceId; + } + + /** + * Set the managed identity (MSI) that is allowed to access the storage account, only to be specified for Azure Data Lake Storage Gen 2. + * + * @param msiResourceId the msiResourceId value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withMsiResourceId(String msiResourceId) { + this.msiResourceId = msiResourceId; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageProfile.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageProfile.java new file mode 100644 index 0000000000000..2bbb3039bcc05 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/StorageProfile.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage profile. + */ +public class StorageProfile { + /** + * The list of storage accounts in the cluster. + */ + @JsonProperty(value = "storageaccounts") + private List storageaccounts; + + /** + * Get the list of storage accounts in the cluster. + * + * @return the storageaccounts value + */ + public List storageaccounts() { + return this.storageaccounts; + } + + /** + * Set the list of storage accounts in the cluster. + * + * @param storageaccounts the storageaccounts value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withStorageaccounts(List storageaccounts) { + this.storageaccounts = storageaccounts; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Tier.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Tier.java new file mode 100644 index 0000000000000..7dc759818fca7 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Tier.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Tier. + */ +public enum Tier { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a Tier instance. */ + private String value; + + Tier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Tier instance. + * + * @param value the serialized value to parse. + * @return the parsed Tier object, or null if unable to parse. + */ + @JsonCreator + public static Tier fromString(String value) { + Tier[] items = Tier.values(); + for (Tier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UpdateGatewaySettingsParameters.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UpdateGatewaySettingsParameters.java new file mode 100644 index 0000000000000..ddeb9a1028d01 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UpdateGatewaySettingsParameters.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The update gateway settings request parameters. + */ +public class UpdateGatewaySettingsParameters { + /** + * Indicates whether or not the gateway settings based authorization is + * enabled. + */ + @JsonProperty(value = "restAuthCredential\\.isEnabled") + private Boolean isCredentialEnabled; + + /** + * The gateway settings user name. + */ + @JsonProperty(value = "restAuthCredential\\.username") + private String userName; + + /** + * The gateway settings user password. + */ + @JsonProperty(value = "restAuthCredential\\.password") + private String password; + + /** + * Get indicates whether or not the gateway settings based authorization is enabled. + * + * @return the isCredentialEnabled value + */ + public Boolean isCredentialEnabled() { + return this.isCredentialEnabled; + } + + /** + * Set indicates whether or not the gateway settings based authorization is enabled. + * + * @param isCredentialEnabled the isCredentialEnabled value to set + * @return the UpdateGatewaySettingsParameters object itself. + */ + public UpdateGatewaySettingsParameters withIsCredentialEnabled(Boolean isCredentialEnabled) { + this.isCredentialEnabled = isCredentialEnabled; + return this; + } + + /** + * Get the gateway settings user name. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set the gateway settings user name. + * + * @param userName the userName value to set + * @return the UpdateGatewaySettingsParameters object itself. + */ + public UpdateGatewaySettingsParameters withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get the gateway settings user password. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the gateway settings user password. + * + * @param password the password value to set + * @return the UpdateGatewaySettingsParameters object itself. + */ + public UpdateGatewaySettingsParameters withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Usage.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Usage.java new file mode 100644 index 0000000000000..dc0f242a2493a --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/Usage.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The details about the usage of a particular limited resource. + */ +public class Usage { + /** + * The type of measurement for usage. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The current usage. + */ + @JsonProperty(value = "currentValue") + private Integer currentValue; + + /** + * The maximum allowed usage. + */ + @JsonProperty(value = "limit") + private Integer limit; + + /** + * The details about the localizable name of the used resource. + */ + @JsonProperty(value = "name") + private LocalizedName name; + + /** + * Get the type of measurement for usage. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the type of measurement for usage. + * + * @param unit the unit value to set + * @return the Usage object itself. + */ + public Usage withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the current usage. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Set the current usage. + * + * @param currentValue the currentValue value to set + * @return the Usage object itself. + */ + public Usage withCurrentValue(Integer currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the maximum allowed usage. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Set the maximum allowed usage. + * + * @param limit the limit value to set + * @return the Usage object itself. + */ + public Usage withLimit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Get the details about the localizable name of the used resource. + * + * @return the name value + */ + public LocalizedName name() { + return this.name; + } + + /** + * Set the details about the localizable name of the used resource. + * + * @param name the name value to set + * @return the Usage object itself. + */ + public Usage withName(LocalizedName name) { + this.name = name; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UsagesListResult.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UsagesListResult.java new file mode 100644 index 0000000000000..41df247f70111 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/UsagesListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.HDInsightManager; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation.UsagesListResultInner; +import java.util.List; + +/** + * Type representing UsagesListResult. + */ +public interface UsagesListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionSpec.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionSpec.java new file mode 100644 index 0000000000000..69ca14ae0810f --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionSpec.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The version properties. + */ +public class VersionSpec { + /** + * The friendly name. + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /** + * The display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Whether or not the version is the default version. + */ + @JsonProperty(value = "isDefault") + private String isDefault; + + /** + * The component version property. + */ + @JsonProperty(value = "componentVersions") + private Map componentVersions; + + /** + * Get the friendly name. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendly name. + * + * @param friendlyName the friendlyName value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name. + * + * @param displayName the displayName value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get whether or not the version is the default version. + * + * @return the isDefault value + */ + public String isDefault() { + return this.isDefault; + } + + /** + * Set whether or not the version is the default version. + * + * @param isDefault the isDefault value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withIsDefault(String isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the component version property. + * + * @return the componentVersions value + */ + public Map componentVersions() { + return this.componentVersions; + } + + /** + * Set the component version property. + * + * @param componentVersions the componentVersions value to set + * @return the VersionSpec object itself. + */ + public VersionSpec withComponentVersions(Map componentVersions) { + this.componentVersions = componentVersions; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionsCapability.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionsCapability.java new file mode 100644 index 0000000000000..7c2cdb4dcba0b --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VersionsCapability.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The version capability. + */ +public class VersionsCapability { + /** + * The list of version capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the list of version capabilities. + * + * @return the available value + */ + public List available() { + return this.available; + } + + /** + * Set the list of version capabilities. + * + * @param available the available value to set + * @return the VersionsCapability object itself. + */ + public VersionsCapability withAvailable(List available) { + this.available = available; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VirtualNetworkProfile.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VirtualNetworkProfile.java new file mode 100644 index 0000000000000..a0a63a604d88c --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VirtualNetworkProfile.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual network properties. + */ +public class VirtualNetworkProfile { + /** + * The ID of the virtual network. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the subnet. + */ + @JsonProperty(value = "subnet") + private String subnet; + + /** + * Get the ID of the virtual network. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the virtual network. + * + * @param id the id value to set + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the subnet. + * + * @return the subnet value + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the name of the subnet. + * + * @param subnet the subnet value to set + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilter.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilter.java new file mode 100644 index 0000000000000..b861aad8dab88 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilter.java @@ -0,0 +1,174 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual machine type compatibility filter. + */ +public class VmSizeCompatibilityFilter { + /** + * The mode for the filter. + */ + @JsonProperty(value = "FilterMode") + private String filterMode; + + /** + * The list of regions. + */ + @JsonProperty(value = "Regions") + private List regions; + + /** + * The list of cluster types available. + */ + @JsonProperty(value = "ClusterFlavors") + private List clusterFlavors; + + /** + * The list of node types. + */ + @JsonProperty(value = "NodeTypes") + private List nodeTypes; + + /** + * The list of cluster versions. + */ + @JsonProperty(value = "ClusterVersions") + private List clusterVersions; + + /** + * The list of virtual machine sizes. + */ + @JsonProperty(value = "vmsizes") + private List vmsizes; + + /** + * Get the mode for the filter. + * + * @return the filterMode value + */ + public String filterMode() { + return this.filterMode; + } + + /** + * Set the mode for the filter. + * + * @param filterMode the filterMode value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withFilterMode(String filterMode) { + this.filterMode = filterMode; + return this; + } + + /** + * Get the list of regions. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the list of regions. + * + * @param regions the regions value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Get the list of cluster types available. + * + * @return the clusterFlavors value + */ + public List clusterFlavors() { + return this.clusterFlavors; + } + + /** + * Set the list of cluster types available. + * + * @param clusterFlavors the clusterFlavors value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withClusterFlavors(List clusterFlavors) { + this.clusterFlavors = clusterFlavors; + return this; + } + + /** + * Get the list of node types. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of node types. + * + * @param nodeTypes the nodeTypes value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the list of cluster versions. + * + * @return the clusterVersions value + */ + public List clusterVersions() { + return this.clusterVersions; + } + + /** + * Set the list of cluster versions. + * + * @param clusterVersions the clusterVersions value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withClusterVersions(List clusterVersions) { + this.clusterVersions = clusterVersions; + return this; + } + + /** + * Get the list of virtual machine sizes. + * + * @return the vmsizes value + */ + public List vmsizes() { + return this.vmsizes; + } + + /** + * Set the list of virtual machine sizes. + * + * @param vmsizes the vmsizes value to set + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withVmsizes(List vmsizes) { + this.vmsizes = vmsizes; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilterV2.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilterV2.java new file mode 100644 index 0000000000000..2356e08de271b --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizeCompatibilityFilterV2.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This class represent a single filter object that defines a multidimensional + * set. The dimensions of this set are Regions, ClusterFlavors, NodeTypes and + * ClusterVersions. The constraint should be defined based on the following: + * FilterMode (Exclude vs Include), VMSizes (the vm sizes in affect of + * exclusion/inclusion) and the ordering of the Filters. Later filters override + * previous settings if conflicted. + */ +public class VmSizeCompatibilityFilterV2 { + /** + * The filtering mode. Effectively this can enabling or disabling the VM + * sizes in a particular set. Possible values include: 'Exclude', + * 'Include'. + */ + @JsonProperty(value = "filterMode") + private FilterMode filterMode; + + /** + * The list of regions under the effect of the filter. + */ + @JsonProperty(value = "regions") + private List regions; + + /** + * The list of cluster flavors under the effect of the filter. + */ + @JsonProperty(value = "clusterFlavors") + private List clusterFlavors; + + /** + * The list of node types affected by the filter. + */ + @JsonProperty(value = "nodeTypes") + private List nodeTypes; + + /** + * The list of cluster versions affected in Major.Minor format. + */ + @JsonProperty(value = "clusterVersions") + private List clusterVersions; + + /** + * The OSType affected, Windows or Linux. + */ + @JsonProperty(value = "osType") + private List osType; + + /** + * The list of virtual machine sizes to include or exclude. + */ + @JsonProperty(value = "vmSizes") + private List vmSizes; + + /** + * Get the filtering mode. Effectively this can enabling or disabling the VM sizes in a particular set. Possible values include: 'Exclude', 'Include'. + * + * @return the filterMode value + */ + public FilterMode filterMode() { + return this.filterMode; + } + + /** + * Set the filtering mode. Effectively this can enabling or disabling the VM sizes in a particular set. Possible values include: 'Exclude', 'Include'. + * + * @param filterMode the filterMode value to set + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withFilterMode(FilterMode filterMode) { + this.filterMode = filterMode; + return this; + } + + /** + * Get the list of regions under the effect of the filter. + * + * @return the regions value + */ + public List regions() { + return this.regions; + } + + /** + * Set the list of regions under the effect of the filter. + * + * @param regions the regions value to set + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Get the list of cluster flavors under the effect of the filter. + * + * @return the clusterFlavors value + */ + public List clusterFlavors() { + return this.clusterFlavors; + } + + /** + * Set the list of cluster flavors under the effect of the filter. + * + * @param clusterFlavors the clusterFlavors value to set + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withClusterFlavors(List clusterFlavors) { + this.clusterFlavors = clusterFlavors; + return this; + } + + /** + * Get the list of node types affected by the filter. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of node types affected by the filter. + * + * @param nodeTypes the nodeTypes value to set + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the list of cluster versions affected in Major.Minor format. + * + * @return the clusterVersions value + */ + public List clusterVersions() { + return this.clusterVersions; + } + + /** + * Set the list of cluster versions affected in Major.Minor format. + * + * @param clusterVersions the clusterVersions value to set + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withClusterVersions(List clusterVersions) { + this.clusterVersions = clusterVersions; + return this; + } + + /** + * Get the OSType affected, Windows or Linux. + * + * @return the osType value + */ + public List osType() { + return this.osType; + } + + /** + * Set the OSType affected, Windows or Linux. + * + * @param osType the osType value to set + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withOsType(List osType) { + this.osType = osType; + return this; + } + + /** + * Get the list of virtual machine sizes to include or exclude. + * + * @return the vmSizes value + */ + public List vmSizes() { + return this.vmSizes; + } + + /** + * Set the list of virtual machine sizes to include or exclude. + * + * @param vmSizes the vmSizes value to set + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withVmSizes(List vmSizes) { + this.vmSizes = vmSizes; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizesCapability.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizesCapability.java new file mode 100644 index 0000000000000..59cd9f7bd761b --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/VmSizesCapability.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The virtual machine sizes capability. + */ +public class VmSizesCapability { + /** + * The list of virtual machine size capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the list of virtual machine size capabilities. + * + * @return the available value + */ + public List available() { + return this.available; + } + + /** + * Set the list of virtual machine size capabilities. + * + * @param available the available value to set + * @return the VmSizesCapability object itself. + */ + public VmSizesCapability withAvailable(List available) { + this.available = available; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationImpl.java new file mode 100644 index 0000000000000..bc80542222de0 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Application; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ApplicationProperties; + +class ApplicationImpl extends CreatableUpdatableImpl implements Application, Application.Definition, Application.Update { + private final HDInsightManager manager; + private String resourceGroupName; + private String clusterName; + private String applicationName; + + ApplicationImpl(String name, HDInsightManager manager) { + super(name, new ApplicationInner()); + this.manager = manager; + // Set resource name + this.applicationName = name; + // + } + + ApplicationImpl(ApplicationInner inner, HDInsightManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.applicationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.applicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "applications"); + // + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createAsync(this.resourceGroupName, this.clusterName, this.applicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.createAsync(this.resourceGroupName, this.clusterName, this.applicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.getAsync(this.resourceGroupName, this.clusterName, this.applicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ApplicationProperties properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ApplicationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public ApplicationImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public ApplicationImpl withProperties(ApplicationProperties properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public ApplicationImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationInner.java new file mode 100644 index 0000000000000..585317163657c --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ApplicationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The HDInsight cluster application. + */ +public class ApplicationInner extends ProxyResource { + /** + * The ETag for the application. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The tags for the application. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The properties of the application. + */ + @JsonProperty(value = "properties") + private ApplicationProperties properties; + + /** + * Get the ETag for the application. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag for the application. + * + * @param etag the etag value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the tags for the application. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the application. + * + * @param tags the tags value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties of the application. + * + * @return the properties value + */ + public ApplicationProperties properties() { + return this.properties; + } + + /** + * Set the properties of the application. + * + * @param properties the properties value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withProperties(ApplicationProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsImpl.java new file mode 100644 index 0000000000000..af6616625da84 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Application; + +class ApplicationsImpl extends WrapperImpl implements Applications { + private final HDInsightManager manager; + + ApplicationsImpl(HDInsightManager manager) { + super(manager.inner().applications()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public ApplicationImpl define(String name) { + return wrapModel(name); + } + + private ApplicationImpl wrapModel(ApplicationInner inner) { + return new ApplicationImpl(inner, manager()); + } + + private ApplicationImpl wrapModel(String name) { + return new ApplicationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String clusterName) { + ApplicationsInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, applicationName) + .flatMap(new Func1>() { + @Override + public Observable call(ApplicationInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Application)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + ApplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, applicationName).toCompletable(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsInner.java new file mode 100644 index 0000000000000..75518b9e1e1a5 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ApplicationsInner.java @@ -0,0 +1,774 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Applications. + */ +public class ApplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ApplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Applications to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listSinglePageAsync(resourceGroupName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner get(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String applicationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner create(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().last().body(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationInner object if successful. + */ + public ApplicationInner beginCreate(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().single().body(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters), serviceCallback); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The application create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String applicationName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().last().body(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName, String applicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).toBlocking().single().body(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName), serviceCallback); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String applicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ApplicationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/BillingResponseListResultImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/BillingResponseListResultImpl.java new file mode 100644 index 0000000000000..3aeadeb4d7c1a --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/BillingResponseListResultImpl.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.BillingResponseListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.BillingResources; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizeCompatibilityFilterV2; + +class BillingResponseListResultImpl extends WrapperImpl implements BillingResponseListResult { + private final HDInsightManager manager; + BillingResponseListResultImpl(BillingResponseListResultInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public List billingResources() { + return this.inner().billingResources(); + } + + @Override + public List vmSizeFilters() { + return this.inner().vmSizeFilters(); + } + + @Override + public List vmSizes() { + return this.inner().vmSizes(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/BillingResponseListResultInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/BillingResponseListResultInner.java new file mode 100644 index 0000000000000..a420aedeb21aa --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/BillingResponseListResultInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizeCompatibilityFilterV2; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.BillingResources; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response for the operation to get regional billingSpecs for a + * subscription. + */ +public class BillingResponseListResultInner { + /** + * The virtual machine sizes to include or exclude. + */ + @JsonProperty(value = "vmSizes") + private List vmSizes; + + /** + * The virtual machine filtering mode. Effectively this can enabling or + * disabling the virtual machine sizes in a particular set. + */ + @JsonProperty(value = "vmSizeFilters") + private List vmSizeFilters; + + /** + * The billing and managed disk billing resources for a region. + */ + @JsonProperty(value = "billingResources") + private List billingResources; + + /** + * Get the virtual machine sizes to include or exclude. + * + * @return the vmSizes value + */ + public List vmSizes() { + return this.vmSizes; + } + + /** + * Set the virtual machine sizes to include or exclude. + * + * @param vmSizes the vmSizes value to set + * @return the BillingResponseListResultInner object itself. + */ + public BillingResponseListResultInner withVmSizes(List vmSizes) { + this.vmSizes = vmSizes; + return this; + } + + /** + * Get the virtual machine filtering mode. Effectively this can enabling or disabling the virtual machine sizes in a particular set. + * + * @return the vmSizeFilters value + */ + public List vmSizeFilters() { + return this.vmSizeFilters; + } + + /** + * Set the virtual machine filtering mode. Effectively this can enabling or disabling the virtual machine sizes in a particular set. + * + * @param vmSizeFilters the vmSizeFilters value to set + * @return the BillingResponseListResultInner object itself. + */ + public BillingResponseListResultInner withVmSizeFilters(List vmSizeFilters) { + this.vmSizeFilters = vmSizeFilters; + return this; + } + + /** + * Get the billing and managed disk billing resources for a region. + * + * @return the billingResources value + */ + public List billingResources() { + return this.billingResources; + } + + /** + * Set the billing and managed disk billing resources for a region. + * + * @param billingResources the billingResources value to set + * @return the BillingResponseListResultInner object itself. + */ + public BillingResponseListResultInner withBillingResources(List billingResources) { + this.billingResources = billingResources; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultImpl.java new file mode 100644 index 0000000000000..b2b6e28bc5a46 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.CapabilitiesResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.QuotaCapability; +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RegionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VersionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizeCompatibilityFilter; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizesCapability; + +class CapabilitiesResultImpl extends WrapperImpl implements CapabilitiesResult { + private final HDInsightManager manager; + CapabilitiesResultImpl(CapabilitiesResultInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public List features() { + return this.inner().features(); + } + + @Override + public QuotaCapability quota() { + return this.inner().quota(); + } + + @Override + public Map regions() { + return this.inner().regions(); + } + + @Override + public Map versions() { + return this.inner().versions(); + } + + @Override + public List vmSizeFilters() { + return this.inner().vmSizeFilters(); + } + + @Override + public Map vmSizes() { + return this.inner().vmSizes(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultInner.java new file mode 100644 index 0000000000000..ea9cee282746f --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/CapabilitiesResultInner.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.Map; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VersionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RegionsCapability; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizesCapability; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.VmSizeCompatibilityFilter; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.QuotaCapability; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Get Capabilities operation response. + */ +public class CapabilitiesResultInner { + /** + * The version capability. + */ + @JsonProperty(value = "versions") + private Map versions; + + /** + * The virtual machine size compatibility features. + */ + @JsonProperty(value = "regions") + private Map regions; + + /** + * The virtual machine sizes. + */ + @JsonProperty(value = "vmSizes") + private Map vmSizes; + + /** + * The virtual machine size compatibility filters. + */ + @JsonProperty(value = "vmSize_filters") + private List vmSizeFilters; + + /** + * The capability features. + */ + @JsonProperty(value = "features") + private List features; + + /** + * The quota capability. + */ + @JsonProperty(value = "quota") + private QuotaCapability quota; + + /** + * Get the version capability. + * + * @return the versions value + */ + public Map versions() { + return this.versions; + } + + /** + * Set the version capability. + * + * @param versions the versions value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVersions(Map versions) { + this.versions = versions; + return this; + } + + /** + * Get the virtual machine size compatibility features. + * + * @return the regions value + */ + public Map regions() { + return this.regions; + } + + /** + * Set the virtual machine size compatibility features. + * + * @param regions the regions value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withRegions(Map regions) { + this.regions = regions; + return this; + } + + /** + * Get the virtual machine sizes. + * + * @return the vmSizes value + */ + public Map vmSizes() { + return this.vmSizes; + } + + /** + * Set the virtual machine sizes. + * + * @param vmSizes the vmSizes value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVmSizes(Map vmSizes) { + this.vmSizes = vmSizes; + return this; + } + + /** + * Get the virtual machine size compatibility filters. + * + * @return the vmSizeFilters value + */ + public List vmSizeFilters() { + return this.vmSizeFilters; + } + + /** + * Set the virtual machine size compatibility filters. + * + * @param vmSizeFilters the vmSizeFilters value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVmSizeFilters(List vmSizeFilters) { + this.vmSizeFilters = vmSizeFilters; + return this; + } + + /** + * Get the capability features. + * + * @return the features value + */ + public List features() { + return this.features; + } + + /** + * Set the capability features. + * + * @param features the features value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Get the quota capability. + * + * @return the quota value + */ + public QuotaCapability quota() { + return this.quota; + } + + /** + * Set the quota capability. + * + * @param quota the quota value to set + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withQuota(QuotaCapability quota) { + this.quota = quota; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterConfigurationsImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterConfigurationsImpl.java new file mode 100644 index 0000000000000..bb8d56ce48b49 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterConfigurationsImpl.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterConfigurations; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class ClusterConfigurationsImpl extends WrapperImpl implements ClusterConfigurations { + private final HDInsightManager manager; + ClusterConfigurationsImpl(ClusterConfigurationsInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Map> configurations() { + return this.inner().configurations(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterConfigurationsInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterConfigurationsInner.java new file mode 100644 index 0000000000000..eb721ccd5d1ff --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterConfigurationsInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration object for the specified cluster. + */ +public class ClusterConfigurationsInner { + /** + * The configuration object for the specified configuration for the + * specified cluster. + */ + @JsonProperty(value = "configurations") + private Map> configurations; + + /** + * Get the configuration object for the specified configuration for the specified cluster. + * + * @return the configurations value + */ + public Map> configurations() { + return this.configurations; + } + + /** + * Set the configuration object for the specified configuration for the specified cluster. + * + * @param configurations the configurations value to set + * @return the ClusterConfigurationsInner object itself. + */ + public ClusterConfigurationsInner withConfigurations(Map> configurations) { + this.configurations = configurations; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterImpl.java new file mode 100644 index 0000000000000..3763fee5ef9d4 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Cluster; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterCreateParametersExtended; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterIdentity; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterGetProperties; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterCreateProperties; +import rx.functions.Func1; + +class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterCreateParametersExtended createOrUpdateParameter; + ClusterImpl(String name, ClusterInner inner, HDInsightManager manager) { + super(name, inner, manager); + this.createOrUpdateParameter = new ClusterCreateParametersExtended(); + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + this.createOrUpdateParameter.withLocation(inner().location()); + this.createOrUpdateParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createAsync(this.resourceGroupName(), this.name(), this.createOrUpdateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new ClusterCreateParametersExtended(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public ClusterIdentity identity() { + return this.inner().identity(); + } + + @Override + public ClusterGetProperties properties() { + return this.inner().properties(); + } + + @Override + public ClusterImpl withIdentity(ClusterIdentity identity) { + this.createOrUpdateParameter.withIdentity(identity); + return this; + } + + @Override + public ClusterImpl withProperties(ClusterCreateProperties properties) { + this.createOrUpdateParameter.withProperties(properties); + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterInner.java new file mode 100644 index 0000000000000..94904f86bfbf3 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterGetProperties; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * The HDInsight cluster. + */ +@SkipParentValidation +public class ClusterInner extends Resource { + /** + * The ETag for the resource. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The properties of the cluster. + */ + @JsonProperty(value = "properties") + private ClusterGetProperties properties; + + /** + * The identity of the cluster, if configured. + */ + @JsonProperty(value = "identity") + private ClusterIdentity identity; + + /** + * Get the ETag for the resource. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag for the resource. + * + * @param etag the etag value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the properties of the cluster. + * + * @return the properties value + */ + public ClusterGetProperties properties() { + return this.properties; + } + + /** + * Set the properties of the cluster. + * + * @param properties the properties value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withProperties(ClusterGetProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity of the cluster, if configured. + * + * @return the identity value + */ + public ClusterIdentity identity() { + return this.identity; + } + + /** + * Set the identity of the cluster, if configured. + * + * @param identity the identity value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withIdentity(ClusterIdentity identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseImpl.java new file mode 100644 index 0000000000000..ef98a3fa94040 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ClusterMonitoringResponseImpl extends WrapperImpl implements ClusterMonitoringResponse { + private final HDInsightManager manager; + ClusterMonitoringResponseImpl(ClusterMonitoringResponseInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Boolean clusterMonitoringEnabled() { + return this.inner().clusterMonitoringEnabled(); + } + + @Override + public String workspaceId() { + return this.inner().workspaceId(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseInner.java new file mode 100644 index 0000000000000..ee8f37c4ec438 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClusterMonitoringResponseInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operations Management Suite (OMS) status response. + */ +public class ClusterMonitoringResponseInner { + /** + * The status of the Operations Management Suite (OMS) on the HDInsight + * cluster. + */ + @JsonProperty(value = "clusterMonitoringEnabled") + private Boolean clusterMonitoringEnabled; + + /** + * The workspace ID of the Operations Management Suite (OMS) on the + * HDInsight cluster. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * Get the status of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the clusterMonitoringEnabled value + */ + public Boolean clusterMonitoringEnabled() { + return this.clusterMonitoringEnabled; + } + + /** + * Set the status of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param clusterMonitoringEnabled the clusterMonitoringEnabled value to set + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withClusterMonitoringEnabled(Boolean clusterMonitoringEnabled) { + this.clusterMonitoringEnabled = clusterMonitoringEnabled; + return this; + } + + /** + * Get the workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param workspaceId the workspaceId value to set + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersImpl.java new file mode 100644 index 0000000000000..8fbd91b0597dd --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersImpl.java @@ -0,0 +1,184 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Cluster; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.GatewaySettings; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterDiskEncryptionParameters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.UpdateGatewaySettingsParameters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ExecuteScriptActionParameters; + +class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { + protected ClustersImpl(HDInsightManager manager) { + super(manager.inner().clusters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + ClustersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ClustersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ClustersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ClustersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ClusterImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable rotateDiskEncryptionKeyAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + ClustersInner client = this.inner(); + return client.rotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + public Observable getGatewaySettingsAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.getGatewaySettingsAsync(resourceGroupName, clusterName) + .map(new Func1() { + @Override + public GatewaySettings call(GatewaySettingsInner inner) { + return new GatewaySettingsImpl(inner, manager()); + } + }); + } + + @Override + public Completable updateGatewaySettingsAsync(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + ClustersInner client = this.inner(); + return client.updateGatewaySettingsAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + public Completable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + ClustersInner client = this.inner(); + return client.executeScriptActionsAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + protected ClusterImpl wrapModel(ClusterInner inner) { + return new ClusterImpl(inner.name(), inner, manager()); + } + + @Override + protected ClusterImpl wrapModel(String name) { + return new ClusterImpl(name, new ClusterInner(), this.manager()); + } + + @Override + public Completable resizeAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.resizeAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Completable updateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName) { + ClustersInner client = this.inner(); + return client.updateAutoScaleConfigurationAsync(resourceGroupName, clusterName).toCompletable(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersInner.java new file mode 100644 index 0000000000000..64732bfdae85c --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ClustersInner.java @@ -0,0 +1,2434 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Autoscale; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.AutoscaleConfigurationUpdateParameter; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterCreateParametersExtended; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterDiskEncryptionParameters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterPatchParameters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterResizeParameters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ExecuteScriptActionParameters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.UpdateGatewaySettingsParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Clusters. + */ +public class ClustersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ClustersService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ClustersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClustersInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ClustersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Clusters to be + * used by Retrofit to perform actually REST calls. + */ + interface ClustersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterCreateParametersExtended parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterCreateParametersExtended parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterPatchParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters resize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + Observable> resize(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterResizeParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginResize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize") + Observable> beginResize(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ClusterResizeParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters updateAutoScaleConfiguration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/autoscale") + Observable> updateAutoScaleConfiguration(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AutoscaleConfigurationUpdateParameter parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginUpdateAutoScaleConfiguration" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/autoscale") + Observable> beginUpdateAutoScaleConfiguration(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("roleName") String roleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AutoscaleConfigurationUpdateParameter parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters rotateDiskEncryptionKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/rotatediskencryptionkey") + Observable> rotateDiskEncryptionKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterDiskEncryptionParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginRotateDiskEncryptionKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/rotatediskencryptionkey") + Observable> beginRotateDiskEncryptionKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterDiskEncryptionParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters getGatewaySettings" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/getGatewaySettings") + Observable> getGatewaySettings(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters updateGatewaySettings" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateGatewaySettings") + Observable> updateGatewaySettings(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body UpdateGatewaySettingsParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginUpdateGatewaySettings" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateGatewaySettings") + Observable> beginUpdateGatewaySettings(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body UpdateGatewaySettingsParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters executeScriptActions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + Observable> executeScriptActions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ExecuteScriptActionParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters beginExecuteScriptActions" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions") + Observable> beginExecuteScriptActions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ExecuteScriptActionParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner create(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginCreate(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + ClusterPatchParameters parameters = new ClusterPatchParameters(); + parameters.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, tags).toBlocking().single().body(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, tags), serviceCallback); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, tags).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param tags The resource tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + ClusterPatchParameters parameters = new ClusterPatchParameters(); + parameters.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String clusterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resize(String resourceGroupName, String clusterName) { + resizeWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resizeAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resizeWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resizeAsync(String resourceGroupName, String clusterName) { + return resizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resizeWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + final Integer targetInstanceCount = null; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(null); + Observable> observable = service.resize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void resize(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().last().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture resizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable resizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + return resizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> resizeWithServiceResponseAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(targetInstanceCount); + Observable> observable = service.resize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResize(String resourceGroupName, String clusterName) { + beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResizeAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResizeWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResizeAsync(String resourceGroupName, String clusterName) { + return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResizeWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + final Integer targetInstanceCount = null; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(null); + return service.beginResize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginResize(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).toBlocking().single().body(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginResizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount), serviceCallback); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginResizeAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + return beginResizeWithServiceResponseAsync(resourceGroupName, clusterName, targetInstanceCount).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param targetInstanceCount The target instance count for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginResizeWithServiceResponseAsync(String resourceGroupName, String clusterName, Integer targetInstanceCount) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + ClusterResizeParameters parameters = new ClusterResizeParameters(); + parameters.withTargetInstanceCount(targetInstanceCount); + return service.beginResize(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginResizeDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateAutoScaleConfiguration(String resourceGroupName, String clusterName) { + updateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName) { + return updateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateAutoScaleConfigurationWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + final Autoscale autoscale = null; + AutoscaleConfigurationUpdateParameter parameters = new AutoscaleConfigurationUpdateParameter(); + parameters.withAutoscale(null); + Observable> observable = service.updateAutoScaleConfiguration(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param autoscale The autoscale configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateAutoScaleConfiguration(String resourceGroupName, String clusterName, Autoscale autoscale) { + updateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName, autoscale).toBlocking().last().body(); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param autoscale The autoscale configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName, Autoscale autoscale, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName, autoscale), serviceCallback); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param autoscale The autoscale configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName, Autoscale autoscale) { + return updateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName, autoscale).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param autoscale The autoscale configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateAutoScaleConfigurationWithServiceResponseAsync(String resourceGroupName, String clusterName, Autoscale autoscale) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(autoscale); + final String roleName = "workernode"; + AutoscaleConfigurationUpdateParameter parameters = new AutoscaleConfigurationUpdateParameter(); + parameters.withAutoscale(autoscale); + Observable> observable = service.updateAutoScaleConfiguration(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginUpdateAutoScaleConfiguration(String resourceGroupName, String clusterName) { + beginUpdateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginUpdateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName) { + return beginUpdateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginUpdateAutoScaleConfigurationWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String roleName = "workernode"; + final Autoscale autoscale = null; + AutoscaleConfigurationUpdateParameter parameters = new AutoscaleConfigurationUpdateParameter(); + parameters.withAutoscale(null); + return service.beginUpdateAutoScaleConfiguration(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateAutoScaleConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param autoscale The autoscale configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginUpdateAutoScaleConfiguration(String resourceGroupName, String clusterName, Autoscale autoscale) { + beginUpdateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName, autoscale).toBlocking().single().body(); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param autoscale The autoscale configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName, Autoscale autoscale, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName, autoscale), serviceCallback); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param autoscale The autoscale configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginUpdateAutoScaleConfigurationAsync(String resourceGroupName, String clusterName, Autoscale autoscale) { + return beginUpdateAutoScaleConfigurationWithServiceResponseAsync(resourceGroupName, clusterName, autoscale).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param autoscale The autoscale configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginUpdateAutoScaleConfigurationWithServiceResponseAsync(String resourceGroupName, String clusterName, Autoscale autoscale) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(autoscale); + final String roleName = "workernode"; + AutoscaleConfigurationUpdateParameter parameters = new AutoscaleConfigurationUpdateParameter(); + parameters.withAutoscale(autoscale); + return service.beginUpdateAutoScaleConfiguration(this.client.subscriptionId(), resourceGroupName, clusterName, roleName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateAutoScaleConfigurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateAutoScaleConfigurationDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the disk encryption operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void rotateDiskEncryptionKey(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + rotateDiskEncryptionKeyWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the disk encryption operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture rotateDiskEncryptionKeyAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(rotateDiskEncryptionKeyWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the disk encryption operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable rotateDiskEncryptionKeyAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + return rotateDiskEncryptionKeyWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the disk encryption operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> rotateDiskEncryptionKeyWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.rotateDiskEncryptionKey(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the disk encryption operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginRotateDiskEncryptionKey(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + beginRotateDiskEncryptionKeyWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the disk encryption operation. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRotateDiskEncryptionKeyAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRotateDiskEncryptionKeyWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the disk encryption operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRotateDiskEncryptionKeyAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + return beginRotateDiskEncryptionKeyWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the disk encryption operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRotateDiskEncryptionKeyWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginRotateDiskEncryptionKey(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRotateDiskEncryptionKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRotateDiskEncryptionKeyDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GatewaySettingsInner object if successful. + */ + public GatewaySettingsInner getGatewaySettings(String resourceGroupName, String clusterName) { + return getGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getGatewaySettingsAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewaySettingsInner object + */ + public Observable getGatewaySettingsAsync(String resourceGroupName, String clusterName) { + return getGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, GatewaySettingsInner>() { + @Override + public GatewaySettingsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewaySettingsInner object + */ + public Observable> getGatewaySettingsWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getGatewaySettings(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGatewaySettingsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGatewaySettingsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void updateGatewaySettings(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + updateGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster configurations. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateGatewaySettingsAsync(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateGatewaySettingsAsync(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + return updateGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateGatewaySettingsWithServiceResponseAsync(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.updateGatewaySettings(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginUpdateGatewaySettings(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + beginUpdateGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster configurations. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateGatewaySettingsAsync(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginUpdateGatewaySettingsAsync(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + return beginUpdateGatewaySettingsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginUpdateGatewaySettingsWithServiceResponseAsync(String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdateGatewaySettings(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateGatewaySettingsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateGatewaySettingsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable executeScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return executeScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> executeScriptActionsWithServiceResponseAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.executeScriptActions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginExecuteScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginExecuteScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginExecuteScriptActionsAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return beginExecuteScriptActionsWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for executing script actions. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginExecuteScriptActionsWithServiceResponseAsync(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginExecuteScriptActions(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginExecuteScriptActionsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginExecuteScriptActionsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsImpl.java new file mode 100644 index 0000000000000..2b05c576578bc --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterConfigurations; +import rx.Completable; +import java.util.Map; + +class ConfigurationsImpl extends WrapperImpl implements Configurations { + private final HDInsightManager manager; + + ConfigurationsImpl(HDInsightManager manager) { + super(manager.inner().configurations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(String resourceGroupName, String clusterName) { + ConfigurationsInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName) + .map(new Func1() { + @Override + public ClusterConfigurations call(ClusterConfigurationsInner inner) { + return new ClusterConfigurationsImpl(inner, manager()); + } + }); + } + + @Override + public Completable updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + ConfigurationsInner client = this.inner(); + return client.updateAsync(resourceGroupName, clusterName, configurationName, parameters).toCompletable(); + } + + @Override + public Observable> getAsync(String resourceGroupName, String clusterName, String configurationName) { + ConfigurationsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, configurationName) + ;} + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsInner.java new file mode 100644 index 0000000000000..750b951357907 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ConfigurationsInner.java @@ -0,0 +1,440 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Configurations. + */ +public class ConfigurationsInner { + /** The Retrofit service to perform REST calls. */ + private ConfigurationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ConfigurationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ConfigurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Configurations to be + * used by Retrofit to perform actually REST calls. + */ + interface ConfigurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations list" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations update" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body Map parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations beginUpdate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Body Map parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("configurationName") String configurationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterConfigurationsInner object if successful. + */ + public ClusterConfigurationsInner list(String resourceGroupName, String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterConfigurationsInner object + */ + public Observable listAsync(String resourceGroupName, String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterConfigurationsInner>() { + @Override + public ClusterConfigurationsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterConfigurationsInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void update(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + updateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().last().body(); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters), serviceCallback); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginUpdate(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).toBlocking().single().body(); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters), serviceCallback); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, configurationName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The cluster configurations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName, Map parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map get(String resourceGroupName, String clusterName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName).toBlocking().single().body(); + } + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getAsync(String resourceGroupName, String clusterName, String configurationName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName), serviceCallback); + } + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getAsync(String resourceGroupName, String clusterName, String configurationName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, configurationName).map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String configurationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (configurationName == null) { + throw new IllegalArgumentException("Parameter configurationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, configurationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionImpl.java new file mode 100644 index 0000000000000..32c4922c4897e --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extension; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class ExtensionImpl extends WrapperImpl implements Extension { + private final HDInsightManager manager; + private String resourceGroupName; + private String clusterName; + private String extensionName; + + ExtensionImpl(ExtensionInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + + + @Override + public String primaryKey() { + return this.inner().primaryKey(); + } + + @Override + public String workspaceId() { + return this.inner().workspaceId(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionInner.java new file mode 100644 index 0000000000000..a65fbca54f900 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionInner.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cluster monitoring extensions. + */ +public class ExtensionInner { + /** + * The workspace ID for the cluster monitoring extension. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * The certificate for the cluster monitoring extensions. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the workspace ID for the cluster monitoring extension. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace ID for the cluster monitoring extension. + * + * @param workspaceId the workspaceId value to set + * @return the ExtensionInner object itself. + */ + public ExtensionInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the certificate for the cluster monitoring extensions. + * + * @return the primaryKey value + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the certificate for the cluster monitoring extensions. + * + * @param primaryKey the primaryKey value to set + * @return the ExtensionInner object itself. + */ + public ExtensionInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsImpl.java new file mode 100644 index 0000000000000..9c6023f568f46 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsImpl.java @@ -0,0 +1,89 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringResponse; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extension; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringRequest; + +class ExtensionsImpl extends WrapperImpl implements Extensions { + private final HDInsightManager manager; + + ExtensionsImpl(HDInsightManager manager) { + super(manager.inner().extensions()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + private ExtensionImpl wrapModel(ExtensionInner inner) { + return new ExtensionImpl(inner, manager()); + } + + @Override + public Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName) { + ExtensionsInner client = this.inner(); + return client.getMonitoringStatusAsync(resourceGroupName, clusterName) + .map(new Func1() { + @Override + public ClusterMonitoringResponse call(ClusterMonitoringResponseInner inner) { + return new ClusterMonitoringResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable disableMonitoringAsync(String resourceGroupName, String clusterName) { + ExtensionsInner client = this.inner(); + return client.disableMonitoringAsync(resourceGroupName, clusterName).toCompletable(); + } + + @Override + public Observable getAsync(String resourceGroupName, String clusterName, String extensionName) { + ExtensionsInner client = this.inner(); + return client.getAsync(resourceGroupName, clusterName, extensionName) + .flatMap(new Func1>() { + @Override + public Observable call(ExtensionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Extension)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + ExtensionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, extensionName).toCompletable(); + } + + @Override + public Completable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + ExtensionsInner client = this.inner(); + return client.enableMonitoringAsync(resourceGroupName, clusterName, parameters).toCompletable(); + } + + @Override + public Completable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + ExtensionsInner client = this.inner(); + return client.createAsync(resourceGroupName, clusterName, extensionName, parameters).toCompletable(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsInner.java new file mode 100644 index 0000000000000..311e8bc8ffbea --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ExtensionsInner.java @@ -0,0 +1,790 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ClusterMonitoringRequest; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Extensions. + */ +public class ExtensionsInner { + /** The Retrofit service to perform REST calls. */ + private ExtensionsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ExtensionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExtensionsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ExtensionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Extensions to be + * used by Retrofit to perform actually REST calls. + */ + interface ExtensionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions enableMonitoring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> enableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterMonitoringRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions beginEnableMonitoring" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> beginEnableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterMonitoringRequest parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions getMonitoringStatus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring") + Observable> getMonitoringStatus(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions disableMonitoring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", method = "DELETE", hasBody = true) + Observable> disableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions beginDisableMonitoring" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring", method = "DELETE", hasBody = true) + Observable> beginDisableMonitoring(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Body ExtensionInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("extensionName") String extensionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable enableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return enableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> enableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.enableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginEnableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginEnableMonitoringAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return beginEnableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) workspace parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginEnableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginEnableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginEnableMonitoringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginEnableMonitoringDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterMonitoringResponseInner object if successful. + */ + public ClusterMonitoringResponseInner getMonitoringStatus(String resourceGroupName, String clusterName) { + return getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMonitoringStatusAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterMonitoringResponseInner object + */ + public Observable getMonitoringStatusAsync(String resourceGroupName, String clusterName) { + return getMonitoringStatusWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterMonitoringResponseInner>() { + @Override + public ClusterMonitoringResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterMonitoringResponseInner object + */ + public Observable> getMonitoringStatusWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getMonitoringStatus(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMonitoringStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMonitoringStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableMonitoring(String resourceGroupName, String clusterName) { + disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture disableMonitoringAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable disableMonitoringAsync(String resourceGroupName, String clusterName) { + return disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> disableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.disableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDisableMonitoring(String resourceGroupName, String clusterName) { + beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDisableMonitoringAsync(String resourceGroupName, String clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDisableMonitoringAsync(String resourceGroupName, String clusterName) { + return beginDisableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDisableMonitoringWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDisableMonitoring(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDisableMonitoringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDisableMonitoringDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void create(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).toBlocking().single().body(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters), serviceCallback); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable createAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, extensionName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters The cluster extensions create request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.create(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExtensionInner object if successful. + */ + public ExtensionInner get(String resourceGroupName, String clusterName, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().single().body(); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInner object + */ + public Observable getAsync(String resourceGroupName, String clusterName, String extensionName) { + return getWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, ExtensionInner>() { + @Override + public ExtensionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtensionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String extensionName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).toBlocking().single().body(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String extensionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName), serviceCallback); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, extensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String extensionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (extensionName == null) { + throw new IllegalArgumentException("Parameter extensionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, extensionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/GatewaySettingsImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/GatewaySettingsImpl.java new file mode 100644 index 0000000000000..bd55f8bff4c61 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/GatewaySettingsImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.GatewaySettings; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class GatewaySettingsImpl extends WrapperImpl implements GatewaySettings { + private final HDInsightManager manager; + GatewaySettingsImpl(GatewaySettingsInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public String isCredentialEnabled() { + return this.inner().isCredentialEnabled(); + } + + @Override + public String password() { + return this.inner().password(); + } + + @Override + public String userName() { + return this.inner().userName(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/GatewaySettingsInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/GatewaySettingsInner.java new file mode 100644 index 0000000000000..e3a1a4e425816 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/GatewaySettingsInner.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Gateway settings. + */ +public class GatewaySettingsInner { + /** + * Indicates whether or not the gateway settings based authorization is + * enabled. + */ + @JsonProperty(value = "restAuthCredential\\.isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String isCredentialEnabled; + + /** + * The gateway settings user name. + */ + @JsonProperty(value = "restAuthCredential\\.username", access = JsonProperty.Access.WRITE_ONLY) + private String userName; + + /** + * The gateway settings user password. + */ + @JsonProperty(value = "restAuthCredential\\.password", access = JsonProperty.Access.WRITE_ONLY) + private String password; + + /** + * Get indicates whether or not the gateway settings based authorization is enabled. + * + * @return the isCredentialEnabled value + */ + public String isCredentialEnabled() { + return this.isCredentialEnabled; + } + + /** + * Get the gateway settings user name. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Get the gateway settings user password. + * + * @return the password value + */ + public String password() { + return this.password; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManagementClientImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManagementClientImpl.java new file mode 100644 index 0000000000000..5c53e58065c2c --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManagementClientImpl.java @@ -0,0 +1,294 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the HDInsightManagementClientImpl class. + */ +public class HDInsightManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The HDInsight client API Version. */ + private String apiVersion; + + /** + * Gets The HDInsight client API Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public HDInsightManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ClustersInner object to access its operations. + */ + private ClustersInner clusters; + + /** + * Gets the ClustersInner object to access its operations. + * @return the ClustersInner object. + */ + public ClustersInner clusters() { + return this.clusters; + } + + /** + * The ApplicationsInner object to access its operations. + */ + private ApplicationsInner applications; + + /** + * Gets the ApplicationsInner object to access its operations. + * @return the ApplicationsInner object. + */ + public ApplicationsInner applications() { + return this.applications; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The ConfigurationsInner object to access its operations. + */ + private ConfigurationsInner configurations; + + /** + * Gets the ConfigurationsInner object to access its operations. + * @return the ConfigurationsInner object. + */ + public ConfigurationsInner configurations() { + return this.configurations; + } + + /** + * The ExtensionsInner object to access its operations. + */ + private ExtensionsInner extensions; + + /** + * Gets the ExtensionsInner object to access its operations. + * @return the ExtensionsInner object. + */ + public ExtensionsInner extensions() { + return this.extensions; + } + + /** + * The ScriptActionsInner object to access its operations. + */ + private ScriptActionsInner scriptActions; + + /** + * Gets the ScriptActionsInner object to access its operations. + * @return the ScriptActionsInner object. + */ + public ScriptActionsInner scriptActions() { + return this.scriptActions; + } + + /** + * The ScriptExecutionHistorysInner object to access its operations. + */ + private ScriptExecutionHistorysInner scriptExecutionHistorys; + + /** + * Gets the ScriptExecutionHistorysInner object to access its operations. + * @return the ScriptExecutionHistorysInner object. + */ + public ScriptExecutionHistorysInner scriptExecutionHistorys() { + return this.scriptExecutionHistorys; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public HDInsightManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public HDInsightManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HDInsightManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HDInsightManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-03-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.applications = new ApplicationsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.configurations = new ConfigurationsInner(restClient().retrofit(), this); + this.extensions = new ExtensionsInner(restClient().retrofit(), this); + this.scriptActions = new ScriptActionsInner(restClient().retrofit(), this); + this.scriptExecutionHistorys = new ScriptExecutionHistorysInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "HDInsightManagementClient", "2015-03-01-preview"); + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManager.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManager.java new file mode 100644 index 0000000000000..6f7342f04a445 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/HDInsightManager.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Clusters; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Applications; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Configurations; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Extensions; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure HDInsight resource management. + */ +public final class HDInsightManager extends ManagerCore { + private Clusters clusters; + private Applications applications; + private Locations locations; + private Configurations configurations; + private Extensions extensions; + private ScriptActions scriptActions; + private ScriptExecutionHistorys scriptExecutionHistorys; + private Operations operations; + /** + * Get a Configurable instance that can be used to create HDInsightManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new HDInsightManager.ConfigurableImpl(); + } + /** + * Creates an instance of HDInsightManager that exposes HDInsight resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the HDInsightManager + */ + public static HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new HDInsightManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of HDInsightManager that exposes HDInsight resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the HDInsightManager + */ + public static HDInsightManager authenticate(RestClient restClient, String subscriptionId) { + return new HDInsightManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of HDInsightManager that exposes HDInsight management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing HDInsight management API entry points that work across subscriptions + */ + HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(this); + } + return this.clusters; + } + + /** + * @return Entry point to manage Applications. + */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(this); + } + return this.applications; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage Configurations. + */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(this); + } + return this.configurations; + } + + /** + * @return Entry point to manage Extensions. + */ + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(this); + } + return this.extensions; + } + + /** + * @return Entry point to manage ScriptActions. + */ + public ScriptActions scriptActions() { + if (this.scriptActions == null) { + this.scriptActions = new ScriptActionsImpl(this); + } + return this.scriptActions; + } + + /** + * @return Entry point to manage ScriptExecutionHistorys. + */ + public ScriptExecutionHistorys scriptExecutionHistorys() { + if (this.scriptExecutionHistorys == null) { + this.scriptExecutionHistorys = new ScriptExecutionHistorysImpl(this); + } + return this.scriptExecutionHistorys; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public HDInsightManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return HDInsightManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private HDInsightManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new HDInsightManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/IdParsingUtils.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..2856ccff2ea38 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsImpl.java new file mode 100644 index 0000000000000..424a4fa309fbb --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.CapabilitiesResult; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.UsagesListResult; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.BillingResponseListResult; + +class LocationsImpl extends WrapperImpl implements Locations { + private final HDInsightManager manager; + + LocationsImpl(HDInsightManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable getCapabilitiesAsync(String location) { + LocationsInner client = this.inner(); + return client.getCapabilitiesAsync(location) + .map(new Func1() { + @Override + public CapabilitiesResult call(CapabilitiesResultInner inner) { + return new CapabilitiesResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listUsagesAsync(String location) { + LocationsInner client = this.inner(); + return client.listUsagesAsync(location) + .map(new Func1() { + @Override + public UsagesListResult call(UsagesListResultInner inner) { + return new UsagesListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listBillingSpecsAsync(String location) { + LocationsInner client = this.inner(); + return client.listBillingSpecsAsync(location) + .map(new Func1() { + @Override + public BillingResponseListResult call(BillingResponseListResultInner inner) { + return new BillingResponseListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsInner.java new file mode 100644 index 0000000000000..203b21fdd1474 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/LocationsInner.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations getCapabilities" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/capabilities") + Observable> getCapabilities(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations listUsages" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Locations listBillingSpecs" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/billingSpecs") + Observable> listBillingSpecs(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CapabilitiesResultInner object if successful. + */ + public CapabilitiesResultInner getCapabilities(String location) { + return getCapabilitiesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCapabilitiesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCapabilitiesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilitiesResultInner object + */ + public Observable getCapabilitiesAsync(String location) { + return getCapabilitiesWithServiceResponseAsync(location).map(new Func1, CapabilitiesResultInner>() { + @Override + public CapabilitiesResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CapabilitiesResultInner object + */ + public Observable> getCapabilitiesWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getCapabilities(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCapabilitiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCapabilitiesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UsagesListResultInner object if successful. + */ + public UsagesListResultInner listUsages(String location) { + return listUsagesWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listUsagesAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesListResultInner object + */ + public Observable listUsagesAsync(String location) { + return listUsagesWithServiceResponseAsync(location).map(new Func1, UsagesListResultInner>() { + @Override + public UsagesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UsagesListResultInner object + */ + public Observable> listUsagesWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listUsages(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUsagesDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BillingResponseListResultInner object if successful. + */ + public BillingResponseListResultInner listBillingSpecs(String location) { + return listBillingSpecsWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listBillingSpecsAsync(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listBillingSpecsWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingResponseListResultInner object + */ + public Observable listBillingSpecsAsync(String location) { + return listBillingSpecsWithServiceResponseAsync(location).map(new Func1, BillingResponseListResultInner>() { + @Override + public BillingResponseListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BillingResponseListResultInner object + */ + public Observable> listBillingSpecsWithServiceResponseAsync(String location) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listBillingSpecs(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listBillingSpecsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listBillingSpecsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationImpl.java new file mode 100644 index 0000000000000..947b18f4bea87 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final HDInsightManager manager; + OperationImpl(OperationInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationInner.java new file mode 100644 index 0000000000000..51a4daa9c93a2 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HDInsight REST API operation. + */ +public class OperationInner { + /** + * The operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..f5b37e168ec3e --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final HDInsightManager manager; + + OperationsImpl(HDInsightManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..49444335200dd --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operations list" }) + @GET("providers/Microsoft.HDInsight/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/PageImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..e66c3d88145c3 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailImpl.java new file mode 100644 index 0000000000000..e641b030b44e9 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailImpl.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptActionDetail; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActionExecutionSummary; + +class RuntimeScriptActionDetailImpl extends WrapperImpl implements RuntimeScriptActionDetail { + private final HDInsightManager manager; + + RuntimeScriptActionDetailImpl(RuntimeScriptActionDetailInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + + + @Override + public String applicationName() { + return this.inner().applicationName(); + } + + @Override + public String debugInformation() { + return this.inner().debugInformation(); + } + + @Override + public String endTime() { + return this.inner().endTime(); + } + + @Override + public List executionSummary() { + return this.inner().executionSummary(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String operation() { + return this.inner().operation(); + } + + @Override + public String parameters() { + return this.inner().parameters(); + } + + @Override + public List roles() { + return this.inner().roles(); + } + + @Override + public Long scriptExecutionId() { + return this.inner().scriptExecutionId(); + } + + @Override + public String startTime() { + return this.inner().startTime(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String uri() { + return this.inner().uri(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailInner.java new file mode 100644 index 0000000000000..6a3fe64a029ae --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/RuntimeScriptActionDetailInner.java @@ -0,0 +1,125 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActionExecutionSummary; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptAction; + +/** + * The execution details of a script action. + */ +public class RuntimeScriptActionDetailInner extends RuntimeScriptAction { + /** + * The execution id of the script action. + */ + @JsonProperty(value = "scriptExecutionId", access = JsonProperty.Access.WRITE_ONLY) + private Long scriptExecutionId; + + /** + * The start time of script action execution. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /** + * The end time of script action execution. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private String endTime; + + /** + * The current execution status of the script action. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The reason why the script action was executed. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The summary of script action execution result. + */ + @JsonProperty(value = "executionSummary", access = JsonProperty.Access.WRITE_ONLY) + private List executionSummary; + + /** + * The script action execution debug information. + */ + @JsonProperty(value = "debugInformation", access = JsonProperty.Access.WRITE_ONLY) + private String debugInformation; + + /** + * Get the execution id of the script action. + * + * @return the scriptExecutionId value + */ + public Long scriptExecutionId() { + return this.scriptExecutionId; + } + + /** + * Get the start time of script action execution. + * + * @return the startTime value + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the end time of script action execution. + * + * @return the endTime value + */ + public String endTime() { + return this.endTime; + } + + /** + * Get the current execution status of the script action. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the reason why the script action was executed. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the summary of script action execution result. + * + * @return the executionSummary value + */ + public List executionSummary() { + return this.executionSummary; + } + + /** + * Get the script action execution debug information. + * + * @return the debugInformation value + */ + public String debugInformation() { + return this.debugInformation; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionInner.java new file mode 100644 index 0000000000000..cd45286692fa0 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionInner.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a script action on role on the cluster. + */ +public class ScriptActionInner { + /** + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /** + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters", required = true) + private String parameters; + + /** + * Get the name of the script action. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the script action. + * + * @param name the name value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the URI to the script. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set the URI to the script. + * + * @param uri the uri value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters for the script provided. + * + * @return the parameters value + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters for the script provided. + * + * @param parameters the parameters value to set + * @return the ScriptActionInner object itself. + */ + public ScriptActionInner withParameters(String parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsImpl.java new file mode 100644 index 0000000000000..19b74979ea12d --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptActionDetail; + +class ScriptActionsImpl extends WrapperImpl implements ScriptActions { + private final HDInsightManager manager; + + ScriptActionsImpl(HDInsightManager manager) { + super(manager.inner().scriptActions()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + private RuntimeScriptActionDetailImpl wrapModel(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + + @Override + public Observable listPersistedScriptsAsync(final String resourceGroupName, final String clusterName) { + ScriptActionsInner client = this.inner(); + return client.listPersistedScriptsAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + ScriptActionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, scriptName).toCompletable(); + } + + @Override + public Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + ScriptActionsInner client = this.inner(); + return client.getExecutionDetailAsync(resourceGroupName, clusterName, scriptExecutionId) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsInner.java new file mode 100644 index 0000000000000..6e0f85951cabe --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptActionsInner.java @@ -0,0 +1,498 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ScriptActions. + */ +public class ScriptActionsInner { + /** The Retrofit service to perform REST calls. */ + private ScriptActionsService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptActionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScriptActionsInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ScriptActionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScriptActions to be + * used by Retrofit to perform actually REST calls. + */ + interface ScriptActionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions/{scriptName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptName") String scriptName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions listPersistedScripts" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions") + Observable> listPersistedScripts(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions getExecutionDetail" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}") + Observable> getExecutionDetail(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptExecutionId") String scriptExecutionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptActions listPersistedScriptsNext" }) + @GET + Observable> listPersistedScriptsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String clusterName, String scriptName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName).toBlocking().single().body(); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String clusterName, String scriptName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName), serviceCallback); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, scriptName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptName == null) { + throw new IllegalArgumentException("Parameter scriptName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, clusterName, scriptName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listPersistedScripts(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listPersistedScriptsSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listPersistedScriptsAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listPersistedScriptsSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listPersistedScriptsAsync(final String resourceGroupName, final String clusterName) { + return listPersistedScriptsWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listPersistedScriptsWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listPersistedScriptsSinglePageAsync(resourceGroupName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listPersistedScriptsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listPersistedScriptsSinglePageAsync(final String resourceGroupName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listPersistedScripts(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPersistedScriptsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPersistedScriptsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RuntimeScriptActionDetailInner object if successful. + */ + public RuntimeScriptActionDetailInner getExecutionDetail(String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).toBlocking().single().body(); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId), serviceCallback); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuntimeScriptActionDetailInner object + */ + public Observable getExecutionDetailAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).map(new Func1, RuntimeScriptActionDetailInner>() { + @Override + public RuntimeScriptActionDetailInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RuntimeScriptActionDetailInner object + */ + public Observable> getExecutionDetailWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptExecutionId == null) { + throw new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getExecutionDetail(this.client.subscriptionId(), resourceGroupName, clusterName, scriptExecutionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getExecutionDetailDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getExecutionDetailDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listPersistedScriptsNext(final String nextPageLink) { + ServiceResponse> response = listPersistedScriptsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listPersistedScriptsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listPersistedScriptsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listPersistedScriptsNextAsync(final String nextPageLink) { + return listPersistedScriptsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listPersistedScriptsNextWithServiceResponseAsync(final String nextPageLink) { + return listPersistedScriptsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listPersistedScriptsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listPersistedScriptsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listPersistedScriptsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPersistedScriptsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPersistedScriptsNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysImpl.java new file mode 100644 index 0000000000000..b8850abe9e7cf --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.RuntimeScriptActionDetail; + +class ScriptExecutionHistorysImpl extends WrapperImpl implements ScriptExecutionHistorys { + private final HDInsightManager manager; + + ScriptExecutionHistorysImpl(HDInsightManager manager) { + super(manager.inner().scriptExecutionHistorys()); + this.manager = manager; + } + + public HDInsightManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String resourceGroupName, final String clusterName) { + ScriptExecutionHistorysInner client = this.inner(); + return client.listAsync(resourceGroupName, clusterName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public RuntimeScriptActionDetail call(RuntimeScriptActionDetailInner inner) { + return new RuntimeScriptActionDetailImpl(inner, manager()); + } + }); + } + + @Override + public Completable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + ScriptExecutionHistorysInner client = this.inner(); + return client.promoteAsync(resourceGroupName, clusterName, scriptExecutionId).toCompletable(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysInner.java new file mode 100644 index 0000000000000..2c9a861eb927e --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/ScriptExecutionHistorysInner.java @@ -0,0 +1,401 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ScriptExecutionHistorys. + */ +public class ScriptExecutionHistorysInner { + /** The Retrofit service to perform REST calls. */ + private ScriptExecutionHistorysService service; + /** The service client containing this operation class. */ + private HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptExecutionHistorysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScriptExecutionHistorysInner(Retrofit retrofit, HDInsightManagementClientImpl client) { + this.service = retrofit.create(ScriptExecutionHistorysService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScriptExecutionHistorys to be + * used by Retrofit to perform actually REST calls. + */ + interface ScriptExecutionHistorysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys promote" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote") + Observable> promote(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("scriptExecutionId") String scriptExecutionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hdinsight.v2015_03_01_preview.ScriptExecutionHistorys listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String clusterName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, clusterName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String clusterName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, clusterName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String clusterName) { + return listWithServiceResponseAsync(resourceGroupName, clusterName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String clusterName) { + return listSinglePageAsync(resourceGroupName, clusterName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + ServiceResponse> * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String clusterName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void promote(String resourceGroupName, String clusterName, String scriptExecutionId) { + promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).toBlocking().single().body(); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId), serviceCallback); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return promoteWithServiceResponseAsync(resourceGroupName, clusterName, scriptExecutionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> promoteWithServiceResponseAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (scriptExecutionId == null) { + throw new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.promote(this.client.subscriptionId(), resourceGroupName, clusterName, scriptExecutionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = promoteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse promoteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RuntimeScriptActionDetailInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RuntimeScriptActionDetailInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RuntimeScriptActionDetailInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultImpl.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultImpl.java new file mode 100644 index 0000000000000..71aba83915c4e --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.UsagesListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Usage; + +class UsagesListResultImpl extends WrapperImpl implements UsagesListResult { + private final HDInsightManager manager; + UsagesListResultImpl(UsagesListResultInner inner, HDInsightManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public HDInsightManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultInner.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultInner.java new file mode 100644 index 0000000000000..e602bd55ae961 --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/UsagesListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.hdinsight.v2015_03_01_preview.Usage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response for the operation to get regional usages for a subscription. + */ +public class UsagesListResultInner { + /** + * The list of usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of usages. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of usages. + * + * @param value the value value to set + * @return the UsagesListResultInner object itself. + */ + public UsagesListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/package-info.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..60182e7fdfead --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for HDInsightManagementClient. + * HDInsight Management Client. + */ +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview.implementation; diff --git a/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/package-info.java b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/package-info.java new file mode 100644 index 0000000000000..d1cb0bfee0bcf --- /dev/null +++ b/sdk/hdinsight/mgmt-v2015_03_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2015_03_01_preview/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for HDInsightManagementClient. + * HDInsight Management Client. + */ +package com.microsoft.azure.management.hdinsight.v2015_03_01_preview;