diff --git a/servicefabric/resource-manager/v2016_09_01/pom.xml b/servicefabric/resource-manager/v2016_09_01/pom.xml new file mode 100644 index 000000000000..8c6668868070 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.servicefabric.v2016_09_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-servicefabric + 1.0.0-beta + jar + Microsoft Azure SDK for ServiceFabric Management + This package contains Microsoft ServiceFabric 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 + + + + + + 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/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/AvailableOperationDisplay.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/AvailableOperationDisplay.java new file mode 100644 index 000000000000..27fa7f21aab4 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/AvailableOperationDisplay.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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation supported by ServiceFabric resource provider. + */ +public class AvailableOperationDisplay { + /** + * Provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource name. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operation name. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set provider name. + * + * @param provider the provider value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource name. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource name. + * + * @param resource the resource value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation name. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation name. + * + * @param operation the operation value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set operation description. + * + * @param description the description value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/AzureActiveDirectory.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/AzureActiveDirectory.java new file mode 100644 index 000000000000..aeae31da955a --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/AzureActiveDirectory.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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The settings to enable AAD authentication on the cluster. + */ +public class AzureActiveDirectory { + /** + * Azure active directory tenant id. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Azure active directory cluster application id. + */ + @JsonProperty(value = "clusterApplication") + private String clusterApplication; + + /** + * Azure active directory client application id. + */ + @JsonProperty(value = "clientApplication") + private String clientApplication; + + /** + * Get azure active directory tenant id. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set azure active directory tenant id. + * + * @param tenantId the tenantId value to set + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get azure active directory cluster application id. + * + * @return the clusterApplication value + */ + public String clusterApplication() { + return this.clusterApplication; + } + + /** + * Set azure active directory cluster application id. + * + * @param clusterApplication the clusterApplication value to set + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withClusterApplication(String clusterApplication) { + this.clusterApplication = clusterApplication; + return this; + } + + /** + * Get azure active directory client application id. + * + * @return the clientApplication value + */ + public String clientApplication() { + return this.clientApplication; + } + + /** + * Set azure active directory client application id. + * + * @param clientApplication the clientApplication value to set + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withClientApplication(String clientApplication) { + this.clientApplication = clientApplication; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/CertificateDescription.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/CertificateDescription.java new file mode 100644 index 000000000000..6b5d57e4d153 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/CertificateDescription.java @@ -0,0 +1,97 @@ +/** + * 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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Certificate details. + */ +public class CertificateDescription { + /** + * Thumbprint of the primary certificate. + */ + @JsonProperty(value = "thumbprint", required = true) + private String thumbprint; + + /** + * Thumbprint of the secondary certificate. + */ + @JsonProperty(value = "thumbprintSecondary") + private String thumbprintSecondary; + + /** + * The local certificate store location. Possible values include: + * 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', + * 'Root', 'TrustedPeople', 'TrustedPublisher'. + */ + @JsonProperty(value = "x509StoreName") + private String x509StoreName; + + /** + * Get thumbprint of the primary certificate. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set thumbprint of the primary certificate. + * + * @param thumbprint the thumbprint value to set + * @return the CertificateDescription object itself. + */ + public CertificateDescription withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get thumbprint of the secondary certificate. + * + * @return the thumbprintSecondary value + */ + public String thumbprintSecondary() { + return this.thumbprintSecondary; + } + + /** + * Set thumbprint of the secondary certificate. + * + * @param thumbprintSecondary the thumbprintSecondary value to set + * @return the CertificateDescription object itself. + */ + public CertificateDescription withThumbprintSecondary(String thumbprintSecondary) { + this.thumbprintSecondary = thumbprintSecondary; + return this; + } + + /** + * Get the local certificate store location. Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher'. + * + * @return the x509StoreName value + */ + public String x509StoreName() { + return this.x509StoreName; + } + + /** + * Set the local certificate store location. Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher'. + * + * @param x509StoreName the x509StoreName value to set + * @return the CertificateDescription object itself. + */ + public CertificateDescription withX509StoreName(String x509StoreName) { + this.x509StoreName = x509StoreName; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClientCertificateCommonName.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClientCertificateCommonName.java new file mode 100644 index 000000000000..de966416ace4 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClientCertificateCommonName.java @@ -0,0 +1,97 @@ +/** + * 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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Client certificate details using common name. + */ +public class ClientCertificateCommonName { + /** + * Is this certificate used for admin access from the client, if false , it + * is used or query only access. + */ + @JsonProperty(value = "isAdmin", required = true) + private boolean isAdmin; + + /** + * Certificate common name to be granted access; be carefull using wild + * card common names. + */ + @JsonProperty(value = "certificateCommonName", required = true) + private String certificateCommonName; + + /** + * Certificate issuer thumbprint. + */ + @JsonProperty(value = "certificateIssuerThumbprint", required = true) + private String certificateIssuerThumbprint; + + /** + * Get is this certificate used for admin access from the client, if false , it is used or query only access. + * + * @return the isAdmin value + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set is this certificate used for admin access from the client, if false , it is used or query only access. + * + * @param isAdmin the isAdmin value to set + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withIsAdmin(boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get certificate common name to be granted access; be carefull using wild card common names. + * + * @return the certificateCommonName value + */ + public String certificateCommonName() { + return this.certificateCommonName; + } + + /** + * Set certificate common name to be granted access; be carefull using wild card common names. + * + * @param certificateCommonName the certificateCommonName value to set + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withCertificateCommonName(String certificateCommonName) { + this.certificateCommonName = certificateCommonName; + return this; + } + + /** + * Get certificate issuer thumbprint. + * + * @return the certificateIssuerThumbprint value + */ + public String certificateIssuerThumbprint() { + return this.certificateIssuerThumbprint; + } + + /** + * Set certificate issuer thumbprint. + * + * @param certificateIssuerThumbprint the certificateIssuerThumbprint value to set + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withCertificateIssuerThumbprint(String certificateIssuerThumbprint) { + this.certificateIssuerThumbprint = certificateIssuerThumbprint; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClientCertificateThumbprint.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClientCertificateThumbprint.java new file mode 100644 index 000000000000..bd5f540725e4 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClientCertificateThumbprint.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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Client certificate details using thumbprint. + */ +public class ClientCertificateThumbprint { + /** + * Is this certificate used for admin access from the client, if false, it + * is used or query only access. + */ + @JsonProperty(value = "isAdmin", required = true) + private boolean isAdmin; + + /** + * Certificate thumbprint. + */ + @JsonProperty(value = "certificateThumbprint", required = true) + private String certificateThumbprint; + + /** + * Get is this certificate used for admin access from the client, if false, it is used or query only access. + * + * @return the isAdmin value + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set is this certificate used for admin access from the client, if false, it is used or query only access. + * + * @param isAdmin the isAdmin value to set + * @return the ClientCertificateThumbprint object itself. + */ + public ClientCertificateThumbprint withIsAdmin(boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get certificate thumbprint. + * + * @return the certificateThumbprint value + */ + public String certificateThumbprint() { + return this.certificateThumbprint; + } + + /** + * Set certificate thumbprint. + * + * @param certificateThumbprint the certificateThumbprint value to set + * @return the ClientCertificateThumbprint object itself. + */ + public ClientCertificateThumbprint withCertificateThumbprint(String certificateThumbprint) { + this.certificateThumbprint = certificateThumbprint; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Cluster.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Cluster.java new file mode 100644 index 000000000000..b5e693479ecf --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Cluster.java @@ -0,0 +1,452 @@ +/** + * 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.servicefabric.v2016_09_01; + +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.servicefabric.v2016_09_01.implementation.ServiceFabricManager; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2016_09_01.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the availableClusterVersions value. + */ + List availableClusterVersions(); + + /** + * @return the azureActiveDirectory value. + */ + AzureActiveDirectory azureActiveDirectory(); + + /** + * @return the certificate value. + */ + CertificateDescription certificate(); + + /** + * @return the clientCertificateCommonNames value. + */ + List clientCertificateCommonNames(); + + /** + * @return the clientCertificateThumbprints value. + */ + List clientCertificateThumbprints(); + + /** + * @return the clusterCodeVersion value. + */ + String clusterCodeVersion(); + + /** + * @return the clusterEndpoint value. + */ + String clusterEndpoint(); + + /** + * @return the clusterId value. + */ + String clusterId(); + + /** + * @return the clusterState value. + */ + String clusterState(); + + /** + * @return the diagnosticsStorageAccountConfig value. + */ + DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig(); + + /** + * @return the fabricSettings value. + */ + List fabricSettings(); + + /** + * @return the managementEndpoint value. + */ + String managementEndpoint(); + + /** + * @return the nodeTypes value. + */ + List nodeTypes(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the reliabilityLevel value. + */ + String reliabilityLevel(); + + /** + * @return the reverseProxyCertificate value. + */ + CertificateDescription reverseProxyCertificate(); + + /** + * @return the upgradeDescription value. + */ + ClusterUpgradePolicy upgradeDescription(); + + /** + * @return the upgradeMode value. + */ + String upgradeMode(); + + /** + * @return the vmImage value. + */ + String vmImage(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithManagementEndpoint, DefinitionStages.WithNodeTypes, 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 ManagementEndpoint. + */ + interface WithManagementEndpoint { + /** + * Specifies managementEndpoint. + * @param managementEndpoint The http management endpoint of the cluster + * @return the next definition stage +*/ + WithNodeTypes withManagementEndpoint(String managementEndpoint); + } + + /** + * The stage of the cluster definition allowing to specify NodeTypes. + */ + interface WithNodeTypes { + /** + * Specifies nodeTypes. + * @param nodeTypes The list of nodetypes that make up the cluster + * @return the next definition stage +*/ + WithCreate withNodeTypes(List nodeTypes); + } + + /** + * The stage of the cluster definition allowing to specify AzureActiveDirectory. + */ + interface WithAzureActiveDirectory { + /** + * Specifies azureActiveDirectory. + * @param azureActiveDirectory The settings to enable AAD authentication on the cluster + * @return the next definition stage + */ + WithCreate withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory); + } + + /** + * The stage of the cluster definition allowing to specify Certificate. + */ + interface WithCertificate { + /** + * Specifies certificate. + * @param certificate This primay certificate will be used as cluster node to node security, SSL certificate for cluster management endpoint and default admin client + * @return the next definition stage + */ + WithCreate withCertificate(CertificateDescription certificate); + } + + /** + * The stage of the cluster definition allowing to specify ClientCertificateCommonNames. + */ + interface WithClientCertificateCommonNames { + /** + * Specifies clientCertificateCommonNames. + * @param clientCertificateCommonNames List of client certificates to whitelist based on common names + * @return the next definition stage + */ + WithCreate withClientCertificateCommonNames(List clientCertificateCommonNames); + } + + /** + * The stage of the cluster definition allowing to specify ClientCertificateThumbprints. + */ + interface WithClientCertificateThumbprints { + /** + * Specifies clientCertificateThumbprints. + * @param clientCertificateThumbprints The client thumbprint details ,it is used for client access for cluster operation + * @return the next definition stage + */ + WithCreate withClientCertificateThumbprints(List clientCertificateThumbprints); + } + + /** + * The stage of the cluster definition allowing to specify ClusterCodeVersion. + */ + interface WithClusterCodeVersion { + /** + * Specifies clusterCodeVersion. + * @param clusterCodeVersion The ServiceFabric code version running in your cluster + * @return the next definition stage + */ + WithCreate withClusterCodeVersion(String clusterCodeVersion); + } + + /** + * The stage of the cluster definition allowing to specify DiagnosticsStorageAccountConfig. + */ + interface WithDiagnosticsStorageAccountConfig { + /** + * Specifies diagnosticsStorageAccountConfig. + * @param diagnosticsStorageAccountConfig The storage diagnostics account configuration details + * @return the next definition stage + */ + WithCreate withDiagnosticsStorageAccountConfig(DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig); + } + + /** + * The stage of the cluster definition allowing to specify FabricSettings. + */ + interface WithFabricSettings { + /** + * Specifies fabricSettings. + * @param fabricSettings List of custom fabric settings to configure the cluster + * @return the next definition stage + */ + WithCreate withFabricSettings(List fabricSettings); + } + + /** + * The stage of the cluster definition allowing to specify ReliabilityLevel. + */ + interface WithReliabilityLevel { + /** + * Specifies reliabilityLevel. + * @param reliabilityLevel Cluster reliability level indicates replica set size of system service. Possible values include: 'Bronze', 'Silver', 'Gold', 'Platinum' + * @return the next definition stage + */ + WithCreate withReliabilityLevel(String reliabilityLevel); + } + + /** + * The stage of the cluster definition allowing to specify ReverseProxyCertificate. + */ + interface WithReverseProxyCertificate { + /** + * Specifies reverseProxyCertificate. + * @param reverseProxyCertificate The server certificate used by reverse proxy + * @return the next definition stage + */ + WithCreate withReverseProxyCertificate(CertificateDescription reverseProxyCertificate); + } + + /** + * The stage of the cluster definition allowing to specify UpgradeDescription. + */ + interface WithUpgradeDescription { + /** + * Specifies upgradeDescription. + * @param upgradeDescription The policy to use when upgrading the cluster + * @return the next definition stage + */ + WithCreate withUpgradeDescription(ClusterUpgradePolicy upgradeDescription); + } + + /** + * The stage of the cluster definition allowing to specify UpgradeMode. + */ + interface WithUpgradeMode { + /** + * Specifies upgradeMode. + * @param upgradeMode Cluster upgrade mode indicates if fabric upgrade is initiated automatically by the system or not. Possible values include: 'Automatic', 'Manual' + * @return the next definition stage + */ + WithCreate withUpgradeMode(String upgradeMode); + } + + /** + * The stage of the cluster definition allowing to specify VmImage. + */ + interface WithVmImage { + /** + * Specifies vmImage. + * @param vmImage The name of VM image VMSS has been configured with. Generic names such as Windows or Linux can be used + * @return the next definition stage + */ + WithCreate withVmImage(String vmImage); + } + + /** + * 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.WithAzureActiveDirectory, DefinitionStages.WithCertificate, DefinitionStages.WithClientCertificateCommonNames, DefinitionStages.WithClientCertificateThumbprints, DefinitionStages.WithClusterCodeVersion, DefinitionStages.WithDiagnosticsStorageAccountConfig, DefinitionStages.WithFabricSettings, DefinitionStages.WithReliabilityLevel, DefinitionStages.WithReverseProxyCertificate, DefinitionStages.WithUpgradeDescription, DefinitionStages.WithUpgradeMode, DefinitionStages.WithVmImage { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithCertificate, UpdateStages.WithClientCertificateCommonNames, UpdateStages.WithClientCertificateThumbprints, UpdateStages.WithClusterCodeVersion, UpdateStages.WithFabricSettings, UpdateStages.WithNodeTypes, UpdateStages.WithReliabilityLevel, UpdateStages.WithReverseProxyCertificate, UpdateStages.WithUpgradeDescription, UpdateStages.WithUpgradeMode { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify Certificate. + */ + interface WithCertificate { + /** + * Specifies certificate. + * @param certificate This primay certificate will be used as cluster node to node security, SSL certificate for cluster management endpoint and default admin client, the certificate should exist in the virtual machine scale sets or Azure key vault, before you add it. It will override original value + * @return the next update stage + */ + Update withCertificate(CertificateDescription certificate); + } + + /** + * The stage of the cluster update allowing to specify ClientCertificateCommonNames. + */ + interface WithClientCertificateCommonNames { + /** + * Specifies clientCertificateCommonNames. + * @param clientCertificateCommonNames List of client certificates to whitelist based on common names + * @return the next update stage + */ + Update withClientCertificateCommonNames(List clientCertificateCommonNames); + } + + /** + * The stage of the cluster update allowing to specify ClientCertificateThumbprints. + */ + interface WithClientCertificateThumbprints { + /** + * Specifies clientCertificateThumbprints. + * @param clientCertificateThumbprints The client thumbprint details, it is used for client access for cluster operation, it will override existing collection + * @return the next update stage + */ + Update withClientCertificateThumbprints(List clientCertificateThumbprints); + } + + /** + * The stage of the cluster update allowing to specify ClusterCodeVersion. + */ + interface WithClusterCodeVersion { + /** + * Specifies clusterCodeVersion. + * @param clusterCodeVersion The ServiceFabric code version, if set it, please make sure you have set upgradeMode to Manual, otherwise ,it will fail, if you are using PUT new cluster, you can get the version by using ClusterVersions_List, if you are updating existing cluster, you can get the availableClusterVersions from Clusters_Get + * @return the next update stage + */ + Update withClusterCodeVersion(String clusterCodeVersion); + } + + /** + * The stage of the cluster update allowing to specify FabricSettings. + */ + interface WithFabricSettings { + /** + * Specifies fabricSettings. + * @param fabricSettings List of custom fabric settings to configure the cluster, Note, it will overwrite existing collection + * @return the next update stage + */ + Update withFabricSettings(List fabricSettings); + } + + /** + * The stage of the cluster update allowing to specify NodeTypes. + */ + interface WithNodeTypes { + /** + * Specifies nodeTypes. + * @param nodeTypes The list of nodetypes that make up the cluster, it will override + * @return the next update stage + */ + Update withNodeTypes(List nodeTypes); + } + + /** + * The stage of the cluster update allowing to specify ReliabilityLevel. + */ + interface WithReliabilityLevel { + /** + * Specifies reliabilityLevel. + * @param reliabilityLevel This level is used to set the number of replicas of the system services. Possible values include: 'Bronze', 'Silver', 'Gold' + * @return the next update stage + */ + Update withReliabilityLevel(String reliabilityLevel); + } + + /** + * The stage of the cluster update allowing to specify ReverseProxyCertificate. + */ + interface WithReverseProxyCertificate { + /** + * Specifies reverseProxyCertificate. + * @param reverseProxyCertificate Certificate for the reverse proxy + * @return the next update stage + */ + Update withReverseProxyCertificate(CertificateDescription reverseProxyCertificate); + } + + /** + * The stage of the cluster update allowing to specify UpgradeDescription. + */ + interface WithUpgradeDescription { + /** + * Specifies upgradeDescription. + * @param upgradeDescription The policy to use when upgrading the cluster + * @return the next update stage + */ + Update withUpgradeDescription(ClusterUpgradePolicy upgradeDescription); + } + + /** + * The stage of the cluster update allowing to specify UpgradeMode. + */ + interface WithUpgradeMode { + /** + * Specifies upgradeMode. + * @param upgradeMode Cluster upgrade mode indicates if fabric upgrade is initiated automatically by the system or not. Possible values include: 'Automatic', 'Manual' + * @return the next update stage + */ + Update withUpgradeMode(String upgradeMode); + } + + } +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterCodeVersionsResult.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterCodeVersionsResult.java new file mode 100644 index 000000000000..c85dc07ca6ed --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterCodeVersionsResult.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.servicefabric.v2016_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicefabric.v2016_09_01.implementation.ClusterCodeVersionsResultInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicefabric.v2016_09_01.implementation.ServiceFabricManager; + +/** + * Type representing ClusterCodeVersionsResult. + */ +public interface ClusterCodeVersionsResult extends HasInner, HasManager { + /** + * @return the codeVersion value. + */ + String codeVersion(); + + /** + * @return the environment value. + */ + String environment(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the supportExpiryUtc value. + */ + String supportExpiryUtc(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterHealthPolicy.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterHealthPolicy.java new file mode 100644 index 000000000000..c65c627a16a1 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterHealthPolicy.java @@ -0,0 +1,74 @@ +/** + * 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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a health policy used to evaluate the health of the cluster or of a + * cluster node. + */ +public class ClusterHealthPolicy { + /** + * The maximum allowed percentage of unhealthy nodes before reporting an + * error. For example, to allow 10% of nodes to be unhealthy, this value + * would be 10. + */ + @JsonProperty(value = "maxPercentUnhealthyNodes") + private Integer maxPercentUnhealthyNodes; + + /** + * The maximum allowed percentage of unhealthy applications before + * reporting an error. For example, to allow 10% of applications to be + * unhealthy, this value would be 10. + */ + @JsonProperty(value = "maxPercentUnhealthyApplications") + private Integer maxPercentUnhealthyApplications; + + /** + * Get the maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * @return the maxPercentUnhealthyNodes value + */ + public Integer maxPercentUnhealthyNodes() { + return this.maxPercentUnhealthyNodes; + } + + /** + * Set the maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * @param maxPercentUnhealthyNodes the maxPercentUnhealthyNodes value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withMaxPercentUnhealthyNodes(Integer maxPercentUnhealthyNodes) { + this.maxPercentUnhealthyNodes = maxPercentUnhealthyNodes; + return this; + } + + /** + * Get the maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10. + * + * @return the maxPercentUnhealthyApplications value + */ + public Integer maxPercentUnhealthyApplications() { + return this.maxPercentUnhealthyApplications; + } + + /** + * Set the maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10. + * + * @param maxPercentUnhealthyApplications the maxPercentUnhealthyApplications value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withMaxPercentUnhealthyApplications(Integer maxPercentUnhealthyApplications) { + this.maxPercentUnhealthyApplications = maxPercentUnhealthyApplications; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpdateParameters.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpdateParameters.java new file mode 100644 index 000000000000..0e559c3aacbd --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpdateParameters.java @@ -0,0 +1,319 @@ +/** + * 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.servicefabric.v2016_09_01; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Cluster update request. + */ +@JsonFlatten +public class ClusterUpdateParameters { + /** + * This level is used to set the number of replicas of the system services. + * Possible values include: 'Bronze', 'Silver', 'Gold'. + */ + @JsonProperty(value = "properties.reliabilityLevel") + private String reliabilityLevel; + + /** + * Cluster upgrade mode indicates if fabric upgrade is initiated + * automatically by the system or not. Possible values include: + * 'Automatic', 'Manual'. + */ + @JsonProperty(value = "properties.upgradeMode") + private String upgradeMode; + + /** + * The ServiceFabric code version, if set it, please make sure you have set + * upgradeMode to Manual, otherwise ,it will fail, if you are using PUT new + * cluster, you can get the version by using ClusterVersions_List, if you + * are updating existing cluster, you can get the availableClusterVersions + * from Clusters_Get. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /** + * This primay certificate will be used as cluster node to node security, + * SSL certificate for cluster management endpoint and default admin + * client, the certificate should exist in the virtual machine scale sets + * or Azure key vault, before you add it. It will override original value. + */ + @JsonProperty(value = "properties.certificate") + private CertificateDescription certificate; + + /** + * The client thumbprint details, it is used for client access for cluster + * operation, it will override existing collection. + */ + @JsonProperty(value = "properties.clientCertificateThumbprints") + private List clientCertificateThumbprints; + + /** + * List of client certificates to whitelist based on common names. + */ + @JsonProperty(value = "properties.clientCertificateCommonNames") + private List clientCertificateCommonNames; + + /** + * List of custom fabric settings to configure the cluster, Note, it will + * overwrite existing collection. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /** + * Certificate for the reverse proxy. + */ + @JsonProperty(value = "properties.reverseProxyCertificate") + private CertificateDescription reverseProxyCertificate; + + /** + * The list of nodetypes that make up the cluster, it will override. + */ + @JsonProperty(value = "properties.nodeTypes") + private List nodeTypes; + + /** + * The policy to use when upgrading the cluster. + */ + @JsonProperty(value = "properties.upgradeDescription") + private ClusterUpgradePolicy upgradeDescription; + + /** + * Cluster update parameters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get this level is used to set the number of replicas of the system services. Possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @return the reliabilityLevel value + */ + public String reliabilityLevel() { + return this.reliabilityLevel; + } + + /** + * Set this level is used to set the number of replicas of the system services. Possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @param reliabilityLevel the reliabilityLevel value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withReliabilityLevel(String reliabilityLevel) { + this.reliabilityLevel = reliabilityLevel; + return this; + } + + /** + * Get cluster upgrade mode indicates if fabric upgrade is initiated automatically by the system or not. Possible values include: 'Automatic', 'Manual'. + * + * @return the upgradeMode value + */ + public String upgradeMode() { + return this.upgradeMode; + } + + /** + * Set cluster upgrade mode indicates if fabric upgrade is initiated automatically by the system or not. Possible values include: 'Automatic', 'Manual'. + * + * @param upgradeMode the upgradeMode value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withUpgradeMode(String upgradeMode) { + this.upgradeMode = upgradeMode; + return this; + } + + /** + * Get the ServiceFabric code version, if set it, please make sure you have set upgradeMode to Manual, otherwise ,it will fail, if you are using PUT new cluster, you can get the version by using ClusterVersions_List, if you are updating existing cluster, you can get the availableClusterVersions from Clusters_Get. + * + * @return the clusterCodeVersion value + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the ServiceFabric code version, if set it, please make sure you have set upgradeMode to Manual, otherwise ,it will fail, if you are using PUT new cluster, you can get the version by using ClusterVersions_List, if you are updating existing cluster, you can get the availableClusterVersions from Clusters_Get. + * + * @param clusterCodeVersion the clusterCodeVersion value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get this primay certificate will be used as cluster node to node security, SSL certificate for cluster management endpoint and default admin client, the certificate should exist in the virtual machine scale sets or Azure key vault, before you add it. It will override original value. + * + * @return the certificate value + */ + public CertificateDescription certificate() { + return this.certificate; + } + + /** + * Set this primay certificate will be used as cluster node to node security, SSL certificate for cluster management endpoint and default admin client, the certificate should exist in the virtual machine scale sets or Azure key vault, before you add it. It will override original value. + * + * @param certificate the certificate value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withCertificate(CertificateDescription certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get the client thumbprint details, it is used for client access for cluster operation, it will override existing collection. + * + * @return the clientCertificateThumbprints value + */ + public List clientCertificateThumbprints() { + return this.clientCertificateThumbprints; + } + + /** + * Set the client thumbprint details, it is used for client access for cluster operation, it will override existing collection. + * + * @param clientCertificateThumbprints the clientCertificateThumbprints value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClientCertificateThumbprints(List clientCertificateThumbprints) { + this.clientCertificateThumbprints = clientCertificateThumbprints; + return this; + } + + /** + * Get list of client certificates to whitelist based on common names. + * + * @return the clientCertificateCommonNames value + */ + public List clientCertificateCommonNames() { + return this.clientCertificateCommonNames; + } + + /** + * Set list of client certificates to whitelist based on common names. + * + * @param clientCertificateCommonNames the clientCertificateCommonNames value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClientCertificateCommonNames(List clientCertificateCommonNames) { + this.clientCertificateCommonNames = clientCertificateCommonNames; + return this; + } + + /** + * Get list of custom fabric settings to configure the cluster, Note, it will overwrite existing collection. + * + * @return the fabricSettings value + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set list of custom fabric settings to configure the cluster, Note, it will overwrite existing collection. + * + * @param fabricSettings the fabricSettings value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get certificate for the reverse proxy. + * + * @return the reverseProxyCertificate value + */ + public CertificateDescription reverseProxyCertificate() { + return this.reverseProxyCertificate; + } + + /** + * Set certificate for the reverse proxy. + * + * @param reverseProxyCertificate the reverseProxyCertificate value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + this.reverseProxyCertificate = reverseProxyCertificate; + return this; + } + + /** + * Get the list of nodetypes that make up the cluster, it will override. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of nodetypes that make up the cluster, it will override. + * + * @param nodeTypes the nodeTypes value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the policy to use when upgrading the cluster. + * + * @return the upgradeDescription value + */ + public ClusterUpgradePolicy upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set the policy to use when upgrading the cluster. + * + * @param upgradeDescription the upgradeDescription value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + + /** + * Get cluster update parameters. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set cluster update parameters. + * + * @param tags the tags value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpgradeDeltaHealthPolicy.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpgradeDeltaHealthPolicy.java new file mode 100644 index 000000000000..a4ff166279da --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpgradeDeltaHealthPolicy.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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Delta health policy for the cluster. + */ +public class ClusterUpgradeDeltaHealthPolicy { + /** + * Additional unhealthy nodes percentage. + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyNodes", required = true) + private int maxPercentDeltaUnhealthyNodes; + + /** + * Additional unhealthy nodes percentage per upgrade domain. + */ + @JsonProperty(value = "maxPercentUpgradeDomainDeltaUnhealthyNodes", required = true) + private int maxPercentUpgradeDomainDeltaUnhealthyNodes; + + /** + * Additional unhealthy applications percentage. + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyApplications", required = true) + private int maxPercentDeltaUnhealthyApplications; + + /** + * Get additional unhealthy nodes percentage. + * + * @return the maxPercentDeltaUnhealthyNodes value + */ + public int maxPercentDeltaUnhealthyNodes() { + return this.maxPercentDeltaUnhealthyNodes; + } + + /** + * Set additional unhealthy nodes percentage. + * + * @param maxPercentDeltaUnhealthyNodes the maxPercentDeltaUnhealthyNodes value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentDeltaUnhealthyNodes(int maxPercentDeltaUnhealthyNodes) { + this.maxPercentDeltaUnhealthyNodes = maxPercentDeltaUnhealthyNodes; + return this; + } + + /** + * Get additional unhealthy nodes percentage per upgrade domain. + * + * @return the maxPercentUpgradeDomainDeltaUnhealthyNodes value + */ + public int maxPercentUpgradeDomainDeltaUnhealthyNodes() { + return this.maxPercentUpgradeDomainDeltaUnhealthyNodes; + } + + /** + * Set additional unhealthy nodes percentage per upgrade domain. + * + * @param maxPercentUpgradeDomainDeltaUnhealthyNodes the maxPercentUpgradeDomainDeltaUnhealthyNodes value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentUpgradeDomainDeltaUnhealthyNodes(int maxPercentUpgradeDomainDeltaUnhealthyNodes) { + this.maxPercentUpgradeDomainDeltaUnhealthyNodes = maxPercentUpgradeDomainDeltaUnhealthyNodes; + return this; + } + + /** + * Get additional unhealthy applications percentage. + * + * @return the maxPercentDeltaUnhealthyApplications value + */ + public int maxPercentDeltaUnhealthyApplications() { + return this.maxPercentDeltaUnhealthyApplications; + } + + /** + * Set additional unhealthy applications percentage. + * + * @param maxPercentDeltaUnhealthyApplications the maxPercentDeltaUnhealthyApplications value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentDeltaUnhealthyApplications(int maxPercentDeltaUnhealthyApplications) { + this.maxPercentDeltaUnhealthyApplications = maxPercentDeltaUnhealthyApplications; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpgradePolicy.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpgradePolicy.java new file mode 100644 index 000000000000..09673be199ab --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpgradePolicy.java @@ -0,0 +1,280 @@ +/** + * 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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cluster upgrade policy. + */ +public class ClusterUpgradePolicy { + /** + * Use the user defined upgrade policy or not. + */ + @JsonProperty(value = "overrideUserUpgradePolicy") + private Boolean overrideUserUpgradePolicy; + + /** + * Force node to restart or not. + */ + @JsonProperty(value = "forceRestart") + private Boolean forceRestart; + + /** + * Timeout for replica set upgrade to complete,it represents .Net TimeSpan. + */ + @JsonProperty(value = "upgradeReplicaSetCheckTimeout", required = true) + private String upgradeReplicaSetCheckTimeout; + + /** + * The length of time to wait after completing an upgrade domain before + * performing health checks, it represents .Net TimeSpan. + */ + @JsonProperty(value = "healthCheckWaitDuration", required = true) + private String healthCheckWaitDuration; + + /** + * The length of time that health checks must pass continuously,it + * represents .Net TimeSpan. + */ + @JsonProperty(value = "healthCheckStableDuration", required = true) + private String healthCheckStableDuration; + + /** + * The length of time that health checks can fail continuously,it + * represents .Net TimeSpan. + */ + @JsonProperty(value = "healthCheckRetryTimeout", required = true) + private String healthCheckRetryTimeout; + + /** + * The upgrade timeout,it represents .Net TimeSpan. + */ + @JsonProperty(value = "upgradeTimeout", required = true) + private String upgradeTimeout; + + /** + * The timeout for any upgrade domain,it represents .Net TimeSpan. + */ + @JsonProperty(value = "upgradeDomainTimeout", required = true) + private String upgradeDomainTimeout; + + /** + * Cluster health Policy. + */ + @JsonProperty(value = "healthPolicy", required = true) + private ClusterHealthPolicy healthPolicy; + + /** + * Delta health policy. + */ + @JsonProperty(value = "deltaHealthPolicy") + private ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy; + + /** + * Get use the user defined upgrade policy or not. + * + * @return the overrideUserUpgradePolicy value + */ + public Boolean overrideUserUpgradePolicy() { + return this.overrideUserUpgradePolicy; + } + + /** + * Set use the user defined upgrade policy or not. + * + * @param overrideUserUpgradePolicy the overrideUserUpgradePolicy value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withOverrideUserUpgradePolicy(Boolean overrideUserUpgradePolicy) { + this.overrideUserUpgradePolicy = overrideUserUpgradePolicy; + return this; + } + + /** + * Get force node to restart or not. + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set force node to restart or not. + * + * @param forceRestart the forceRestart value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get timeout for replica set upgrade to complete,it represents .Net TimeSpan. + * + * @return the upgradeReplicaSetCheckTimeout value + */ + public String upgradeReplicaSetCheckTimeout() { + return this.upgradeReplicaSetCheckTimeout; + } + + /** + * Set timeout for replica set upgrade to complete,it represents .Net TimeSpan. + * + * @param upgradeReplicaSetCheckTimeout the upgradeReplicaSetCheckTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeReplicaSetCheckTimeout(String upgradeReplicaSetCheckTimeout) { + this.upgradeReplicaSetCheckTimeout = upgradeReplicaSetCheckTimeout; + return this; + } + + /** + * Get the length of time to wait after completing an upgrade domain before performing health checks, it represents .Net TimeSpan. + * + * @return the healthCheckWaitDuration value + */ + public String healthCheckWaitDuration() { + return this.healthCheckWaitDuration; + } + + /** + * Set the length of time to wait after completing an upgrade domain before performing health checks, it represents .Net TimeSpan. + * + * @param healthCheckWaitDuration the healthCheckWaitDuration value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckWaitDuration(String healthCheckWaitDuration) { + this.healthCheckWaitDuration = healthCheckWaitDuration; + return this; + } + + /** + * Get the length of time that health checks must pass continuously,it represents .Net TimeSpan. + * + * @return the healthCheckStableDuration value + */ + public String healthCheckStableDuration() { + return this.healthCheckStableDuration; + } + + /** + * Set the length of time that health checks must pass continuously,it represents .Net TimeSpan. + * + * @param healthCheckStableDuration the healthCheckStableDuration value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckStableDuration(String healthCheckStableDuration) { + this.healthCheckStableDuration = healthCheckStableDuration; + return this; + } + + /** + * Get the length of time that health checks can fail continuously,it represents .Net TimeSpan. + * + * @return the healthCheckRetryTimeout value + */ + public String healthCheckRetryTimeout() { + return this.healthCheckRetryTimeout; + } + + /** + * Set the length of time that health checks can fail continuously,it represents .Net TimeSpan. + * + * @param healthCheckRetryTimeout the healthCheckRetryTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckRetryTimeout(String healthCheckRetryTimeout) { + this.healthCheckRetryTimeout = healthCheckRetryTimeout; + return this; + } + + /** + * Get the upgrade timeout,it represents .Net TimeSpan. + * + * @return the upgradeTimeout value + */ + public String upgradeTimeout() { + return this.upgradeTimeout; + } + + /** + * Set the upgrade timeout,it represents .Net TimeSpan. + * + * @param upgradeTimeout the upgradeTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeTimeout(String upgradeTimeout) { + this.upgradeTimeout = upgradeTimeout; + return this; + } + + /** + * Get the timeout for any upgrade domain,it represents .Net TimeSpan. + * + * @return the upgradeDomainTimeout value + */ + public String upgradeDomainTimeout() { + return this.upgradeDomainTimeout; + } + + /** + * Set the timeout for any upgrade domain,it represents .Net TimeSpan. + * + * @param upgradeDomainTimeout the upgradeDomainTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeDomainTimeout(String upgradeDomainTimeout) { + this.upgradeDomainTimeout = upgradeDomainTimeout; + return this; + } + + /** + * Get cluster health Policy. + * + * @return the healthPolicy value + */ + public ClusterHealthPolicy healthPolicy() { + return this.healthPolicy; + } + + /** + * Set cluster health Policy. + * + * @param healthPolicy the healthPolicy value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthPolicy(ClusterHealthPolicy healthPolicy) { + this.healthPolicy = healthPolicy; + return this; + } + + /** + * Get delta health policy. + * + * @return the deltaHealthPolicy value + */ + public ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy() { + return this.deltaHealthPolicy; + } + + /** + * Set delta health policy. + * + * @param deltaHealthPolicy the deltaHealthPolicy value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withDeltaHealthPolicy(ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy) { + this.deltaHealthPolicy = deltaHealthPolicy; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterVersionDetails.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterVersionDetails.java new file mode 100644 index 000000000000..b1686db35fea --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterVersionDetails.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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The detail of the ServiceFabric runtime version result. + */ +public class ClusterVersionDetails { + /** + * The ServiceFabric runtime version of the cluster. + */ + @JsonProperty(value = "codeVersion") + private String codeVersion; + + /** + * The date of expiry of support of the version. + */ + @JsonProperty(value = "supportExpiryUtc") + private String supportExpiryUtc; + + /** + * Cluster operating system. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "environment") + private String environment; + + /** + * Get the ServiceFabric runtime version of the cluster. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the ServiceFabric runtime version of the cluster. + * + * @param codeVersion the codeVersion value to set + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the date of expiry of support of the version. + * + * @return the supportExpiryUtc value + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the date of expiry of support of the version. + * + * @param supportExpiryUtc the supportExpiryUtc value to set + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get cluster operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the environment value + */ + public String environment() { + return this.environment; + } + + /** + * Set cluster operating system. Possible values include: 'Windows', 'Linux'. + * + * @param environment the environment value to set + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withEnvironment(String environment) { + this.environment = environment; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterVersions.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterVersions.java new file mode 100644 index 000000000000..0a69c6ee9c41 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterVersions.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.servicefabric.v2016_09_01; + +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2016_09_01.implementation.ClusterVersionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ClusterVersions. + */ +public interface ClusterVersions extends HasInner { + /** + * List cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByEnvironmentAsync(final String location, final String environment); + + /** + * Get cluster code versions by environment and version. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param clusterVersion The cluster code version + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String location, String environment, String clusterVersion); + + /** + * List cluster code versions by version. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param clusterVersion The cluster code version + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByVersionAsync(final String location, final String clusterVersion); + + /** + * List cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String location); + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Clusters.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Clusters.java new file mode 100644 index 000000000000..bab50c1c8dac --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Clusters.java @@ -0,0 +1,25 @@ +/** + * 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.servicefabric.v2016_09_01; + +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 com.microsoft.azure.management.servicefabric.v2016_09_01.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/DiagnosticsStorageAccountConfig.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/DiagnosticsStorageAccountConfig.java new file mode 100644 index 000000000000..d15bfe12fa7b --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/DiagnosticsStorageAccountConfig.java @@ -0,0 +1,147 @@ +/** + * 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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Diagnostics storage account config. + */ +public class DiagnosticsStorageAccountConfig { + /** + * Diagnostics storage account name. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /** + * Protected Diagnostics storage key name. + */ + @JsonProperty(value = "protectedAccountKeyName", required = true) + private String protectedAccountKeyName; + + /** + * Diagnostics storage account blob endpoint. + */ + @JsonProperty(value = "blobEndpoint", required = true) + private String blobEndpoint; + + /** + * Diagnostics storage account queue endpoint. + */ + @JsonProperty(value = "queueEndpoint", required = true) + private String queueEndpoint; + + /** + * Diagnostics storage account table endpoint. + */ + @JsonProperty(value = "tableEndpoint", required = true) + private String tableEndpoint; + + /** + * Get diagnostics storage account name. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set diagnostics storage account name. + * + * @param storageAccountName the storageAccountName value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get protected Diagnostics storage key name. + * + * @return the protectedAccountKeyName value + */ + public String protectedAccountKeyName() { + return this.protectedAccountKeyName; + } + + /** + * Set protected Diagnostics storage key name. + * + * @param protectedAccountKeyName the protectedAccountKeyName value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withProtectedAccountKeyName(String protectedAccountKeyName) { + this.protectedAccountKeyName = protectedAccountKeyName; + return this; + } + + /** + * Get diagnostics storage account blob endpoint. + * + * @return the blobEndpoint value + */ + public String blobEndpoint() { + return this.blobEndpoint; + } + + /** + * Set diagnostics storage account blob endpoint. + * + * @param blobEndpoint the blobEndpoint value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withBlobEndpoint(String blobEndpoint) { + this.blobEndpoint = blobEndpoint; + return this; + } + + /** + * Get diagnostics storage account queue endpoint. + * + * @return the queueEndpoint value + */ + public String queueEndpoint() { + return this.queueEndpoint; + } + + /** + * Set diagnostics storage account queue endpoint. + * + * @param queueEndpoint the queueEndpoint value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withQueueEndpoint(String queueEndpoint) { + this.queueEndpoint = queueEndpoint; + return this; + } + + /** + * Get diagnostics storage account table endpoint. + * + * @return the tableEndpoint value + */ + public String tableEndpoint() { + return this.tableEndpoint; + } + + /** + * Set diagnostics storage account table endpoint. + * + * @param tableEndpoint the tableEndpoint value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withTableEndpoint(String tableEndpoint) { + this.tableEndpoint = tableEndpoint; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/EndpointRangeDescription.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/EndpointRangeDescription.java new file mode 100644 index 000000000000..e7afb85c4b34 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/EndpointRangeDescription.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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Port range details. + */ +public class EndpointRangeDescription { + /** + * Starting port of a range of ports. + */ + @JsonProperty(value = "startPort", required = true) + private int startPort; + + /** + * End port of a range of ports. + */ + @JsonProperty(value = "endPort", required = true) + private int endPort; + + /** + * Get starting port of a range of ports. + * + * @return the startPort value + */ + public int startPort() { + return this.startPort; + } + + /** + * Set starting port of a range of ports. + * + * @param startPort the startPort value to set + * @return the EndpointRangeDescription object itself. + */ + public EndpointRangeDescription withStartPort(int startPort) { + this.startPort = startPort; + return this; + } + + /** + * Get end port of a range of ports. + * + * @return the endPort value + */ + public int endPort() { + return this.endPort; + } + + /** + * Set end port of a range of ports. + * + * @param endPort the endPort value to set + * @return the EndpointRangeDescription object itself. + */ + public EndpointRangeDescription withEndPort(int endPort) { + this.endPort = endPort; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModel.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModel.java new file mode 100644 index 000000000000..85b55f3ace45 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModel.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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The structure of the error. + */ +public class ErrorModel { + /** + * The error detail. + */ + @JsonProperty(value = "error") + private ErrorModelError error; + + /** + * Get the error detail. + * + * @return the error value + */ + public ErrorModelError error() { + return this.error; + } + + /** + * Set the error detail. + * + * @param error the error value to set + * @return the ErrorModel object itself. + */ + public ErrorModel withError(ErrorModelError error) { + this.error = error; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModelError.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModelError.java new file mode 100644 index 000000000000..a43a818c6f08 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModelError.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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error detail. + */ +public class ErrorModelError { + /** + * 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 ErrorModelError object itself. + */ + public ErrorModelError 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 ErrorModelError object itself. + */ + public ErrorModelError withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModelException.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModelException.java new file mode 100644 index 000000000000..3737168829b8 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModelException.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.servicefabric.v2016_09_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorModel information. + */ +public class ErrorModelException extends RestException { + /** + * Initializes a new instance of the ErrorModelException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorModelException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorModelException 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 ErrorModelException(final String message, final Response response, final ErrorModel body) { + super(message, response, body); + } + + @Override + public ErrorModel body() { + return (ErrorModel) super.body(); + } +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/NodeTypeDescription.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/NodeTypeDescription.java new file mode 100644 index 000000000000..b1ad66314011 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/NodeTypeDescription.java @@ -0,0 +1,309 @@ +/** + * 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.servicefabric.v2016_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a node type in the cluster, each node type represents sub set of + * nodes in the cluster. + */ +public class NodeTypeDescription { + /** + * Name of the node type. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The placement tags applied to nodes in the node type, which can be used + * to indicate where certain services (workload) should run. + */ + @JsonProperty(value = "placementProperties") + private Map placementProperties; + + /** + * The capacity tags applied to the nodes in the node type, the cluster + * resource manager uses these tags to understand how much of a resource a + * node has. + */ + @JsonProperty(value = "capacities") + private Map capacities; + + /** + * The TCP cluster management endpoint port. + */ + @JsonProperty(value = "clientConnectionEndpointPort", required = true) + private int clientConnectionEndpointPort; + + /** + * The HTTP cluster management endpoint port. + */ + @JsonProperty(value = "httpGatewayEndpointPort", required = true) + private int httpGatewayEndpointPort; + + /** + * Nodetype durability Level. Possible values include: 'Bronze', 'Silver', + * 'Gold'. + */ + @JsonProperty(value = "durabilityLevel") + private String durabilityLevel; + + /** + * Ports used by applications. + */ + @JsonProperty(value = "applicationPorts") + private EndpointRangeDescription applicationPorts; + + /** + * System assgined application ports. + */ + @JsonProperty(value = "ephemeralPorts") + private EndpointRangeDescription ephemeralPorts; + + /** + * Mark this as the primary node type. + */ + @JsonProperty(value = "isPrimary", required = true) + private boolean isPrimary; + + /** + * The number of node instances in the node type. + */ + @JsonProperty(value = "vmInstanceCount", required = true) + private int vmInstanceCount; + + /** + * Endpoint used by reverse proxy. + */ + @JsonProperty(value = "reverseProxyEndpointPort") + private Integer reverseProxyEndpointPort; + + /** + * Get name of the node type. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the node type. + * + * @param name the name value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run. + * + * @return the placementProperties value + */ + public Map placementProperties() { + return this.placementProperties; + } + + /** + * Set the placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run. + * + * @param placementProperties the placementProperties value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withPlacementProperties(Map placementProperties) { + this.placementProperties = placementProperties; + return this; + } + + /** + * Get the capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much of a resource a node has. + * + * @return the capacities value + */ + public Map capacities() { + return this.capacities; + } + + /** + * Set the capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much of a resource a node has. + * + * @param capacities the capacities value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withCapacities(Map capacities) { + this.capacities = capacities; + return this; + } + + /** + * Get the TCP cluster management endpoint port. + * + * @return the clientConnectionEndpointPort value + */ + public int clientConnectionEndpointPort() { + return this.clientConnectionEndpointPort; + } + + /** + * Set the TCP cluster management endpoint port. + * + * @param clientConnectionEndpointPort the clientConnectionEndpointPort value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withClientConnectionEndpointPort(int clientConnectionEndpointPort) { + this.clientConnectionEndpointPort = clientConnectionEndpointPort; + return this; + } + + /** + * Get the HTTP cluster management endpoint port. + * + * @return the httpGatewayEndpointPort value + */ + public int httpGatewayEndpointPort() { + return this.httpGatewayEndpointPort; + } + + /** + * Set the HTTP cluster management endpoint port. + * + * @param httpGatewayEndpointPort the httpGatewayEndpointPort value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withHttpGatewayEndpointPort(int httpGatewayEndpointPort) { + this.httpGatewayEndpointPort = httpGatewayEndpointPort; + return this; + } + + /** + * Get nodetype durability Level. Possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @return the durabilityLevel value + */ + public String durabilityLevel() { + return this.durabilityLevel; + } + + /** + * Set nodetype durability Level. Possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @param durabilityLevel the durabilityLevel value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withDurabilityLevel(String durabilityLevel) { + this.durabilityLevel = durabilityLevel; + return this; + } + + /** + * Get ports used by applications. + * + * @return the applicationPorts value + */ + public EndpointRangeDescription applicationPorts() { + return this.applicationPorts; + } + + /** + * Set ports used by applications. + * + * @param applicationPorts the applicationPorts value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withApplicationPorts(EndpointRangeDescription applicationPorts) { + this.applicationPorts = applicationPorts; + return this; + } + + /** + * Get system assgined application ports. + * + * @return the ephemeralPorts value + */ + public EndpointRangeDescription ephemeralPorts() { + return this.ephemeralPorts; + } + + /** + * Set system assgined application ports. + * + * @param ephemeralPorts the ephemeralPorts value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withEphemeralPorts(EndpointRangeDescription ephemeralPorts) { + this.ephemeralPorts = ephemeralPorts; + return this; + } + + /** + * Get mark this as the primary node type. + * + * @return the isPrimary value + */ + public boolean isPrimary() { + return this.isPrimary; + } + + /** + * Set mark this as the primary node type. + * + * @param isPrimary the isPrimary value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withIsPrimary(boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get the number of node instances in the node type. + * + * @return the vmInstanceCount value + */ + public int vmInstanceCount() { + return this.vmInstanceCount; + } + + /** + * Set the number of node instances in the node type. + * + * @param vmInstanceCount the vmInstanceCount value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withVmInstanceCount(int vmInstanceCount) { + this.vmInstanceCount = vmInstanceCount; + return this; + } + + /** + * Get endpoint used by reverse proxy. + * + * @return the reverseProxyEndpointPort value + */ + public Integer reverseProxyEndpointPort() { + return this.reverseProxyEndpointPort; + } + + /** + * Set endpoint used by reverse proxy. + * + * @param reverseProxyEndpointPort the reverseProxyEndpointPort value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withReverseProxyEndpointPort(Integer reverseProxyEndpointPort) { + this.reverseProxyEndpointPort = reverseProxyEndpointPort; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/OperationResult.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/OperationResult.java new file mode 100644 index 000000000000..c7f7cbdfe61d --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/OperationResult.java @@ -0,0 +1,40 @@ +/** + * 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.servicefabric.v2016_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicefabric.v2016_09_01.implementation.ServiceFabricManager; +import com.microsoft.azure.management.servicefabric.v2016_09_01.implementation.OperationResultInner; + +/** + * Type representing OperationResult. + */ +public interface OperationResult extends HasInner, HasManager { + /** + * @return the display value. + */ + AvailableOperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the origin value. + */ + String origin(); + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Operations.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Operations.java new file mode 100644 index 000000000000..f809f0dc4ddc --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/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.servicefabric.v2016_09_01; + +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2016_09_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available ServiceFabric REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ProvisioningState.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ProvisioningState.java new file mode 100644 index 000000000000..523738410f72 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ProvisioningState.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.servicefabric.v2016_09_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/SettingsParameterDescription.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/SettingsParameterDescription.java new file mode 100644 index 000000000000..59963838cbb3 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/SettingsParameterDescription.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.servicefabric.v2016_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ServiceFabric settings under sections. + */ +public class SettingsParameterDescription { + /** + * The name of settings property. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the property. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name of settings property. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of settings property. + * + * @param name the name value to set + * @return the SettingsParameterDescription object itself. + */ + public SettingsParameterDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the property. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the property. + * + * @param value the value value to set + * @return the SettingsParameterDescription object itself. + */ + public SettingsParameterDescription withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/SettingsSectionDescription.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/SettingsSectionDescription.java new file mode 100644 index 000000000000..bdf92f880884 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/SettingsSectionDescription.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.servicefabric.v2016_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * ServiceFabric section settings. + */ +public class SettingsSectionDescription { + /** + * The name of settings section. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Collection of settings in the section, each setting is a tuple + * consisting of setting name and value. + */ + @JsonProperty(value = "parameters", required = true) + private List parameters; + + /** + * Get the name of settings section. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of settings section. + * + * @param name the name value to set + * @return the SettingsSectionDescription object itself. + */ + public SettingsSectionDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get collection of settings in the section, each setting is a tuple consisting of setting name and value. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set collection of settings in the section, each setting is a tuple consisting of setting name and value. + * + * @param parameters the parameters value to set + * @return the SettingsSectionDescription object itself. + */ + public SettingsSectionDescription withParameters(List parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterCodeVersionsResultImpl.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterCodeVersionsResultImpl.java new file mode 100644 index 000000000000..ef05abfc455d --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterCodeVersionsResultImpl.java @@ -0,0 +1,60 @@ +/** + * 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.servicefabric.v2016_09_01.implementation; + +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterCodeVersionsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class ClusterCodeVersionsResultImpl extends WrapperImpl implements ClusterCodeVersionsResult { + private final ServiceFabricManager manager; + + ClusterCodeVersionsResultImpl(ClusterCodeVersionsResultInner inner, ServiceFabricManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + + + @Override + public String codeVersion() { + return this.inner().codeVersion(); + } + + @Override + public String environment() { + return this.inner().environment(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String supportExpiryUtc() { + return this.inner().supportExpiryUtc(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterCodeVersionsResultInner.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterCodeVersionsResultInner.java new file mode 100644 index 000000000000..ab0b331e1697 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterCodeVersionsResultInner.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.servicefabric.v2016_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The result of the ServiceFabric runtime versions. + */ +@JsonFlatten +public class ClusterCodeVersionsResultInner { + /** + * The identification of the result. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the result. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The result resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The ServiceFabric runtime version of the cluster. + */ + @JsonProperty(value = "properties.codeVersion") + private String codeVersion; + + /** + * The date of expiry of support of the version. + */ + @JsonProperty(value = "properties.supportExpiryUtc") + private String supportExpiryUtc; + + /** + * Cluster operating system. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.environment") + private String environment; + + /** + * Get the identification of the result. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the identification of the result. + * + * @param id the id value to set + * @return the ClusterCodeVersionsResultInner object itself. + */ + public ClusterCodeVersionsResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the result. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the result. + * + * @param name the name value to set + * @return the ClusterCodeVersionsResultInner object itself. + */ + public ClusterCodeVersionsResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the result resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the result resource type. + * + * @param type the type value to set + * @return the ClusterCodeVersionsResultInner object itself. + */ + public ClusterCodeVersionsResultInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the ServiceFabric runtime version of the cluster. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the ServiceFabric runtime version of the cluster. + * + * @param codeVersion the codeVersion value to set + * @return the ClusterCodeVersionsResultInner object itself. + */ + public ClusterCodeVersionsResultInner withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the date of expiry of support of the version. + * + * @return the supportExpiryUtc value + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the date of expiry of support of the version. + * + * @param supportExpiryUtc the supportExpiryUtc value to set + * @return the ClusterCodeVersionsResultInner object itself. + */ + public ClusterCodeVersionsResultInner withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get cluster operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the environment value + */ + public String environment() { + return this.environment; + } + + /** + * Set cluster operating system. Possible values include: 'Windows', 'Linux'. + * + * @param environment the environment value to set + * @return the ClusterCodeVersionsResultInner object itself. + */ + public ClusterCodeVersionsResultInner withEnvironment(String environment) { + this.environment = environment; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterImpl.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterImpl.java new file mode 100644 index 000000000000..d3236e1e6862 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterImpl.java @@ -0,0 +1,297 @@ +/** + * 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.servicefabric.v2016_09_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.servicefabric.v2016_09_01.Cluster; +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterUpdateParameters; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterVersionDetails; +import com.microsoft.azure.management.servicefabric.v2016_09_01.CertificateDescription; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClientCertificateThumbprint; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClientCertificateCommonName; +import com.microsoft.azure.management.servicefabric.v2016_09_01.SettingsSectionDescription; +import com.microsoft.azure.management.servicefabric.v2016_09_01.NodeTypeDescription; +import com.microsoft.azure.management.servicefabric.v2016_09_01.AzureActiveDirectory; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ProvisioningState; +import com.microsoft.azure.management.servicefabric.v2016_09_01.DiagnosticsStorageAccountConfig; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterUpgradePolicy; +import rx.functions.Func1; + +class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterUpdateParameters updateParameter; + ClusterImpl(String name, ClusterInner inner, ServiceFabricManager manager) { + super(name, inner, manager); + this.updateParameter = new ClusterUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .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.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .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.updateParameter = new ClusterUpdateParameters(); + } + + @Override + public List availableClusterVersions() { + return this.inner().availableClusterVersions(); + } + + @Override + public AzureActiveDirectory azureActiveDirectory() { + return this.inner().azureActiveDirectory(); + } + + @Override + public CertificateDescription certificate() { + return this.inner().certificate(); + } + + @Override + public List clientCertificateCommonNames() { + return this.inner().clientCertificateCommonNames(); + } + + @Override + public List clientCertificateThumbprints() { + return this.inner().clientCertificateThumbprints(); + } + + @Override + public String clusterCodeVersion() { + return this.inner().clusterCodeVersion(); + } + + @Override + public String clusterEndpoint() { + return this.inner().clusterEndpoint(); + } + + @Override + public String clusterId() { + return this.inner().clusterId(); + } + + @Override + public String clusterState() { + return this.inner().clusterState(); + } + + @Override + public DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig() { + return this.inner().diagnosticsStorageAccountConfig(); + } + + @Override + public List fabricSettings() { + return this.inner().fabricSettings(); + } + + @Override + public String managementEndpoint() { + return this.inner().managementEndpoint(); + } + + @Override + public List nodeTypes() { + return this.inner().nodeTypes(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String reliabilityLevel() { + return this.inner().reliabilityLevel(); + } + + @Override + public CertificateDescription reverseProxyCertificate() { + return this.inner().reverseProxyCertificate(); + } + + @Override + public ClusterUpgradePolicy upgradeDescription() { + return this.inner().upgradeDescription(); + } + + @Override + public String upgradeMode() { + return this.inner().upgradeMode(); + } + + @Override + public String vmImage() { + return this.inner().vmImage(); + } + + @Override + public ClusterImpl withManagementEndpoint(String managementEndpoint) { + this.inner().withManagementEndpoint(managementEndpoint); + return this; + } + + @Override + public ClusterImpl withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.inner().withAzureActiveDirectory(azureActiveDirectory); + return this; + } + + @Override + public ClusterImpl withDiagnosticsStorageAccountConfig(DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig) { + this.inner().withDiagnosticsStorageAccountConfig(diagnosticsStorageAccountConfig); + return this; + } + + @Override + public ClusterImpl withVmImage(String vmImage) { + this.inner().withVmImage(vmImage); + return this; + } + + @Override + public ClusterImpl withNodeTypes(List nodeTypes) { + if (isInCreateMode()) { + this.inner().withNodeTypes(nodeTypes); + } else { + this.updateParameter.withNodeTypes(nodeTypes); + } + return this; + } + + @Override + public ClusterImpl withCertificate(CertificateDescription certificate) { + if (isInCreateMode()) { + this.inner().withCertificate(certificate); + } else { + this.updateParameter.withCertificate(certificate); + } + return this; + } + + @Override + public ClusterImpl withClientCertificateCommonNames(List clientCertificateCommonNames) { + if (isInCreateMode()) { + this.inner().withClientCertificateCommonNames(clientCertificateCommonNames); + } else { + this.updateParameter.withClientCertificateCommonNames(clientCertificateCommonNames); + } + return this; + } + + @Override + public ClusterImpl withClientCertificateThumbprints(List clientCertificateThumbprints) { + if (isInCreateMode()) { + this.inner().withClientCertificateThumbprints(clientCertificateThumbprints); + } else { + this.updateParameter.withClientCertificateThumbprints(clientCertificateThumbprints); + } + return this; + } + + @Override + public ClusterImpl withClusterCodeVersion(String clusterCodeVersion) { + if (isInCreateMode()) { + this.inner().withClusterCodeVersion(clusterCodeVersion); + } else { + this.updateParameter.withClusterCodeVersion(clusterCodeVersion); + } + return this; + } + + @Override + public ClusterImpl withFabricSettings(List fabricSettings) { + if (isInCreateMode()) { + this.inner().withFabricSettings(fabricSettings); + } else { + this.updateParameter.withFabricSettings(fabricSettings); + } + return this; + } + + @Override + public ClusterImpl withReliabilityLevel(String reliabilityLevel) { + if (isInCreateMode()) { + this.inner().withReliabilityLevel(reliabilityLevel); + } else { + this.updateParameter.withReliabilityLevel(reliabilityLevel); + } + return this; + } + + @Override + public ClusterImpl withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + if (isInCreateMode()) { + this.inner().withReverseProxyCertificate(reverseProxyCertificate); + } else { + this.updateParameter.withReverseProxyCertificate(reverseProxyCertificate); + } + return this; + } + + @Override + public ClusterImpl withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + if (isInCreateMode()) { + this.inner().withUpgradeDescription(upgradeDescription); + } else { + this.updateParameter.withUpgradeDescription(upgradeDescription); + } + return this; + } + + @Override + public ClusterImpl withUpgradeMode(String upgradeMode) { + if (isInCreateMode()) { + this.inner().withUpgradeMode(upgradeMode); + } else { + this.updateParameter.withUpgradeMode(upgradeMode); + } + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterInner.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterInner.java new file mode 100644 index 000000000000..b9b0043eb77a --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterInner.java @@ -0,0 +1,484 @@ +/** + * 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.servicefabric.v2016_09_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterVersionDetails; +import com.microsoft.azure.management.servicefabric.v2016_09_01.CertificateDescription; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClientCertificateThumbprint; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClientCertificateCommonName; +import com.microsoft.azure.management.servicefabric.v2016_09_01.SettingsSectionDescription; +import com.microsoft.azure.management.servicefabric.v2016_09_01.NodeTypeDescription; +import com.microsoft.azure.management.servicefabric.v2016_09_01.AzureActiveDirectory; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ProvisioningState; +import com.microsoft.azure.management.servicefabric.v2016_09_01.DiagnosticsStorageAccountConfig; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterUpgradePolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The cluster resource. + */ +@JsonFlatten +public class ClusterInner extends Resource { + /** + * The available cluster code version which the cluster can upgrade to, + * note that you must choose upgradeMode to manual to upgrade to. + */ + @JsonProperty(value = "properties.availableClusterVersions", access = JsonProperty.Access.WRITE_ONLY) + private List availableClusterVersions; + + /** + * The unique identifier for the cluster resource. + */ + @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /** + * The state for the cluster. Possible values include: 'WaitingForNodes', + * 'Deploying', 'BaselineUpgrade', 'UpdatingUserConfiguration', + * 'UpdatingUserCertificate', 'UpdatingInfrastructure', + * 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', + * 'Ready'. + */ + @JsonProperty(value = "properties.clusterState", access = JsonProperty.Access.WRITE_ONLY) + private String clusterState; + + /** + * The endpoint for the cluster connecting to servicefabric resource + * provider. + */ + @JsonProperty(value = "properties.clusterEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String clusterEndpoint; + + /** + * The ServiceFabric code version running in your cluster. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /** + * This primay certificate will be used as cluster node to node security, + * SSL certificate for cluster management endpoint and default admin + * client. + */ + @JsonProperty(value = "properties.certificate") + private CertificateDescription certificate; + + /** + * Cluster reliability level indicates replica set size of system service. + * Possible values include: 'Bronze', 'Silver', 'Gold', 'Platinum'. + */ + @JsonProperty(value = "properties.reliabilityLevel") + private String reliabilityLevel; + + /** + * Cluster upgrade mode indicates if fabric upgrade is initiated + * automatically by the system or not. Possible values include: + * 'Automatic', 'Manual'. + */ + @JsonProperty(value = "properties.upgradeMode") + private String upgradeMode; + + /** + * The client thumbprint details ,it is used for client access for cluster + * operation. + */ + @JsonProperty(value = "properties.clientCertificateThumbprints") + private List clientCertificateThumbprints; + + /** + * List of client certificates to whitelist based on common names. + */ + @JsonProperty(value = "properties.clientCertificateCommonNames") + private List clientCertificateCommonNames; + + /** + * List of custom fabric settings to configure the cluster. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /** + * The server certificate used by reverse proxy. + */ + @JsonProperty(value = "properties.reverseProxyCertificate") + private CertificateDescription reverseProxyCertificate; + + /** + * The http management endpoint of the cluster. + */ + @JsonProperty(value = "properties.managementEndpoint", required = true) + private String managementEndpoint; + + /** + * The list of nodetypes that make up the cluster. + */ + @JsonProperty(value = "properties.nodeTypes", required = true) + private List nodeTypes; + + /** + * The settings to enable AAD authentication on the cluster. + */ + @JsonProperty(value = "properties.azureActiveDirectory") + private AzureActiveDirectory azureActiveDirectory; + + /** + * The provisioning state of the cluster resource. Possible values include: + * 'Updating', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The name of VM image VMSS has been configured with. Generic names such + * as Windows or Linux can be used. + */ + @JsonProperty(value = "properties.vmImage") + private String vmImage; + + /** + * The storage diagnostics account configuration details. + */ + @JsonProperty(value = "properties.diagnosticsStorageAccountConfig") + private DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig; + + /** + * The policy to use when upgrading the cluster. + */ + @JsonProperty(value = "properties.upgradeDescription") + private ClusterUpgradePolicy upgradeDescription; + + /** + * Get the available cluster code version which the cluster can upgrade to, note that you must choose upgradeMode to manual to upgrade to. + * + * @return the availableClusterVersions value + */ + public List availableClusterVersions() { + return this.availableClusterVersions; + } + + /** + * Get the unique identifier for the cluster resource. + * + * @return the clusterId value + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the state for the cluster. Possible values include: 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', 'UpdatingUserConfiguration', 'UpdatingUserCertificate', 'UpdatingInfrastructure', 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', 'Ready'. + * + * @return the clusterState value + */ + public String clusterState() { + return this.clusterState; + } + + /** + * Get the endpoint for the cluster connecting to servicefabric resource provider. + * + * @return the clusterEndpoint value + */ + public String clusterEndpoint() { + return this.clusterEndpoint; + } + + /** + * Get the ServiceFabric code version running in your cluster. + * + * @return the clusterCodeVersion value + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the ServiceFabric code version running in your cluster. + * + * @param clusterCodeVersion the clusterCodeVersion value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get this primay certificate will be used as cluster node to node security, SSL certificate for cluster management endpoint and default admin client. + * + * @return the certificate value + */ + public CertificateDescription certificate() { + return this.certificate; + } + + /** + * Set this primay certificate will be used as cluster node to node security, SSL certificate for cluster management endpoint and default admin client. + * + * @param certificate the certificate value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withCertificate(CertificateDescription certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get cluster reliability level indicates replica set size of system service. Possible values include: 'Bronze', 'Silver', 'Gold', 'Platinum'. + * + * @return the reliabilityLevel value + */ + public String reliabilityLevel() { + return this.reliabilityLevel; + } + + /** + * Set cluster reliability level indicates replica set size of system service. Possible values include: 'Bronze', 'Silver', 'Gold', 'Platinum'. + * + * @param reliabilityLevel the reliabilityLevel value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withReliabilityLevel(String reliabilityLevel) { + this.reliabilityLevel = reliabilityLevel; + return this; + } + + /** + * Get cluster upgrade mode indicates if fabric upgrade is initiated automatically by the system or not. Possible values include: 'Automatic', 'Manual'. + * + * @return the upgradeMode value + */ + public String upgradeMode() { + return this.upgradeMode; + } + + /** + * Set cluster upgrade mode indicates if fabric upgrade is initiated automatically by the system or not. Possible values include: 'Automatic', 'Manual'. + * + * @param upgradeMode the upgradeMode value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withUpgradeMode(String upgradeMode) { + this.upgradeMode = upgradeMode; + return this; + } + + /** + * Get the client thumbprint details ,it is used for client access for cluster operation. + * + * @return the clientCertificateThumbprints value + */ + public List clientCertificateThumbprints() { + return this.clientCertificateThumbprints; + } + + /** + * Set the client thumbprint details ,it is used for client access for cluster operation. + * + * @param clientCertificateThumbprints the clientCertificateThumbprints value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClientCertificateThumbprints(List clientCertificateThumbprints) { + this.clientCertificateThumbprints = clientCertificateThumbprints; + return this; + } + + /** + * Get list of client certificates to whitelist based on common names. + * + * @return the clientCertificateCommonNames value + */ + public List clientCertificateCommonNames() { + return this.clientCertificateCommonNames; + } + + /** + * Set list of client certificates to whitelist based on common names. + * + * @param clientCertificateCommonNames the clientCertificateCommonNames value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClientCertificateCommonNames(List clientCertificateCommonNames) { + this.clientCertificateCommonNames = clientCertificateCommonNames; + return this; + } + + /** + * Get list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set list of custom fabric settings to configure the cluster. + * + * @param fabricSettings the fabricSettings value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the server certificate used by reverse proxy. + * + * @return the reverseProxyCertificate value + */ + public CertificateDescription reverseProxyCertificate() { + return this.reverseProxyCertificate; + } + + /** + * Set the server certificate used by reverse proxy. + * + * @param reverseProxyCertificate the reverseProxyCertificate value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + this.reverseProxyCertificate = reverseProxyCertificate; + return this; + } + + /** + * Get the http management endpoint of the cluster. + * + * @return the managementEndpoint value + */ + public String managementEndpoint() { + return this.managementEndpoint; + } + + /** + * Set the http management endpoint of the cluster. + * + * @param managementEndpoint the managementEndpoint value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withManagementEndpoint(String managementEndpoint) { + this.managementEndpoint = managementEndpoint; + return this; + } + + /** + * Get the list of nodetypes that make up the cluster. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of nodetypes that make up the cluster. + * + * @param nodeTypes the nodeTypes value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the settings to enable AAD authentication on the cluster. + * + * @return the azureActiveDirectory value + */ + public AzureActiveDirectory azureActiveDirectory() { + return this.azureActiveDirectory; + } + + /** + * Set the settings to enable AAD authentication on the cluster. + * + * @param azureActiveDirectory the azureActiveDirectory value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.azureActiveDirectory = azureActiveDirectory; + return this; + } + + /** + * Get the provisioning state of the cluster resource. Possible values include: 'Updating', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. + * + * @return the vmImage value + */ + public String vmImage() { + return this.vmImage; + } + + /** + * Set the name of VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. + * + * @param vmImage the vmImage value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withVmImage(String vmImage) { + this.vmImage = vmImage; + return this; + } + + /** + * Get the storage diagnostics account configuration details. + * + * @return the diagnosticsStorageAccountConfig value + */ + public DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig() { + return this.diagnosticsStorageAccountConfig; + } + + /** + * Set the storage diagnostics account configuration details. + * + * @param diagnosticsStorageAccountConfig the diagnosticsStorageAccountConfig value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withDiagnosticsStorageAccountConfig(DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig) { + this.diagnosticsStorageAccountConfig = diagnosticsStorageAccountConfig; + return this; + } + + /** + * Get the policy to use when upgrading the cluster. + * + * @return the upgradeDescription value + */ + public ClusterUpgradePolicy upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set the policy to use when upgrading the cluster. + * + * @param upgradeDescription the upgradeDescription value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterVersionsImpl.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterVersionsImpl.java new file mode 100644 index 000000000000..c4a3c663ee3d --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterVersionsImpl.java @@ -0,0 +1,101 @@ +/** + * 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.servicefabric.v2016_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterVersions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterCodeVersionsResult; + +class ClusterVersionsImpl extends WrapperImpl implements ClusterVersions { + private final ServiceFabricManager manager; + + ClusterVersionsImpl(ServiceFabricManager manager) { + super(manager.inner().clusterVersions()); + this.manager = manager; + } + + public ServiceFabricManager manager() { + return this.manager; + } + + private ClusterCodeVersionsResultImpl wrapModel(ClusterCodeVersionsResultInner inner) { + return new ClusterCodeVersionsResultImpl(inner, manager()); + } + + @Override + public Observable listByEnvironmentAsync(final String location, final String environment) { + ClusterVersionsInner client = this.inner(); + return client.listByEnvironmentAsync(location, environment) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ClusterCodeVersionsResult call(ClusterCodeVersionsResultInner inner) { + return new ClusterCodeVersionsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String location, String environment, String clusterVersion) { + ClusterVersionsInner client = this.inner(); + return client.getAsync(location, environment, clusterVersion) + .map(new Func1() { + @Override + public ClusterCodeVersionsResult call(ClusterCodeVersionsResultInner inner) { + return new ClusterCodeVersionsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByVersionAsync(final String location, final String clusterVersion) { + ClusterVersionsInner client = this.inner(); + return client.listByVersionAsync(location, clusterVersion) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ClusterCodeVersionsResult call(ClusterCodeVersionsResultInner inner) { + return new ClusterCodeVersionsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String location) { + ClusterVersionsInner client = this.inner(); + return client.listAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ClusterCodeVersionsResult call(ClusterCodeVersionsResultInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterVersionsInner.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterVersionsInner.java new file mode 100644 index 000000000000..3cd98554f05e --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterVersionsInner.java @@ -0,0 +1,877 @@ +/** + * 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.servicefabric.v2016_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +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.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 ClusterVersions. + */ +public class ClusterVersionsInner { + /** The Retrofit service to perform REST calls. */ + private ClusterVersionsService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ClusterVersionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClusterVersionsInner(Retrofit retrofit, ServiceFabricManagementClientImpl client) { + this.service = retrofit.create(ClusterVersionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ClusterVersions to be + * used by Retrofit to perform actually REST calls. + */ + interface ClusterVersionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterVersions list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions") + Observable> list(@Path("location") String location, @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.servicefabric.v2016_09_01.ClusterVersions listByEnvironment" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions") + Observable> listByEnvironment(@Path("location") String location, @Path("environment") String environment, @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.servicefabric.v2016_09_01.ClusterVersions get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}") + Observable> get(@Path("location") String location, @Path("environment") String environment, @Path("subscriptionId") String subscriptionId, @Path("clusterVersion") String clusterVersion, @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.servicefabric.v2016_09_01.ClusterVersions listByVersion" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}") + Observable> listByVersion(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Path("clusterVersion") String clusterVersion, @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.servicefabric.v2016_09_01.ClusterVersions listNext" }) + @GET + Observable> listNext(@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.servicefabric.v2016_09_01.ClusterVersions listByEnvironmentNext" }) + @GET + Observable> listByEnvironmentNext(@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.servicefabric.v2016_09_01.ClusterVersions listByVersionNext" }) + @GET + Observable> listByVersionNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ClusterCodeVersionsResultInner> object if successful. + */ + public PagedList list(final String location) { + ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @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 location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterCodeVersionsResultInner> object + */ + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterCodeVersionsResultInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { + return listSinglePageAsync(location) + .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)); + } + }); + } + + /** + * List cluster code versions by location. + * + ServiceResponse> * @param location The location for the cluster code versions, this is different from cluster location + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterCodeVersionsResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String location) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + 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(location, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ClusterCodeVersionsResultInner> object if successful. + */ + public PagedList listByEnvironment(final String location, final String environment) { + ServiceResponse> response = listByEnvironmentSinglePageAsync(location, environment).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @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> listByEnvironmentAsync(final String location, final String environment, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByEnvironmentSinglePageAsync(location, environment), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByEnvironmentNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterCodeVersionsResultInner> object + */ + public Observable> listByEnvironmentAsync(final String location, final String environment) { + return listByEnvironmentWithServiceResponseAsync(location, environment) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterCodeVersionsResultInner> object + */ + public Observable>> listByEnvironmentWithServiceResponseAsync(final String location, final String environment) { + return listByEnvironmentSinglePageAsync(location, environment) + .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(listByEnvironmentNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List cluster code versions by environment. + * + ServiceResponse> * @param location The location for the cluster code versions, this is different from cluster location + ServiceResponse> * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterCodeVersionsResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByEnvironmentSinglePageAsync(final String location, final String environment) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (environment == null) { + throw new IllegalArgumentException("Parameter environment is required and cannot be null."); + } + 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.listByEnvironment(location, environment, 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 = listByEnvironmentDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByEnvironmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get cluster code versions by environment and version. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param clusterVersion The cluster code version + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterCodeVersionsResultInner object if successful. + */ + public ClusterCodeVersionsResultInner get(String location, String environment, String clusterVersion) { + return getWithServiceResponseAsync(location, environment, clusterVersion).toBlocking().single().body(); + } + + /** + * Get cluster code versions by environment and version. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param clusterVersion The cluster code version + * @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 location, String environment, String clusterVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(location, environment, clusterVersion), serviceCallback); + } + + /** + * Get cluster code versions by environment and version. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param clusterVersion The cluster code version + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsResultInner object + */ + public Observable getAsync(String location, String environment, String clusterVersion) { + return getWithServiceResponseAsync(location, environment, clusterVersion).map(new Func1, ClusterCodeVersionsResultInner>() { + @Override + public ClusterCodeVersionsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get cluster code versions by environment and version. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param clusterVersion The cluster code version + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsResultInner object + */ + public Observable> getWithServiceResponseAsync(String location, String environment, String clusterVersion) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (environment == null) { + throw new IllegalArgumentException("Parameter environment is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (clusterVersion == null) { + throw new IllegalArgumentException("Parameter clusterVersion 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(location, environment, this.client.subscriptionId(), clusterVersion, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List cluster code versions by version. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param clusterVersion The cluster code version + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ClusterCodeVersionsResultInner> object if successful. + */ + public PagedList listByVersion(final String location, final String clusterVersion) { + ServiceResponse> response = listByVersionSinglePageAsync(location, clusterVersion).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVersionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List cluster code versions by version. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param clusterVersion The cluster code version + * @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> listByVersionAsync(final String location, final String clusterVersion, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVersionSinglePageAsync(location, clusterVersion), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVersionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List cluster code versions by version. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param clusterVersion The cluster code version + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterCodeVersionsResultInner> object + */ + public Observable> listByVersionAsync(final String location, final String clusterVersion) { + return listByVersionWithServiceResponseAsync(location, clusterVersion) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List cluster code versions by version. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param clusterVersion The cluster code version + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterCodeVersionsResultInner> object + */ + public Observable>> listByVersionWithServiceResponseAsync(final String location, final String clusterVersion) { + return listByVersionSinglePageAsync(location, clusterVersion) + .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(listByVersionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List cluster code versions by version. + * + ServiceResponse> * @param location The location for the cluster code versions, this is different from cluster location + ServiceResponse> * @param clusterVersion The cluster code version + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterCodeVersionsResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVersionSinglePageAsync(final String location, final String clusterVersion) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (clusterVersion == null) { + throw new IllegalArgumentException("Parameter clusterVersion 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.listByVersion(location, this.client.subscriptionId(), clusterVersion, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVersionDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVersionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List cluster code versions by location. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ClusterCodeVersionsResultInner> 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(); + } + }; + } + + /** + * List cluster code versions by location. + * + * @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); + } + + /** + * List cluster code versions by location. + * + * @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<ClusterCodeVersionsResultInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List cluster code versions by location. + * + * @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<ClusterCodeVersionsResultInner> 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)); + } + }); + } + + /** + * List cluster code versions by location. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterCodeVersionsResultInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List cluster code versions by environment. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ClusterCodeVersionsResultInner> object if successful. + */ + public PagedList listByEnvironmentNext(final String nextPageLink) { + ServiceResponse> response = listByEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List cluster code versions by environment. + * + * @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> listByEnvironmentNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByEnvironmentNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByEnvironmentNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List cluster code versions by environment. + * + * @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<ClusterCodeVersionsResultInner> object + */ + public Observable> listByEnvironmentNextAsync(final String nextPageLink) { + return listByEnvironmentNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List cluster code versions by environment. + * + * @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<ClusterCodeVersionsResultInner> object + */ + public Observable>> listByEnvironmentNextWithServiceResponseAsync(final String nextPageLink) { + return listByEnvironmentNextSinglePageAsync(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(listByEnvironmentNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List cluster code versions by environment. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterCodeVersionsResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByEnvironmentNextSinglePageAsync(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.listByEnvironmentNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByEnvironmentNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByEnvironmentNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List cluster code versions by version. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ClusterCodeVersionsResultInner> object if successful. + */ + public PagedList listByVersionNext(final String nextPageLink) { + ServiceResponse> response = listByVersionNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByVersionNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List cluster code versions by version. + * + * @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> listByVersionNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByVersionNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByVersionNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List cluster code versions by version. + * + * @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<ClusterCodeVersionsResultInner> object + */ + public Observable> listByVersionNextAsync(final String nextPageLink) { + return listByVersionNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List cluster code versions by version. + * + * @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<ClusterCodeVersionsResultInner> object + */ + public Observable>> listByVersionNextWithServiceResponseAsync(final String nextPageLink) { + return listByVersionNextSinglePageAsync(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(listByVersionNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List cluster code versions by version. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterCodeVersionsResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByVersionNextSinglePageAsync(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.listByVersionNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByVersionNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByVersionNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClustersImpl.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClustersImpl.java new file mode 100644 index 000000000000..1d9952d53c6e --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClustersImpl.java @@ -0,0 +1,138 @@ +/** + * 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.servicefabric.v2016_09_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.servicefabric.v2016_09_01.Clusters; +import com.microsoft.azure.management.servicefabric.v2016_09_01.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; + +class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { + protected ClustersImpl(ServiceFabricManager 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 + 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()); + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClustersInner.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClustersInner.java new file mode 100644 index 000000000000..53f9560dd1c2 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClustersInner.java @@ -0,0 +1,1072 @@ +/** + * 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.servicefabric.v2016_09_01.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.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterUpdateParameters; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ErrorModelException; +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.PATCH; +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 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 ServiceFabricManagementClientImpl 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, ServiceFabricManagementClientImpl 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.servicefabric.v2016_09_01.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterUpdateParameters 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.servicefabric.v2016_09_01.Clusters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterUpdateParameters 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.servicefabric.v2016_09_01.Clusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.servicefabric.v2016_09_01.Clusters create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterInner 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.servicefabric.v2016_09_01.Clusters beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterInner 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.servicefabric.v2016_09_01.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.servicefabric.v2016_09_01.Clusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.servicefabric.v2016_09_01.Clusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/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.servicefabric.v2016_09_01.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.servicefabric.v2016_09_01.Clusters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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, ClusterUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters The parameters which contains the property value and property name which used to update 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 updateAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + 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.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."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 beginUpdate(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters The parameters which contains the property value and property name which used to update 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 beginUpdateAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterUpdateParameters parameters) { + 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.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."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, clusterName, this.client.subscriptionId(), 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Get cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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(); + } + + /** + * Get cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @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); + } + + /** + * Get cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @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(); + } + }); + } + + /** + * Get cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.getByResourceGroup(resourceGroupName, clusterName, this.client.subscriptionId(), 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters Put Request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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, ClusterInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters Put 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, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters Put Request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters Put Request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + 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.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."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.create(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters Put Request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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, ClusterInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters Put 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, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters Put Request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @param parameters Put Request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + 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.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."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreate(resourceGroupName, clusterName, this.client.subscriptionId(), 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Delete cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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().single().body(); + } + + /** + * Delete cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @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); + } + + /** + * Delete cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete cluster resource. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @param clusterName The name of the cluster resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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.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.delete(resourceGroupName, clusterName, this.client.subscriptionId(), 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * List cluster resource by resource group. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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(); + } + }; + } + + /** + * List cluster resource by resource group. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @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); + } + + /** + * List cluster resource by resource group. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @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(); + } + }); + } + + /** + * List cluster resource by resource group. + * + * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @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)); + } + }); + } + + /** + * List cluster resource by resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the resource belongs or get created + * @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 (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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.listByResourceGroup(resourceGroupName, 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 = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List cluster resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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(); + } + }; + } + + /** + * List cluster resource. + * + * @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); + } + + /** + * List cluster resource. + * + * @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(); + } + }); + } + + /** + * List cluster resource. + * + * @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)); + } + }); + } + + /** + * List cluster resource. + * + * @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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List cluster resource by resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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(); + } + }; + } + + /** + * List cluster resource by 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); + } + + /** + * List cluster resource by 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(); + } + }); + } + + /** + * List cluster resource by 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)); + } + }); + } + + /** + * List cluster resource by 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List cluster resource. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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(); + } + }; + } + + /** + * List cluster resource. + * + * @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); + } + + /** + * List cluster resource. + * + * @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(); + } + }); + } + + /** + * List cluster resource. + * + * @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)); + } + }); + } + + /** + * List cluster resource. + * + 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/IdParsingUtils.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..3fd6689238ca --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/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.servicefabric.v2016_09_01.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/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationResultImpl.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationResultImpl.java new file mode 100644 index 000000000000..0ea1869a91e6 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationResultImpl.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.servicefabric.v2016_09_01.implementation; + +import com.microsoft.azure.management.servicefabric.v2016_09_01.OperationResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2016_09_01.AvailableOperationDisplay; + +class OperationResultImpl extends WrapperImpl implements OperationResult { + private final ServiceFabricManager manager; + OperationResultImpl(OperationResultInner inner, ServiceFabricManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public AvailableOperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationResultInner.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationResultInner.java new file mode 100644 index 000000000000..06b9cce1804c --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationResultInner.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.servicefabric.v2016_09_01.implementation; + +import com.microsoft.azure.management.servicefabric.v2016_09_01.AvailableOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Available operation list result. + */ +public class OperationResultInner { + /** + * Result name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Dispaly of the result. + */ + @JsonProperty(value = "display") + private AvailableOperationDisplay display; + + /** + * Origin result. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get result name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set result name. + * + * @param name the name value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get dispaly of the result. + * + * @return the display value + */ + public AvailableOperationDisplay display() { + return this.display; + } + + /** + * Set dispaly of the result. + * + * @param display the display value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withDisplay(AvailableOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin result. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin result. + * + * @param origin the origin value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the URL to use for getting the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationsImpl.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..d15be2ae2500 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/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.servicefabric.v2016_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2016_09_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicefabric.v2016_09_01.OperationResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ServiceFabricManager manager; + + OperationsImpl(ServiceFabricManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ServiceFabricManager 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 OperationResult call(OperationResultInner inner) { + return new OperationResultImpl(inner, manager()); + } + }); + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationsInner.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..572f4453d76a --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/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.servicefabric.v2016_09_01.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.servicefabric.v2016_09_01.ErrorModelException; +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 ServiceFabricManagementClientImpl 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, ServiceFabricManagementClientImpl 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.servicefabric.v2016_09_01.Operations list" }) + @GET("providers/Microsoft.ServiceFabric/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.servicefabric.v2016_09_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available ServiceFabric REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<OperationResultInner> 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 ServiceFabric 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 ServiceFabric REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available ServiceFabric REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> 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 ServiceFabric REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationResultInner> 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Lists all of the available ServiceFabric REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<OperationResultInner> 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 ServiceFabric 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 ServiceFabric 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<OperationResultInner> 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 ServiceFabric 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<OperationResultInner> 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 ServiceFabric 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<OperationResultInner> 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/PageImpl.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/PageImpl.java new file mode 100644 index 000000000000..5c817cc90e84 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/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.servicefabric.v2016_09_01.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/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ServiceFabricManagementClientImpl.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ServiceFabricManagementClientImpl.java new file mode 100644 index 000000000000..78f3ba9f4461 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ServiceFabricManagementClientImpl.java @@ -0,0 +1,224 @@ +/** + * 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.servicefabric.v2016_09_01.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 ServiceFabricManagementClientImpl class. + */ +public class ServiceFabricManagementClientImpl 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 customer subscription identifier. */ + private String subscriptionId; + + /** + * Gets The customer subscription identifier. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The customer subscription identifier. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ServiceFabricManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The version of the ServiceFabric resouce provider api. */ + private String apiVersion; + + /** + * Gets The version of the ServiceFabric resouce provider api. + * + * @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 ServiceFabricManagementClientImpl 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 ServiceFabricManagementClientImpl 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 ServiceFabricManagementClientImpl 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 ClusterVersionsInner object to access its operations. + */ + private ClusterVersionsInner clusterVersions; + + /** + * Gets the ClusterVersionsInner object to access its operations. + * @return the ClusterVersionsInner object. + */ + public ClusterVersionsInner clusterVersions() { + return this.clusterVersions; + } + + /** + * 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 ServiceFabricManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ServiceFabricManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ServiceFabricManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ServiceFabricManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ServiceFabricManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ServiceFabricManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2016-09-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.clusterVersions = new ClusterVersionsInner(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(), "ServiceFabricManagementClient", "2016-09-01"); + } +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ServiceFabricManager.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ServiceFabricManager.java new file mode 100644 index 000000000000..da714d2799de --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ServiceFabricManager.java @@ -0,0 +1,123 @@ +/** + * 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.servicefabric.v2016_09_01.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.servicefabric.v2016_09_01.Clusters; +import com.microsoft.azure.management.servicefabric.v2016_09_01.ClusterVersions; +import com.microsoft.azure.management.servicefabric.v2016_09_01.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ServiceFabric resource management. + */ +public final class ServiceFabricManager extends ManagerCore { + private Clusters clusters; + private ClusterVersions clusterVersions; + private Operations operations; + /** + * Get a Configurable instance that can be used to create ServiceFabricManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ServiceFabricManager.ConfigurableImpl(); + } + /** + * Creates an instance of ServiceFabricManager that exposes ServiceFabric resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ServiceFabricManager + */ + public static ServiceFabricManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ServiceFabricManager(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 ServiceFabricManager that exposes ServiceFabric resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ServiceFabricManager + */ + public static ServiceFabricManager authenticate(RestClient restClient, String subscriptionId) { + return new ServiceFabricManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ServiceFabricManager that exposes ServiceFabric management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ServiceFabric management API entry points that work across subscriptions + */ + ServiceFabricManager 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 ClusterVersions. + */ + public ClusterVersions clusterVersions() { + if (this.clusterVersions == null) { + this.clusterVersions = new ClusterVersionsImpl(this); + } + return this.clusterVersions; + } + + /** + * @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 ServiceFabricManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ServiceFabricManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ServiceFabricManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ServiceFabricManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/package-info.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/package-info.java new file mode 100644 index 000000000000..4aa0cb09d1fa --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/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 ServiceFabricManagementClient. + * Service Fabric Management Client. + */ +package com.microsoft.azure.management.servicefabric.v2016_09_01.implementation; diff --git a/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/package-info.java b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/package-info.java new file mode 100644 index 000000000000..c29a2be18808 --- /dev/null +++ b/servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/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 ServiceFabricManagementClient. + * Service Fabric Management Client. + */ +package com.microsoft.azure.management.servicefabric.v2016_09_01; diff --git a/servicefabric/resource-manager/v2017_07_01_preview/pom.xml b/servicefabric/resource-manager/v2017_07_01_preview/pom.xml new file mode 100644 index 000000000000..9326486f6aec --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.servicefabric.v2017_07_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-servicefabric + 1.0.0-beta + jar + Microsoft Azure SDK for ServiceFabric Management + This package contains Microsoft ServiceFabric 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 + + + + + + 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/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationHealthPolicy.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationHealthPolicy.java new file mode 100644 index 000000000000..7ec0915ff510 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationHealthPolicy.java @@ -0,0 +1,138 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a health policy used to evaluate the health of an application or one + * of its children entities. + */ +public class ApplicationHealthPolicy { + /** + * Indicates whether warnings are treated with the same severity as errors. + */ + @JsonProperty(value = "ConsiderWarningAsError") + private Boolean considerWarningAsError; + + /** + * The maximum allowed percentage of unhealthy deployed applications. + * Allowed values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered + * in error. + * This is calculated by dividing the number of unhealthy deployed + * applications over the number of nodes where the application is currently + * deployed on in the cluster. + * The computation rounds up to tolerate one failure on small numbers of + * nodes. Default percentage is zero. + */ + @JsonProperty(value = "MaxPercentUnhealthyDeployedApplications") + private Integer maxPercentUnhealthyDeployedApplications; + + /** + * The defaultServiceTypeHealthPolicy property. + */ + @JsonProperty(value = "DefaultServiceTypeHealthPolicy") + private ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy; + + /** + * The serviceTypeHealthPolicyMap property. + */ + @JsonProperty(value = "ServiceTypeHealthPolicyMap") + private List serviceTypeHealthPolicyMap; + + /** + * Get indicates whether warnings are treated with the same severity as errors. + * + * @return the considerWarningAsError value + */ + public Boolean considerWarningAsError() { + return this.considerWarningAsError; + } + + /** + * Set indicates whether warnings are treated with the same severity as errors. + * + * @param considerWarningAsError the considerWarningAsError value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withConsiderWarningAsError(Boolean considerWarningAsError) { + this.considerWarningAsError = considerWarningAsError; + return this; + } + + /** + * Get the maximum allowed percentage of unhealthy deployed applications. Allowed values are Byte values from zero to 100. + The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error. + This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster. + The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. + * + * @return the maxPercentUnhealthyDeployedApplications value + */ + public Integer maxPercentUnhealthyDeployedApplications() { + return this.maxPercentUnhealthyDeployedApplications; + } + + /** + * Set the maximum allowed percentage of unhealthy deployed applications. Allowed values are Byte values from zero to 100. + The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error. + This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster. + The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. + * + * @param maxPercentUnhealthyDeployedApplications the maxPercentUnhealthyDeployedApplications value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withMaxPercentUnhealthyDeployedApplications(Integer maxPercentUnhealthyDeployedApplications) { + this.maxPercentUnhealthyDeployedApplications = maxPercentUnhealthyDeployedApplications; + return this; + } + + /** + * Get the defaultServiceTypeHealthPolicy value. + * + * @return the defaultServiceTypeHealthPolicy value + */ + public ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy() { + return this.defaultServiceTypeHealthPolicy; + } + + /** + * Set the defaultServiceTypeHealthPolicy value. + * + * @param defaultServiceTypeHealthPolicy the defaultServiceTypeHealthPolicy value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withDefaultServiceTypeHealthPolicy(ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy) { + this.defaultServiceTypeHealthPolicy = defaultServiceTypeHealthPolicy; + return this; + } + + /** + * Get the serviceTypeHealthPolicyMap value. + * + * @return the serviceTypeHealthPolicyMap value + */ + public List serviceTypeHealthPolicyMap() { + return this.serviceTypeHealthPolicyMap; + } + + /** + * Set the serviceTypeHealthPolicyMap value. + * + * @param serviceTypeHealthPolicyMap the serviceTypeHealthPolicyMap value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withServiceTypeHealthPolicyMap(List serviceTypeHealthPolicyMap) { + this.serviceTypeHealthPolicyMap = serviceTypeHealthPolicyMap; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationMetricDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationMetricDescription.java new file mode 100644 index 000000000000..ac6ede039935 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationMetricDescription.java @@ -0,0 +1,168 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes capacity information for a custom resource balancing metric. This + * can be used to limit the total consumption of this metric by the services of + * this application. + */ +public class ApplicationMetricDescription { + /** + * The name of the metric. + */ + @JsonProperty(value = "Name") + private String name; + + /** + * The maximum node capacity for Service Fabric application. + * This is the maximum Load for an instance of this application on a single + * node. Even if the capacity of node is greater than this value, Service + * Fabric will limit the total load of services within the application on + * each node to this value. + * If set to zero, capacity for this metric is unlimited on each node. + * When creating a new application with application capacity defined, the + * product of MaximumNodes and this value must always be smaller than or + * equal to TotalApplicationCapacity. + * When updating existing application with application capacity, the + * product of MaximumNodes and this value must always be smaller than or + * equal to TotalApplicationCapacity. + */ + @JsonProperty(value = "MaximumCapacity") + private Long maximumCapacity; + + /** + * The node reservation capacity for Service Fabric application. + * This is the amount of load which is reserved on nodes which have + * instances of this application. + * If MinimumNodes is specified, then the product of these values will be + * the capacity reserved in the cluster for the application. + * If set to zero, no capacity is reserved for this metric. + * When setting application capacity or when updating application capacity; + * this value must be smaller than or equal to MaximumCapacity for each + * metric. + */ + @JsonProperty(value = "ReservationCapacity") + private Long reservationCapacity; + + /** + * The total metric capacity for Service Fabric application. + * This is the total metric capacity for this application in the cluster. + * Service Fabric will try to limit the sum of loads of services within the + * application to this value. + * When creating a new application with application capacity defined, the + * product of MaximumNodes and MaximumCapacity must always be smaller than + * or equal to this value. + */ + @JsonProperty(value = "TotalApplicationCapacity") + private Long totalApplicationCapacity; + + /** + * Get the name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the metric. + * + * @param name the name value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the maximum node capacity for Service Fabric application. + This is the maximum Load for an instance of this application on a single node. Even if the capacity of node is greater than this value, Service Fabric will limit the total load of services within the application on each node to this value. + If set to zero, capacity for this metric is unlimited on each node. + When creating a new application with application capacity defined, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + When updating existing application with application capacity, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + * + * @return the maximumCapacity value + */ + public Long maximumCapacity() { + return this.maximumCapacity; + } + + /** + * Set the maximum node capacity for Service Fabric application. + This is the maximum Load for an instance of this application on a single node. Even if the capacity of node is greater than this value, Service Fabric will limit the total load of services within the application on each node to this value. + If set to zero, capacity for this metric is unlimited on each node. + When creating a new application with application capacity defined, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + When updating existing application with application capacity, the product of MaximumNodes and this value must always be smaller than or equal to TotalApplicationCapacity. + * + * @param maximumCapacity the maximumCapacity value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withMaximumCapacity(Long maximumCapacity) { + this.maximumCapacity = maximumCapacity; + return this; + } + + /** + * Get the node reservation capacity for Service Fabric application. + This is the amount of load which is reserved on nodes which have instances of this application. + If MinimumNodes is specified, then the product of these values will be the capacity reserved in the cluster for the application. + If set to zero, no capacity is reserved for this metric. + When setting application capacity or when updating application capacity; this value must be smaller than or equal to MaximumCapacity for each metric. + * + * @return the reservationCapacity value + */ + public Long reservationCapacity() { + return this.reservationCapacity; + } + + /** + * Set the node reservation capacity for Service Fabric application. + This is the amount of load which is reserved on nodes which have instances of this application. + If MinimumNodes is specified, then the product of these values will be the capacity reserved in the cluster for the application. + If set to zero, no capacity is reserved for this metric. + When setting application capacity or when updating application capacity; this value must be smaller than or equal to MaximumCapacity for each metric. + * + * @param reservationCapacity the reservationCapacity value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withReservationCapacity(Long reservationCapacity) { + this.reservationCapacity = reservationCapacity; + return this; + } + + /** + * Get the total metric capacity for Service Fabric application. + This is the total metric capacity for this application in the cluster. Service Fabric will try to limit the sum of loads of services within the application to this value. + When creating a new application with application capacity defined, the product of MaximumNodes and MaximumCapacity must always be smaller than or equal to this value. + * + * @return the totalApplicationCapacity value + */ + public Long totalApplicationCapacity() { + return this.totalApplicationCapacity; + } + + /** + * Set the total metric capacity for Service Fabric application. + This is the total metric capacity for this application in the cluster. Service Fabric will try to limit the sum of loads of services within the application to this value. + When creating a new application with application capacity defined, the product of MaximumNodes and MaximumCapacity must always be smaller than or equal to this value. + * + * @param totalApplicationCapacity the totalApplicationCapacity value to set + * @return the ApplicationMetricDescription object itself. + */ + public ApplicationMetricDescription withTotalApplicationCapacity(Long totalApplicationCapacity) { + this.totalApplicationCapacity = totalApplicationCapacity; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationParameter.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationParameter.java new file mode 100644 index 000000000000..a2007e35bce6 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationParameter.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an application parameter override to be applied when creating or + * upgrading an application. + */ +public class ApplicationParameter { + /** + * The name of the parameter. + */ + @JsonProperty(value = "Key", required = true) + private String key; + + /** + * The value of the parameter. + */ + @JsonProperty(value = "Value", required = true) + private String value; + + /** + * Get the name of the parameter. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the name of the parameter. + * + * @param key the key value to set + * @return the ApplicationParameter object itself. + */ + public ApplicationParameter withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value of the parameter. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the parameter. + * + * @param value the value value to set + * @return the ApplicationParameter object itself. + */ + public ApplicationParameter withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationResource.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationResource.java new file mode 100644 index 000000000000..4f8045323304 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationResource.java @@ -0,0 +1,279 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The application resource. + */ +@JsonFlatten +public class ApplicationResource extends ProxyResource { + /** + * The typeVersion property. + */ + @JsonProperty(value = "properties.typeVersion") + private String typeVersion; + + /** + * The parameters property. + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /** + * The upgradePolicy property. + */ + @JsonProperty(value = "properties.upgradePolicy") + private ApplicationUpgradePolicy upgradePolicy; + + /** + * The minimum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. If this property + * is set to zero, no capacity will be reserved. The value of this property + * cannot be more than the value of the MaximumNodes property. + */ + @JsonProperty(value = "properties.minimumNodes") + private Long minimumNodes; + + /** + * The maximum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. By default, the + * value of this property is zero and it means that the services can be + * placed on any node. + */ + @JsonProperty(value = "properties.maximumNodes") + private Long maximumNodes; + + /** + * The version of the application type. + */ + @JsonProperty(value = "properties.removeApplicationCapacity") + private Boolean removeApplicationCapacity; + + /** + * The metrics property. + */ + @JsonProperty(value = "properties.metrics") + private List metrics; + + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The typeName property. + */ + @JsonProperty(value = "properties.typeName") + private String typeName; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the typeVersion value. + * + * @return the typeVersion value + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the typeVersion value. + * + * @param typeVersion the typeVersion value to set + * @return the ApplicationResource object itself. + */ + public ApplicationResource withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get the parameters value. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @param parameters the parameters value to set + * @return the ApplicationResource object itself. + */ + public ApplicationResource withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the upgradePolicy value. + * + * @return the upgradePolicy value + */ + public ApplicationUpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy value. + * + * @param upgradePolicy the upgradePolicy value to set + * @return the ApplicationResource object itself. + */ + public ApplicationResource withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. + * + * @return the minimumNodes value + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set the minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. + * + * @param minimumNodes the minimumNodes value to set + * @return the ApplicationResource object itself. + */ + public ApplicationResource withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get the maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @return the maximumNodes value + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set the maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @param maximumNodes the maximumNodes value to set + * @return the ApplicationResource object itself. + */ + public ApplicationResource withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get the version of the application type. + * + * @return the removeApplicationCapacity value + */ + public Boolean removeApplicationCapacity() { + return this.removeApplicationCapacity; + } + + /** + * Set the version of the application type. + * + * @param removeApplicationCapacity the removeApplicationCapacity value to set + * @return the ApplicationResource object itself. + */ + public ApplicationResource withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + this.removeApplicationCapacity = removeApplicationCapacity; + return this; + } + + /** + * Get the metrics value. + * + * @return the metrics value + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics value. + * + * @param metrics the metrics value to set + * @return the ApplicationResource object itself. + */ + public ApplicationResource withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the current deployment or provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the typeName value. + * + * @return the typeName value + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName value. + * + * @param typeName the typeName value to set + * @return the ApplicationResource object itself. + */ + public ApplicationResource withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ApplicationResource object itself. + */ + public ApplicationResource withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationResourceList.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationResourceList.java new file mode 100644 index 000000000000..c7e0d7750e30 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationResourceList.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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of application resources. + */ +public class ApplicationResourceList { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ApplicationResourceList object itself. + */ + public ApplicationResourceList withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationResourceUpdate.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationResourceUpdate.java new file mode 100644 index 000000000000..5b1c0941cdcb --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationResourceUpdate.java @@ -0,0 +1,237 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The application resource for patch operations. + */ +@JsonFlatten +public class ApplicationResourceUpdate extends ProxyResource { + /** + * The typeVersion property. + */ + @JsonProperty(value = "properties.typeVersion") + private String typeVersion; + + /** + * The parameters property. + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /** + * The upgradePolicy property. + */ + @JsonProperty(value = "properties.upgradePolicy") + private ApplicationUpgradePolicy upgradePolicy; + + /** + * The minimum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. If this property + * is set to zero, no capacity will be reserved. The value of this property + * cannot be more than the value of the MaximumNodes property. + */ + @JsonProperty(value = "properties.minimumNodes") + private Long minimumNodes; + + /** + * The maximum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. By default, the + * value of this property is zero and it means that the services can be + * placed on any node. + */ + @JsonProperty(value = "properties.maximumNodes") + private Long maximumNodes; + + /** + * The version of the application type. + */ + @JsonProperty(value = "properties.removeApplicationCapacity") + private Boolean removeApplicationCapacity; + + /** + * The metrics property. + */ + @JsonProperty(value = "properties.metrics") + private List metrics; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the typeVersion value. + * + * @return the typeVersion value + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the typeVersion value. + * + * @param typeVersion the typeVersion value to set + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get the parameters value. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @param parameters the parameters value to set + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the upgradePolicy value. + * + * @return the upgradePolicy value + */ + public ApplicationUpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy value. + * + * @param upgradePolicy the upgradePolicy value to set + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. + * + * @return the minimumNodes value + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set the minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. + * + * @param minimumNodes the minimumNodes value to set + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get the maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @return the maximumNodes value + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set the maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @param maximumNodes the maximumNodes value to set + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get the version of the application type. + * + * @return the removeApplicationCapacity value + */ + public Boolean removeApplicationCapacity() { + return this.removeApplicationCapacity; + } + + /** + * Set the version of the application type. + * + * @param removeApplicationCapacity the removeApplicationCapacity value to set + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + this.removeApplicationCapacity = removeApplicationCapacity; + return this; + } + + /** + * Get the metrics value. + * + * @return the metrics value + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics value. + * + * @param metrics the metrics value to set + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationTypeResource.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationTypeResource.java new file mode 100644 index 000000000000..2b14b08587f3 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationTypeResource.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The application type name resource. + */ +@JsonFlatten +public class ApplicationTypeResource extends ProxyResource { + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the current deployment or provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ApplicationTypeResource object itself. + */ + public ApplicationTypeResource withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationTypeResourceList.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationTypeResourceList.java new file mode 100644 index 000000000000..a5068420c8e5 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationTypeResourceList.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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of application type names. + */ +public class ApplicationTypeResourceList { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ApplicationTypeResourceList object itself. + */ + public ApplicationTypeResourceList withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationTypes.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationTypes.java new file mode 100644 index 000000000000..00ada7a54c1a --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationTypes.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.servicefabric.v2017_07_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.ApplicationTypesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationTypes. + */ +public interface ApplicationTypes extends SupportsCreating, HasInner { + /** + * Returns all application type names in the specified cluster. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String apiVersion); + + /** + * Returns an application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion); + + /** + * Deletes the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion); + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationUpgradePolicy.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationUpgradePolicy.java new file mode 100644 index 000000000000..e0effd3ea29c --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ApplicationUpgradePolicy.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the policy for a monitored application upgrade. + */ +public class ApplicationUpgradePolicy { + /** + * The upgradeReplicaSetCheckTimeout property. + */ + @JsonProperty(value = "upgradeReplicaSetCheckTimeout") + private Long upgradeReplicaSetCheckTimeout; + + /** + * The forceRestart property. + */ + @JsonProperty(value = "forceRestart") + private Boolean forceRestart; + + /** + * The rollingUpgradeMonitoringPolicy property. + */ + @JsonProperty(value = "rollingUpgradeMonitoringPolicy") + private RollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy; + + /** + * The applicationHealthPolicy property. + */ + @JsonProperty(value = "applicationHealthPolicy") + private ApplicationHealthPolicy applicationHealthPolicy; + + /** + * Get the upgradeReplicaSetCheckTimeout value. + * + * @return the upgradeReplicaSetCheckTimeout value + */ + public Long upgradeReplicaSetCheckTimeout() { + return this.upgradeReplicaSetCheckTimeout; + } + + /** + * Set the upgradeReplicaSetCheckTimeout value. + * + * @param upgradeReplicaSetCheckTimeout the upgradeReplicaSetCheckTimeout value to set + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withUpgradeReplicaSetCheckTimeout(Long upgradeReplicaSetCheckTimeout) { + this.upgradeReplicaSetCheckTimeout = upgradeReplicaSetCheckTimeout; + return this; + } + + /** + * Get the forceRestart value. + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set the forceRestart value. + * + * @param forceRestart the forceRestart value to set + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get the rollingUpgradeMonitoringPolicy value. + * + * @return the rollingUpgradeMonitoringPolicy value + */ + public RollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy() { + return this.rollingUpgradeMonitoringPolicy; + } + + /** + * Set the rollingUpgradeMonitoringPolicy value. + * + * @param rollingUpgradeMonitoringPolicy the rollingUpgradeMonitoringPolicy value to set + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withRollingUpgradeMonitoringPolicy(RollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy) { + this.rollingUpgradeMonitoringPolicy = rollingUpgradeMonitoringPolicy; + return this; + } + + /** + * Get the applicationHealthPolicy value. + * + * @return the applicationHealthPolicy value + */ + public ApplicationHealthPolicy applicationHealthPolicy() { + return this.applicationHealthPolicy; + } + + /** + * Set the applicationHealthPolicy value. + * + * @param applicationHealthPolicy the applicationHealthPolicy value to set + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withApplicationHealthPolicy(ApplicationHealthPolicy applicationHealthPolicy) { + this.applicationHealthPolicy = applicationHealthPolicy; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Applications.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Applications.java new file mode 100644 index 000000000000..4bdf6467e9a8 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Applications.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.servicefabric.v2017_07_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.ApplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Applications. + */ +public interface Applications extends SupportsCreating, HasInner { + /** + * Returns all application resources in the specified cluster. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String apiVersion); + + /** + * Returns an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion); + + /** + * Deletes an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion); + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/AvailableOperationDisplay.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/AvailableOperationDisplay.java new file mode 100644 index 000000000000..eec19546a043 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/AvailableOperationDisplay.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation supported by Service Fabric resource provider. + */ +public class AvailableOperationDisplay { + /** + * The name of the provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation that can be performed. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name of the provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the name of the provider. + * + * @param provider the provider value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation that can be performed. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation that can be performed. + * + * @param operation the operation value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set operation description. + * + * @param description the description value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/AzureActiveDirectory.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/AzureActiveDirectory.java new file mode 100644 index 000000000000..32c918a6ede0 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/AzureActiveDirectory.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The settings to enable AAD authentication on the cluster. + */ +public class AzureActiveDirectory { + /** + * Azure active directory tenant id. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Azure active directory cluster application id. + */ + @JsonProperty(value = "clusterApplication") + private String clusterApplication; + + /** + * Azure active directory client application id. + */ + @JsonProperty(value = "clientApplication") + private String clientApplication; + + /** + * Get azure active directory tenant id. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set azure active directory tenant id. + * + * @param tenantId the tenantId value to set + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get azure active directory cluster application id. + * + * @return the clusterApplication value + */ + public String clusterApplication() { + return this.clusterApplication; + } + + /** + * Set azure active directory cluster application id. + * + * @param clusterApplication the clusterApplication value to set + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withClusterApplication(String clusterApplication) { + this.clusterApplication = clusterApplication; + return this; + } + + /** + * Get azure active directory client application id. + * + * @return the clientApplication value + */ + public String clientApplication() { + return this.clientApplication; + } + + /** + * Set azure active directory client application id. + * + * @param clientApplication the clientApplication value to set + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withClientApplication(String clientApplication) { + this.clientApplication = clientApplication; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/CertificateDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/CertificateDescription.java new file mode 100644 index 000000000000..a9ebd5aaa9ef --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/CertificateDescription.java @@ -0,0 +1,97 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the certificate details. + */ +public class CertificateDescription { + /** + * Thumbprint of the primary certificate. + */ + @JsonProperty(value = "thumbprint", required = true) + private String thumbprint; + + /** + * Thumbprint of the secondary certificate. + */ + @JsonProperty(value = "thumbprintSecondary") + private String thumbprintSecondary; + + /** + * The local certificate store location. Possible values include: + * 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', + * 'Root', 'TrustedPeople', 'TrustedPublisher'. + */ + @JsonProperty(value = "x509StoreName") + private String x509StoreName; + + /** + * Get thumbprint of the primary certificate. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set thumbprint of the primary certificate. + * + * @param thumbprint the thumbprint value to set + * @return the CertificateDescription object itself. + */ + public CertificateDescription withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get thumbprint of the secondary certificate. + * + * @return the thumbprintSecondary value + */ + public String thumbprintSecondary() { + return this.thumbprintSecondary; + } + + /** + * Set thumbprint of the secondary certificate. + * + * @param thumbprintSecondary the thumbprintSecondary value to set + * @return the CertificateDescription object itself. + */ + public CertificateDescription withThumbprintSecondary(String thumbprintSecondary) { + this.thumbprintSecondary = thumbprintSecondary; + return this; + } + + /** + * Get the local certificate store location. Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher'. + * + * @return the x509StoreName value + */ + public String x509StoreName() { + return this.x509StoreName; + } + + /** + * Set the local certificate store location. Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher'. + * + * @param x509StoreName the x509StoreName value to set + * @return the CertificateDescription object itself. + */ + public CertificateDescription withX509StoreName(String x509StoreName) { + this.x509StoreName = x509StoreName; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClientCertificateCommonName.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClientCertificateCommonName.java new file mode 100644 index 000000000000..4b192de9ce27 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClientCertificateCommonName.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the client certificate details using common name. + */ +public class ClientCertificateCommonName { + /** + * Indicates if the client certificate has admin access to the cluster. Non + * admin clients can perform only read only operations on the cluster. + */ + @JsonProperty(value = "isAdmin", required = true) + private boolean isAdmin; + + /** + * The common name of the client certificate. + */ + @JsonProperty(value = "certificateCommonName", required = true) + private String certificateCommonName; + + /** + * The issuer thumbprint of the client certificate. + */ + @JsonProperty(value = "certificateIssuerThumbprint", required = true) + private String certificateIssuerThumbprint; + + /** + * Get indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. + * + * @return the isAdmin value + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. + * + * @param isAdmin the isAdmin value to set + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withIsAdmin(boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get the common name of the client certificate. + * + * @return the certificateCommonName value + */ + public String certificateCommonName() { + return this.certificateCommonName; + } + + /** + * Set the common name of the client certificate. + * + * @param certificateCommonName the certificateCommonName value to set + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withCertificateCommonName(String certificateCommonName) { + this.certificateCommonName = certificateCommonName; + return this; + } + + /** + * Get the issuer thumbprint of the client certificate. + * + * @return the certificateIssuerThumbprint value + */ + public String certificateIssuerThumbprint() { + return this.certificateIssuerThumbprint; + } + + /** + * Set the issuer thumbprint of the client certificate. + * + * @param certificateIssuerThumbprint the certificateIssuerThumbprint value to set + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withCertificateIssuerThumbprint(String certificateIssuerThumbprint) { + this.certificateIssuerThumbprint = certificateIssuerThumbprint; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClientCertificateThumbprint.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClientCertificateThumbprint.java new file mode 100644 index 000000000000..7d8d6e03ada9 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClientCertificateThumbprint.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the client certificate details using thumbprint. + */ +public class ClientCertificateThumbprint { + /** + * Indicates if the client certificate has admin access to the cluster. Non + * admin clients can perform only read only operations on the cluster. + */ + @JsonProperty(value = "isAdmin", required = true) + private boolean isAdmin; + + /** + * The thumbprint of the client certificate. + */ + @JsonProperty(value = "certificateThumbprint", required = true) + private String certificateThumbprint; + + /** + * Get indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. + * + * @return the isAdmin value + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. + * + * @param isAdmin the isAdmin value to set + * @return the ClientCertificateThumbprint object itself. + */ + public ClientCertificateThumbprint withIsAdmin(boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get the thumbprint of the client certificate. + * + * @return the certificateThumbprint value + */ + public String certificateThumbprint() { + return this.certificateThumbprint; + } + + /** + * Set the thumbprint of the client certificate. + * + * @param certificateThumbprint the certificateThumbprint value to set + * @return the ClientCertificateThumbprint object itself. + */ + public ClientCertificateThumbprint withCertificateThumbprint(String certificateThumbprint) { + this.certificateThumbprint = certificateThumbprint; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Cluster.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Cluster.java new file mode 100644 index 000000000000..3c73b5bd92bd --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Cluster.java @@ -0,0 +1,528 @@ +/** + * 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.servicefabric.v2017_07_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.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.servicefabric.v2017_07_01_preview.implementation.ServiceFabricManager; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Updatable, HasManager { + /** + * @return the addOnFeatures value. + */ + List addOnFeatures(); + + /** + * @return the availableClusterVersions value. + */ + List availableClusterVersions(); + + /** + * @return the azureActiveDirectory value. + */ + AzureActiveDirectory azureActiveDirectory(); + + /** + * @return the certificate value. + */ + CertificateDescription certificate(); + + /** + * @return the clientCertificateCommonNames value. + */ + List clientCertificateCommonNames(); + + /** + * @return the clientCertificateThumbprints value. + */ + List clientCertificateThumbprints(); + + /** + * @return the clusterCodeVersion value. + */ + String clusterCodeVersion(); + + /** + * @return the clusterEndpoint value. + */ + String clusterEndpoint(); + + /** + * @return the clusterId value. + */ + String clusterId(); + + /** + * @return the clusterState value. + */ + String clusterState(); + + /** + * @return the diagnosticsStorageAccountConfig value. + */ + DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig(); + + /** + * @return the fabricSettings value. + */ + List fabricSettings(); + + /** + * @return the managementEndpoint value. + */ + String managementEndpoint(); + + /** + * @return the nodeTypes value. + */ + List nodeTypes(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the reliabilityLevel value. + */ + String reliabilityLevel(); + + /** + * @return the reverseProxyCertificate value. + */ + CertificateDescription reverseProxyCertificate(); + + /** + * @return the upgradeDescription value. + */ + ClusterUpgradePolicy upgradeDescription(); + + /** + * @return the upgradeMode value. + */ + String upgradeMode(); + + /** + * @return the vmImage value. + */ + String vmImage(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithApiVersion, DefinitionStages.WithManagementEndpoint, DefinitionStages.WithNodeTypes, 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 ApiVersion. + */ + interface WithApiVersion { + /** + * Specifies apiVersion. + * @param apiVersion The version of the API + * @return the next definition stage +*/ + WithManagementEndpoint withApiVersion(String apiVersion); + } + + /** + * The stage of the cluster definition allowing to specify ManagementEndpoint. + */ + interface WithManagementEndpoint { + /** + * Specifies managementEndpoint. + * @param managementEndpoint The http management endpoint of the cluster + * @return the next definition stage +*/ + WithNodeTypes withManagementEndpoint(String managementEndpoint); + } + + /** + * The stage of the cluster definition allowing to specify NodeTypes. + */ + interface WithNodeTypes { + /** + * Specifies nodeTypes. + * @param nodeTypes The list of node types in the cluster + * @return the next definition stage +*/ + WithCreate withNodeTypes(List nodeTypes); + } + + /** + * The stage of the cluster definition allowing to specify AddOnFeatures. + */ + interface WithAddOnFeatures { + /** + * Specifies addOnFeatures. + * @param addOnFeatures The list of add-on features to enable in the cluster + * @return the next definition stage + */ + WithCreate withAddOnFeatures(List addOnFeatures); + } + + /** + * The stage of the cluster definition allowing to specify AvailableClusterVersions. + */ + interface WithAvailableClusterVersions { + /** + * Specifies availableClusterVersions. + * @param availableClusterVersions The Service Fabric runtime versions available for this cluster + * @return the next definition stage + */ + WithCreate withAvailableClusterVersions(List availableClusterVersions); + } + + /** + * The stage of the cluster definition allowing to specify AzureActiveDirectory. + */ + interface WithAzureActiveDirectory { + /** + * Specifies azureActiveDirectory. + * @param azureActiveDirectory The AAD authentication settings of the cluster + * @return the next definition stage + */ + WithCreate withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory); + } + + /** + * The stage of the cluster definition allowing to specify Certificate. + */ + interface WithCertificate { + /** + * Specifies certificate. + * @param certificate The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client + * @return the next definition stage + */ + WithCreate withCertificate(CertificateDescription certificate); + } + + /** + * The stage of the cluster definition allowing to specify ClientCertificateCommonNames. + */ + interface WithClientCertificateCommonNames { + /** + * Specifies clientCertificateCommonNames. + * @param clientCertificateCommonNames The list of client certificates referenced by common name that are allowed to manage the cluster + * @return the next definition stage + */ + WithCreate withClientCertificateCommonNames(List clientCertificateCommonNames); + } + + /** + * The stage of the cluster definition allowing to specify ClientCertificateThumbprints. + */ + interface WithClientCertificateThumbprints { + /** + * Specifies clientCertificateThumbprints. + * @param clientCertificateThumbprints The list of client certificates referenced by thumbprint that are allowed to manage the cluster + * @return the next definition stage + */ + WithCreate withClientCertificateThumbprints(List clientCertificateThumbprints); + } + + /** + * The stage of the cluster definition allowing to specify ClusterCodeVersion. + */ + interface WithClusterCodeVersion { + /** + * Specifies clusterCodeVersion. + * @param clusterCodeVersion The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions** + * @return the next definition stage + */ + WithCreate withClusterCodeVersion(String clusterCodeVersion); + } + + /** + * The stage of the cluster definition allowing to specify ClusterState. + */ + interface WithClusterState { + /** + * Specifies clusterState. + * @param clusterState Possible values include: 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', 'UpdatingUserConfiguration', 'UpdatingUserCertificate', 'UpdatingInfrastructure', 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @return the next definition stage + */ + WithCreate withClusterState(String clusterState); + } + + /** + * The stage of the cluster definition allowing to specify DiagnosticsStorageAccountConfig. + */ + interface WithDiagnosticsStorageAccountConfig { + /** + * Specifies diagnosticsStorageAccountConfig. + * @param diagnosticsStorageAccountConfig The storage account information for storing Service Fabric diagnostic logs + * @return the next definition stage + */ + WithCreate withDiagnosticsStorageAccountConfig(DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig); + } + + /** + * The stage of the cluster definition allowing to specify FabricSettings. + */ + interface WithFabricSettings { + /** + * Specifies fabricSettings. + * @param fabricSettings The list of custom fabric settings to configure the cluster + * @return the next definition stage + */ + WithCreate withFabricSettings(List fabricSettings); + } + + /** + * The stage of the cluster definition allowing to specify ReliabilityLevel. + */ + interface WithReliabilityLevel { + /** + * Specifies reliabilityLevel. + * @param reliabilityLevel Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * @return the next definition stage + */ + WithCreate withReliabilityLevel(String reliabilityLevel); + } + + /** + * The stage of the cluster definition allowing to specify ReverseProxyCertificate. + */ + interface WithReverseProxyCertificate { + /** + * Specifies reverseProxyCertificate. + * @param reverseProxyCertificate The server certificate used by reverse proxy + * @return the next definition stage + */ + WithCreate withReverseProxyCertificate(CertificateDescription reverseProxyCertificate); + } + + /** + * The stage of the cluster definition allowing to specify UpgradeDescription. + */ + interface WithUpgradeDescription { + /** + * Specifies upgradeDescription. + * @param upgradeDescription The policy to use when upgrading the cluster + * @return the next definition stage + */ + WithCreate withUpgradeDescription(ClusterUpgradePolicy upgradeDescription); + } + + /** + * The stage of the cluster definition allowing to specify UpgradeMode. + */ + interface WithUpgradeMode { + /** + * Specifies upgradeMode. + * @param upgradeMode Possible values include: 'Automatic', 'Manual' + * @return the next definition stage + */ + WithCreate withUpgradeMode(String upgradeMode); + } + + /** + * The stage of the cluster definition allowing to specify VmImage. + */ + interface WithVmImage { + /** + * Specifies vmImage. + * @param vmImage The VM image VMSS has been configured with. Generic names such as Windows or Linux can be used + * @return the next definition stage + */ + WithCreate withVmImage(String vmImage); + } + + /** + * 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.WithAddOnFeatures, DefinitionStages.WithAvailableClusterVersions, DefinitionStages.WithAzureActiveDirectory, DefinitionStages.WithCertificate, DefinitionStages.WithClientCertificateCommonNames, DefinitionStages.WithClientCertificateThumbprints, DefinitionStages.WithClusterCodeVersion, DefinitionStages.WithClusterState, DefinitionStages.WithDiagnosticsStorageAccountConfig, DefinitionStages.WithFabricSettings, DefinitionStages.WithReliabilityLevel, DefinitionStages.WithReverseProxyCertificate, DefinitionStages.WithUpgradeDescription, DefinitionStages.WithUpgradeMode, DefinitionStages.WithVmImage { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithApiVersion, UpdateStages.WithAddOnFeatures, UpdateStages.WithCertificate, UpdateStages.WithClientCertificateCommonNames, UpdateStages.WithClientCertificateThumbprints, UpdateStages.WithClusterCodeVersion, UpdateStages.WithFabricSettings, UpdateStages.WithNodeTypes, UpdateStages.WithReliabilityLevel, UpdateStages.WithReverseProxyCertificate, UpdateStages.WithUpgradeDescription, UpdateStages.WithUpgradeMode { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify ApiVersion. + */ + interface WithApiVersion { + /** + * Specifies apiVersion. + * @param apiVersion The version of the API + * @return the next update stage + */ + Update withApiVersion(String apiVersion); + } + + /** + * The stage of the cluster update allowing to specify AddOnFeatures. + */ + interface WithAddOnFeatures { + /** + * Specifies addOnFeatures. + * @param addOnFeatures The list of add-on features to enable in the cluster + * @return the next update stage + */ + Update withAddOnFeatures(List addOnFeatures); + } + + /** + * The stage of the cluster update allowing to specify Certificate. + */ + interface WithCertificate { + /** + * Specifies certificate. + * @param certificate The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client + * @return the next update stage + */ + Update withCertificate(CertificateDescription certificate); + } + + /** + * The stage of the cluster update allowing to specify ClientCertificateCommonNames. + */ + interface WithClientCertificateCommonNames { + /** + * Specifies clientCertificateCommonNames. + * @param clientCertificateCommonNames The list of client certificates referenced by common name that are allowed to manage the cluster. This will overwrite the existing list + * @return the next update stage + */ + Update withClientCertificateCommonNames(List clientCertificateCommonNames); + } + + /** + * The stage of the cluster update allowing to specify ClientCertificateThumbprints. + */ + interface WithClientCertificateThumbprints { + /** + * Specifies clientCertificateThumbprints. + * @param clientCertificateThumbprints The list of client certificates referenced by thumbprint that are allowed to manage the cluster. This will overwrite the existing list + * @return the next update stage + */ + Update withClientCertificateThumbprints(List clientCertificateThumbprints); + } + + /** + * The stage of the cluster update allowing to specify ClusterCodeVersion. + */ + interface WithClusterCodeVersion { + /** + * Specifies clusterCodeVersion. + * @param clusterCodeVersion The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions** + * @return the next update stage + */ + Update withClusterCodeVersion(String clusterCodeVersion); + } + + /** + * The stage of the cluster update allowing to specify FabricSettings. + */ + interface WithFabricSettings { + /** + * Specifies fabricSettings. + * @param fabricSettings The list of custom fabric settings to configure the cluster. This will overwrite the existing list + * @return the next update stage + */ + Update withFabricSettings(List fabricSettings); + } + + /** + * The stage of the cluster update allowing to specify NodeTypes. + */ + interface WithNodeTypes { + /** + * Specifies nodeTypes. + * @param nodeTypes The list of node types in the cluster. This will overwrite the existing list + * @return the next update stage + */ + Update withNodeTypes(List nodeTypes); + } + + /** + * The stage of the cluster update allowing to specify ReliabilityLevel. + */ + interface WithReliabilityLevel { + /** + * Specifies reliabilityLevel. + * @param reliabilityLevel The reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). Possible values include: 'Bronze', 'Silver', 'Gold' + * @return the next update stage + */ + Update withReliabilityLevel(String reliabilityLevel); + } + + /** + * The stage of the cluster update allowing to specify ReverseProxyCertificate. + */ + interface WithReverseProxyCertificate { + /** + * Specifies reverseProxyCertificate. + * @param reverseProxyCertificate The server certificate used by reverse proxy + * @return the next update stage + */ + Update withReverseProxyCertificate(CertificateDescription reverseProxyCertificate); + } + + /** + * The stage of the cluster update allowing to specify UpgradeDescription. + */ + interface WithUpgradeDescription { + /** + * Specifies upgradeDescription. + * @param upgradeDescription The policy to use when upgrading the cluster + * @return the next update stage + */ + Update withUpgradeDescription(ClusterUpgradePolicy upgradeDescription); + } + + /** + * The stage of the cluster update allowing to specify UpgradeMode. + */ + interface WithUpgradeMode { + /** + * Specifies upgradeMode. + * @param upgradeMode The upgrade mode of the cluster. This indicates if the cluster should be automatically upgraded when new Service Fabric runtime version is available. Possible values include: 'Automatic', 'Manual' + * @return the next update stage + */ + Update withUpgradeMode(String upgradeMode); + } + + } +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterCodeVersionsListResult.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterCodeVersionsListResult.java new file mode 100644 index 000000000000..b13b32740725 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterCodeVersionsListResult.java @@ -0,0 +1,31 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.ClusterCodeVersionsListResultInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.ServiceFabricManager; +import java.util.List; + +/** + * Type representing ClusterCodeVersionsListResult. + */ +public interface ClusterCodeVersionsListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterCodeVersionsResult.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterCodeVersionsResult.java new file mode 100644 index 000000000000..b7a3793c0f8f --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterCodeVersionsResult.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The result of the ServiceFabric runtime versions. + */ +@JsonFlatten +public class ClusterCodeVersionsResult { + /** + * The identification of the result. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the result. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The result resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The Service Fabric runtime version of the cluster. + */ + @JsonProperty(value = "properties.codeVersion") + private String codeVersion; + + /** + * The date of expiry of support of the version. + */ + @JsonProperty(value = "properties.supportExpiryUtc") + private String supportExpiryUtc; + + /** + * Indicates if this version is for Windows or Linux operating system. + * Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.environment") + private String environment; + + /** + * Get the identification of the result. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the identification of the result. + * + * @param id the id value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the result. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the result. + * + * @param name the name value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the result resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the result resource type. + * + * @param type the type value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withType(String type) { + this.type = type; + return this; + } + + /** + * Get the Service Fabric runtime version of the cluster. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the Service Fabric runtime version of the cluster. + * + * @param codeVersion the codeVersion value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the date of expiry of support of the version. + * + * @return the supportExpiryUtc value + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the date of expiry of support of the version. + * + * @param supportExpiryUtc the supportExpiryUtc value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get indicates if this version is for Windows or Linux operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the environment value + */ + public String environment() { + return this.environment; + } + + /** + * Set indicates if this version is for Windows or Linux operating system. Possible values include: 'Windows', 'Linux'. + * + * @param environment the environment value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withEnvironment(String environment) { + this.environment = environment; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterHealthPolicy.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterHealthPolicy.java new file mode 100644 index 000000000000..75d09b5d9458 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterHealthPolicy.java @@ -0,0 +1,74 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a health policy used to evaluate the health of the cluster or of a + * cluster node. + */ +public class ClusterHealthPolicy { + /** + * The maximum allowed percentage of unhealthy nodes before reporting an + * error. For example, to allow 10% of nodes to be unhealthy, this value + * would be 10. + */ + @JsonProperty(value = "maxPercentUnhealthyNodes") + private Integer maxPercentUnhealthyNodes; + + /** + * The maximum allowed percentage of unhealthy applications before + * reporting an error. For example, to allow 10% of applications to be + * unhealthy, this value would be 10. + */ + @JsonProperty(value = "maxPercentUnhealthyApplications") + private Integer maxPercentUnhealthyApplications; + + /** + * Get the maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * @return the maxPercentUnhealthyNodes value + */ + public Integer maxPercentUnhealthyNodes() { + return this.maxPercentUnhealthyNodes; + } + + /** + * Set the maximum allowed percentage of unhealthy nodes before reporting an error. For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * @param maxPercentUnhealthyNodes the maxPercentUnhealthyNodes value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withMaxPercentUnhealthyNodes(Integer maxPercentUnhealthyNodes) { + this.maxPercentUnhealthyNodes = maxPercentUnhealthyNodes; + return this; + } + + /** + * Get the maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10. + * + * @return the maxPercentUnhealthyApplications value + */ + public Integer maxPercentUnhealthyApplications() { + return this.maxPercentUnhealthyApplications; + } + + /** + * Set the maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10. + * + * @param maxPercentUnhealthyApplications the maxPercentUnhealthyApplications value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withMaxPercentUnhealthyApplications(Integer maxPercentUnhealthyApplications) { + this.maxPercentUnhealthyApplications = maxPercentUnhealthyApplications; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterUpdateParameters.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterUpdateParameters.java new file mode 100644 index 000000000000..da91c788ad0d --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterUpdateParameters.java @@ -0,0 +1,348 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Cluster update request. + */ +@JsonFlatten +public class ClusterUpdateParameters { + /** + * The reliability level sets the replica set size of system services. + * Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * Possible values include: 'Bronze', 'Silver', 'Gold'. + */ + @JsonProperty(value = "properties.reliabilityLevel") + private String reliabilityLevel; + + /** + * The upgrade mode of the cluster. This indicates if the cluster should be + * automatically upgraded when new Service Fabric runtime version is + * available. Possible values include: 'Automatic', 'Manual'. + */ + @JsonProperty(value = "properties.upgradeMode") + private String upgradeMode; + + /** + * The Service Fabric runtime version of the cluster. This property can + * only by set the user when **upgradeMode** is set to 'Manual'. To get + * list of available Service Fabric versions for new clusters use + * [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /** + * The certificate to use for securing the cluster. The certificate + * provided will be used for node to node security within the cluster, SSL + * certificate for cluster management endpoint and default admin client. + */ + @JsonProperty(value = "properties.certificate") + private CertificateDescription certificate; + + /** + * The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. This will overwrite the existing list. + */ + @JsonProperty(value = "properties.clientCertificateThumbprints") + private List clientCertificateThumbprints; + + /** + * The list of client certificates referenced by common name that are + * allowed to manage the cluster. This will overwrite the existing list. + */ + @JsonProperty(value = "properties.clientCertificateCommonNames") + private List clientCertificateCommonNames; + + /** + * The list of custom fabric settings to configure the cluster. This will + * overwrite the existing list. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /** + * The server certificate used by reverse proxy. + */ + @JsonProperty(value = "properties.reverseProxyCertificate") + private CertificateDescription reverseProxyCertificate; + + /** + * The list of node types in the cluster. This will overwrite the existing + * list. + */ + @JsonProperty(value = "properties.nodeTypes") + private List nodeTypes; + + /** + * The policy to use when upgrading the cluster. + */ + @JsonProperty(value = "properties.upgradeDescription") + private ClusterUpgradePolicy upgradeDescription; + + /** + * The list of add-on features to enable in the cluster. + */ + @JsonProperty(value = "properties.addOnFeatures") + private List addOnFeatures; + + /** + * Cluster update parameters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). Possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @return the reliabilityLevel value + */ + public String reliabilityLevel() { + return this.reliabilityLevel; + } + + /** + * Set the reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). Possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @param reliabilityLevel the reliabilityLevel value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withReliabilityLevel(String reliabilityLevel) { + this.reliabilityLevel = reliabilityLevel; + return this; + } + + /** + * Get the upgrade mode of the cluster. This indicates if the cluster should be automatically upgraded when new Service Fabric runtime version is available. Possible values include: 'Automatic', 'Manual'. + * + * @return the upgradeMode value + */ + public String upgradeMode() { + return this.upgradeMode; + } + + /** + * Set the upgrade mode of the cluster. This indicates if the cluster should be automatically upgraded when new Service Fabric runtime version is available. Possible values include: 'Automatic', 'Manual'. + * + * @param upgradeMode the upgradeMode value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withUpgradeMode(String upgradeMode) { + this.upgradeMode = upgradeMode; + return this; + } + + /** + * Get the Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. + * + * @return the clusterCodeVersion value + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. + * + * @param clusterCodeVersion the clusterCodeVersion value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. + * + * @return the certificate value + */ + public CertificateDescription certificate() { + return this.certificate; + } + + /** + * Set the certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. + * + * @param certificate the certificate value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withCertificate(CertificateDescription certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get the list of client certificates referenced by thumbprint that are allowed to manage the cluster. This will overwrite the existing list. + * + * @return the clientCertificateThumbprints value + */ + public List clientCertificateThumbprints() { + return this.clientCertificateThumbprints; + } + + /** + * Set the list of client certificates referenced by thumbprint that are allowed to manage the cluster. This will overwrite the existing list. + * + * @param clientCertificateThumbprints the clientCertificateThumbprints value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClientCertificateThumbprints(List clientCertificateThumbprints) { + this.clientCertificateThumbprints = clientCertificateThumbprints; + return this; + } + + /** + * Get the list of client certificates referenced by common name that are allowed to manage the cluster. This will overwrite the existing list. + * + * @return the clientCertificateCommonNames value + */ + public List clientCertificateCommonNames() { + return this.clientCertificateCommonNames; + } + + /** + * Set the list of client certificates referenced by common name that are allowed to manage the cluster. This will overwrite the existing list. + * + * @param clientCertificateCommonNames the clientCertificateCommonNames value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClientCertificateCommonNames(List clientCertificateCommonNames) { + this.clientCertificateCommonNames = clientCertificateCommonNames; + return this; + } + + /** + * Get the list of custom fabric settings to configure the cluster. This will overwrite the existing list. + * + * @return the fabricSettings value + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the list of custom fabric settings to configure the cluster. This will overwrite the existing list. + * + * @param fabricSettings the fabricSettings value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the server certificate used by reverse proxy. + * + * @return the reverseProxyCertificate value + */ + public CertificateDescription reverseProxyCertificate() { + return this.reverseProxyCertificate; + } + + /** + * Set the server certificate used by reverse proxy. + * + * @param reverseProxyCertificate the reverseProxyCertificate value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + this.reverseProxyCertificate = reverseProxyCertificate; + return this; + } + + /** + * Get the list of node types in the cluster. This will overwrite the existing list. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of node types in the cluster. This will overwrite the existing list. + * + * @param nodeTypes the nodeTypes value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the policy to use when upgrading the cluster. + * + * @return the upgradeDescription value + */ + public ClusterUpgradePolicy upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set the policy to use when upgrading the cluster. + * + * @param upgradeDescription the upgradeDescription value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + + /** + * Get the list of add-on features to enable in the cluster. + * + * @return the addOnFeatures value + */ + public List addOnFeatures() { + return this.addOnFeatures; + } + + /** + * Set the list of add-on features to enable in the cluster. + * + * @param addOnFeatures the addOnFeatures value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withAddOnFeatures(List addOnFeatures) { + this.addOnFeatures = addOnFeatures; + return this; + } + + /** + * Get cluster update parameters. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set cluster update parameters. + * + * @param tags the tags value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterUpgradeDeltaHealthPolicy.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterUpgradeDeltaHealthPolicy.java new file mode 100644 index 000000000000..ee33b256b473 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterUpgradeDeltaHealthPolicy.java @@ -0,0 +1,112 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the delta health policies for the cluster upgrade. + */ +public class ClusterUpgradeDeltaHealthPolicy { + /** + * The maximum allowed percentage of nodes health degradation allowed + * during cluster upgrades. The delta is measured between the state of the + * nodes at the beginning of upgrade and the state of the nodes at the time + * of the health evaluation. The check is performed after every upgrade + * domain upgrade completion to make sure the global state of the cluster + * is within tolerated limits. + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyNodes", required = true) + private int maxPercentDeltaUnhealthyNodes; + + /** + * The maximum allowed percentage of upgrade domain nodes health + * degradation allowed during cluster upgrades. The delta is measured + * between the state of the upgrade domain nodes at the beginning of + * upgrade and the state of the upgrade domain nodes at the time of the + * health evaluation. The check is performed after every upgrade domain + * upgrade completion for all completed upgrade domains to make sure the + * state of the upgrade domains is within tolerated limits. + */ + @JsonProperty(value = "maxPercentUpgradeDomainDeltaUnhealthyNodes", required = true) + private int maxPercentUpgradeDomainDeltaUnhealthyNodes; + + /** + * The maximum allowed percentage of applications health degradation + * allowed during cluster upgrades. The delta is measured between the state + * of the applications at the beginning of upgrade and the state of the + * applications at the time of the health evaluation. The check is + * performed after every upgrade domain upgrade completion to make sure the + * global state of the cluster is within tolerated limits. System services + * are not included in this. + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyApplications", required = true) + private int maxPercentDeltaUnhealthyApplications; + + /** + * Get the maximum allowed percentage of nodes health degradation allowed during cluster upgrades. The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. + * + * @return the maxPercentDeltaUnhealthyNodes value + */ + public int maxPercentDeltaUnhealthyNodes() { + return this.maxPercentDeltaUnhealthyNodes; + } + + /** + * Set the maximum allowed percentage of nodes health degradation allowed during cluster upgrades. The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. + * + * @param maxPercentDeltaUnhealthyNodes the maxPercentDeltaUnhealthyNodes value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentDeltaUnhealthyNodes(int maxPercentDeltaUnhealthyNodes) { + this.maxPercentDeltaUnhealthyNodes = maxPercentDeltaUnhealthyNodes; + return this; + } + + /** + * Get the maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the state of the upgrade domains is within tolerated limits. + * + * @return the maxPercentUpgradeDomainDeltaUnhealthyNodes value + */ + public int maxPercentUpgradeDomainDeltaUnhealthyNodes() { + return this.maxPercentUpgradeDomainDeltaUnhealthyNodes; + } + + /** + * Set the maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the state of the upgrade domains is within tolerated limits. + * + * @param maxPercentUpgradeDomainDeltaUnhealthyNodes the maxPercentUpgradeDomainDeltaUnhealthyNodes value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentUpgradeDomainDeltaUnhealthyNodes(int maxPercentUpgradeDomainDeltaUnhealthyNodes) { + this.maxPercentUpgradeDomainDeltaUnhealthyNodes = maxPercentUpgradeDomainDeltaUnhealthyNodes; + return this; + } + + /** + * Get the maximum allowed percentage of applications health degradation allowed during cluster upgrades. The delta is measured between the state of the applications at the beginning of upgrade and the state of the applications at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. System services are not included in this. + * + * @return the maxPercentDeltaUnhealthyApplications value + */ + public int maxPercentDeltaUnhealthyApplications() { + return this.maxPercentDeltaUnhealthyApplications; + } + + /** + * Set the maximum allowed percentage of applications health degradation allowed during cluster upgrades. The delta is measured between the state of the applications at the beginning of upgrade and the state of the applications at the time of the health evaluation. The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. System services are not included in this. + * + * @param maxPercentDeltaUnhealthyApplications the maxPercentDeltaUnhealthyApplications value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentDeltaUnhealthyApplications(int maxPercentDeltaUnhealthyApplications) { + this.maxPercentDeltaUnhealthyApplications = maxPercentDeltaUnhealthyApplications; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterUpgradePolicy.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterUpgradePolicy.java new file mode 100644 index 000000000000..6cbe2e25d584 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterUpgradePolicy.java @@ -0,0 +1,268 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the policy used when upgrading the cluster. + */ +public class ClusterUpgradePolicy { + /** + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "forceRestart") + private Boolean forceRestart; + + /** + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed + * regardless of availability loss issues. The timeout is reset at the + * start of each upgrade domain. The timeout can be in either hh:mm:ss or + * in d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "upgradeReplicaSetCheckTimeout", required = true) + private String upgradeReplicaSetCheckTimeout; + + /** + * The length of time to wait after completing an upgrade domain before + * performing health checks. The duration can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "healthCheckWaitDuration", required = true) + private String healthCheckWaitDuration; + + /** + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. The duration can + * be in either hh:mm:ss or in d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "healthCheckStableDuration", required = true) + private String healthCheckStableDuration; + + /** + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before the upgrade rolls back. The timeout can be + * in either hh:mm:ss or in d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "healthCheckRetryTimeout", required = true) + private String healthCheckRetryTimeout; + + /** + * The amount of time the overall upgrade has to complete before the + * upgrade rolls back. The timeout can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "upgradeTimeout", required = true) + private String upgradeTimeout; + + /** + * The amount of time each upgrade domain has to complete before the + * upgrade rolls back. The timeout can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "upgradeDomainTimeout", required = true) + private String upgradeDomainTimeout; + + /** + * The cluster health policy used when upgrading the cluster. + */ + @JsonProperty(value = "healthPolicy", required = true) + private ClusterHealthPolicy healthPolicy; + + /** + * The delta health policy used when upgrading the cluster. + */ + @JsonProperty(value = "deltaHealthPolicy") + private ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy; + + /** + * Get if true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set if true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). + * + * @param forceRestart the forceRestart value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get the maximum amount of time to block processing of an upgrade domain and revent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the upgradeReplicaSetCheckTimeout value + */ + public String upgradeReplicaSetCheckTimeout() { + return this.upgradeReplicaSetCheckTimeout; + } + + /** + * Set the maximum amount of time to block processing of an upgrade domain and revent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param upgradeReplicaSetCheckTimeout the upgradeReplicaSetCheckTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeReplicaSetCheckTimeout(String upgradeReplicaSetCheckTimeout) { + this.upgradeReplicaSetCheckTimeout = upgradeReplicaSetCheckTimeout; + return this; + } + + /** + * Get the length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the healthCheckWaitDuration value + */ + public String healthCheckWaitDuration() { + return this.healthCheckWaitDuration; + } + + /** + * Set the length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param healthCheckWaitDuration the healthCheckWaitDuration value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckWaitDuration(String healthCheckWaitDuration) { + this.healthCheckWaitDuration = healthCheckWaitDuration; + return this; + } + + /** + * Get the amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the healthCheckStableDuration value + */ + public String healthCheckStableDuration() { + return this.healthCheckStableDuration; + } + + /** + * Set the amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param healthCheckStableDuration the healthCheckStableDuration value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckStableDuration(String healthCheckStableDuration) { + this.healthCheckStableDuration = healthCheckStableDuration; + return this; + } + + /** + * Get the amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the healthCheckRetryTimeout value + */ + public String healthCheckRetryTimeout() { + return this.healthCheckRetryTimeout; + } + + /** + * Set the amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param healthCheckRetryTimeout the healthCheckRetryTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckRetryTimeout(String healthCheckRetryTimeout) { + this.healthCheckRetryTimeout = healthCheckRetryTimeout; + return this; + } + + /** + * Get the amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the upgradeTimeout value + */ + public String upgradeTimeout() { + return this.upgradeTimeout; + } + + /** + * Set the amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param upgradeTimeout the upgradeTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeTimeout(String upgradeTimeout) { + this.upgradeTimeout = upgradeTimeout; + return this; + } + + /** + * Get the amount of time each upgrade domain has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the upgradeDomainTimeout value + */ + public String upgradeDomainTimeout() { + return this.upgradeDomainTimeout; + } + + /** + * Set the amount of time each upgrade domain has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param upgradeDomainTimeout the upgradeDomainTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeDomainTimeout(String upgradeDomainTimeout) { + this.upgradeDomainTimeout = upgradeDomainTimeout; + return this; + } + + /** + * Get the cluster health policy used when upgrading the cluster. + * + * @return the healthPolicy value + */ + public ClusterHealthPolicy healthPolicy() { + return this.healthPolicy; + } + + /** + * Set the cluster health policy used when upgrading the cluster. + * + * @param healthPolicy the healthPolicy value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthPolicy(ClusterHealthPolicy healthPolicy) { + this.healthPolicy = healthPolicy; + return this; + } + + /** + * Get the delta health policy used when upgrading the cluster. + * + * @return the deltaHealthPolicy value + */ + public ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy() { + return this.deltaHealthPolicy; + } + + /** + * Set the delta health policy used when upgrading the cluster. + * + * @param deltaHealthPolicy the deltaHealthPolicy value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withDeltaHealthPolicy(ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy) { + this.deltaHealthPolicy = deltaHealthPolicy; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterVersionDetails.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterVersionDetails.java new file mode 100644 index 000000000000..dbdfd0b55078 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterVersionDetails.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The detail of the Service Fabric runtime version result. + */ +public class ClusterVersionDetails { + /** + * The Service Fabric runtime version of the cluster. + */ + @JsonProperty(value = "codeVersion") + private String codeVersion; + + /** + * The date of expiry of support of the version. + */ + @JsonProperty(value = "supportExpiryUtc") + private String supportExpiryUtc; + + /** + * Indicates if this version is for Windows or Linux operating system. + * Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "environment") + private String environment; + + /** + * Get the Service Fabric runtime version of the cluster. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the Service Fabric runtime version of the cluster. + * + * @param codeVersion the codeVersion value to set + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the date of expiry of support of the version. + * + * @return the supportExpiryUtc value + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the date of expiry of support of the version. + * + * @param supportExpiryUtc the supportExpiryUtc value to set + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get indicates if this version is for Windows or Linux operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the environment value + */ + public String environment() { + return this.environment; + } + + /** + * Set indicates if this version is for Windows or Linux operating system. Possible values include: 'Windows', 'Linux'. + * + * @param environment the environment value to set + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withEnvironment(String environment) { + this.environment = environment; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterVersions.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterVersions.java new file mode 100644 index 000000000000..ca24ec70b7eb --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ClusterVersions.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.servicefabric.v2017_07_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.ClusterVersionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ClusterVersions. + */ +public interface ClusterVersions extends HasInner { + /** + * Get cluster code versions by environment. + * Get cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param subscriptionId The customer subscription identifier + * @param clusterVersion The cluster code version + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByEnvironmentAsync(String location, String environment, String subscriptionId, String clusterVersion, String apiVersion); + + /** + * List cluster code versions by location. + * List cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String location, String subscriptionId, String apiVersion); + + /** + * List cluster code versions by environment. + * List cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByEnvironmentAsync(String location, String environment, String subscriptionId, String apiVersion); + + /** + * Get cluster code versions. + * Get cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param subscriptionId The customer subscription identifier + * @param clusterVersion The cluster code version + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String location, String subscriptionId, String clusterVersion, String apiVersion); + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Clusters.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Clusters.java new file mode 100644 index 000000000000..a1b6acc158e7 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Clusters.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.servicefabric.v2017_07_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, HasInner { + /** + * Delete cluster resource. + * Delete cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion); + + /** + * Get cluster resource. + * Get cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion); + + /** + * List cluster resource by resource group. + * List cluster resource by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(String resourceGroupName, String subscriptionId, String apiVersion); + + /** + * List cluster resource. + * List cluster resource. + * + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String subscriptionId, String apiVersion); + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/DiagnosticsStorageAccountConfig.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/DiagnosticsStorageAccountConfig.java new file mode 100644 index 000000000000..63448db890da --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/DiagnosticsStorageAccountConfig.java @@ -0,0 +1,147 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage account information for storing Service Fabric diagnostic logs. + */ +public class DiagnosticsStorageAccountConfig { + /** + * The Azure storage account name. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /** + * The protected diagnostics storage key name. + */ + @JsonProperty(value = "protectedAccountKeyName", required = true) + private String protectedAccountKeyName; + + /** + * The blob endpoint of the azure storage account. + */ + @JsonProperty(value = "blobEndpoint", required = true) + private String blobEndpoint; + + /** + * The queue endpoint of the azure storage account. + */ + @JsonProperty(value = "queueEndpoint", required = true) + private String queueEndpoint; + + /** + * The table endpoint of the azure storage account. + */ + @JsonProperty(value = "tableEndpoint", required = true) + private String tableEndpoint; + + /** + * Get the Azure storage account name. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the Azure storage account name. + * + * @param storageAccountName the storageAccountName value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the protected diagnostics storage key name. + * + * @return the protectedAccountKeyName value + */ + public String protectedAccountKeyName() { + return this.protectedAccountKeyName; + } + + /** + * Set the protected diagnostics storage key name. + * + * @param protectedAccountKeyName the protectedAccountKeyName value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withProtectedAccountKeyName(String protectedAccountKeyName) { + this.protectedAccountKeyName = protectedAccountKeyName; + return this; + } + + /** + * Get the blob endpoint of the azure storage account. + * + * @return the blobEndpoint value + */ + public String blobEndpoint() { + return this.blobEndpoint; + } + + /** + * Set the blob endpoint of the azure storage account. + * + * @param blobEndpoint the blobEndpoint value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withBlobEndpoint(String blobEndpoint) { + this.blobEndpoint = blobEndpoint; + return this; + } + + /** + * Get the queue endpoint of the azure storage account. + * + * @return the queueEndpoint value + */ + public String queueEndpoint() { + return this.queueEndpoint; + } + + /** + * Set the queue endpoint of the azure storage account. + * + * @param queueEndpoint the queueEndpoint value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withQueueEndpoint(String queueEndpoint) { + this.queueEndpoint = queueEndpoint; + return this; + } + + /** + * Get the table endpoint of the azure storage account. + * + * @return the tableEndpoint value + */ + public String tableEndpoint() { + return this.tableEndpoint; + } + + /** + * Set the table endpoint of the azure storage account. + * + * @param tableEndpoint the tableEndpoint value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withTableEndpoint(String tableEndpoint) { + this.tableEndpoint = tableEndpoint; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/EndpointRangeDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/EndpointRangeDescription.java new file mode 100644 index 000000000000..3a66a9800aa7 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/EndpointRangeDescription.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Port range details. + */ +public class EndpointRangeDescription { + /** + * Starting port of a range of ports. + */ + @JsonProperty(value = "startPort", required = true) + private int startPort; + + /** + * End port of a range of ports. + */ + @JsonProperty(value = "endPort", required = true) + private int endPort; + + /** + * Get starting port of a range of ports. + * + * @return the startPort value + */ + public int startPort() { + return this.startPort; + } + + /** + * Set starting port of a range of ports. + * + * @param startPort the startPort value to set + * @return the EndpointRangeDescription object itself. + */ + public EndpointRangeDescription withStartPort(int startPort) { + this.startPort = startPort; + return this; + } + + /** + * Get end port of a range of ports. + * + * @return the endPort value + */ + public int endPort() { + return this.endPort; + } + + /** + * Set end port of a range of ports. + * + * @param endPort the endPort value to set + * @return the EndpointRangeDescription object itself. + */ + public EndpointRangeDescription withEndPort(int endPort) { + this.endPort = endPort; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ErrorModel.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ErrorModel.java new file mode 100644 index 000000000000..8989cacaaae3 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ErrorModel.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error details. + */ +public class ErrorModel { + /** + * 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 ErrorModel object itself. + */ + public ErrorModel 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 ErrorModel object itself. + */ + public ErrorModel withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ErrorModelException.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ErrorModelException.java new file mode 100644 index 000000000000..819a2d231527 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ErrorModelException.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.servicefabric.v2017_07_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorModel information. + */ +public class ErrorModelException extends RestException { + /** + * Initializes a new instance of the ErrorModelException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorModelException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorModelException 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 ErrorModelException(final String message, final Response response, final ErrorModel body) { + super(message, response, body); + } + + @Override + public ErrorModel body() { + return (ErrorModel) super.body(); + } +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/NamedPartitionSchemeDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/NamedPartitionSchemeDescription.java new file mode 100644 index 000000000000..359087d7f362 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/NamedPartitionSchemeDescription.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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the named partition scheme of the service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("Named") +public class NamedPartitionSchemeDescription extends PartitionSchemeDescription { + /** + * The number of partitions. + */ + @JsonProperty(value = "Count", required = true) + private int count; + + /** + * Array of size specified by the ‘Count’ parameter, for the names of the + * partitions. + */ + @JsonProperty(value = "Names", required = true) + private List names; + + /** + * Get the number of partitions. + * + * @return the count value + */ + public int count() { + return this.count; + } + + /** + * Set the number of partitions. + * + * @param count the count value to set + * @return the NamedPartitionSchemeDescription object itself. + */ + public NamedPartitionSchemeDescription withCount(int count) { + this.count = count; + return this; + } + + /** + * Get array of size specified by the ‘Count’ parameter, for the names of the partitions. + * + * @return the names value + */ + public List names() { + return this.names; + } + + /** + * Set array of size specified by the ‘Count’ parameter, for the names of the partitions. + * + * @param names the names value to set + * @return the NamedPartitionSchemeDescription object itself. + */ + public NamedPartitionSchemeDescription withNames(List names) { + this.names = names; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/NodeTypeDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/NodeTypeDescription.java new file mode 100644 index 000000000000..c8d7b2fd58f7 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/NodeTypeDescription.java @@ -0,0 +1,313 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a node type in the cluster, each node type represents sub set of + * nodes in the cluster. + */ +public class NodeTypeDescription { + /** + * The name of the node type. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The placement tags applied to nodes in the node type, which can be used + * to indicate where certain services (workload) should run. + */ + @JsonProperty(value = "placementProperties") + private Map placementProperties; + + /** + * The capacity tags applied to the nodes in the node type, the cluster + * resource manager uses these tags to understand how much resource a node + * has. + */ + @JsonProperty(value = "capacities") + private Map capacities; + + /** + * The TCP cluster management endpoint port. + */ + @JsonProperty(value = "clientConnectionEndpointPort", required = true) + private int clientConnectionEndpointPort; + + /** + * The HTTP cluster management endpoint port. + */ + @JsonProperty(value = "httpGatewayEndpointPort", required = true) + private int httpGatewayEndpointPort; + + /** + * Possible values include: 'Bronze', 'Silver', 'Gold'. + */ + @JsonProperty(value = "durabilityLevel") + private String durabilityLevel; + + /** + * The range of ports from which cluster assigned port to Service Fabric + * applications. + */ + @JsonProperty(value = "applicationPorts") + private EndpointRangeDescription applicationPorts; + + /** + * The range of empheral ports that nodes in this node type should be + * configured with. + */ + @JsonProperty(value = "ephemeralPorts") + private EndpointRangeDescription ephemeralPorts; + + /** + * The node type on which system services will run. Only one node type + * should be marked as primary. Primary node type cannot be deleted or + * changed for existing clusters. + */ + @JsonProperty(value = "isPrimary", required = true) + private boolean isPrimary; + + /** + * The number of nodes in the node type. This count should match the + * capacity property in the corresponding VirtualMachineScaleSet resource. + */ + @JsonProperty(value = "vmInstanceCount", required = true) + private int vmInstanceCount; + + /** + * The endpoint used by reverse proxy. + */ + @JsonProperty(value = "reverseProxyEndpointPort") + private Integer reverseProxyEndpointPort; + + /** + * Get the name of the node type. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the node type. + * + * @param name the name value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run. + * + * @return the placementProperties value + */ + public Map placementProperties() { + return this.placementProperties; + } + + /** + * Set the placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run. + * + * @param placementProperties the placementProperties value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withPlacementProperties(Map placementProperties) { + this.placementProperties = placementProperties; + return this; + } + + /** + * Get the capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much resource a node has. + * + * @return the capacities value + */ + public Map capacities() { + return this.capacities; + } + + /** + * Set the capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much resource a node has. + * + * @param capacities the capacities value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withCapacities(Map capacities) { + this.capacities = capacities; + return this; + } + + /** + * Get the TCP cluster management endpoint port. + * + * @return the clientConnectionEndpointPort value + */ + public int clientConnectionEndpointPort() { + return this.clientConnectionEndpointPort; + } + + /** + * Set the TCP cluster management endpoint port. + * + * @param clientConnectionEndpointPort the clientConnectionEndpointPort value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withClientConnectionEndpointPort(int clientConnectionEndpointPort) { + this.clientConnectionEndpointPort = clientConnectionEndpointPort; + return this; + } + + /** + * Get the HTTP cluster management endpoint port. + * + * @return the httpGatewayEndpointPort value + */ + public int httpGatewayEndpointPort() { + return this.httpGatewayEndpointPort; + } + + /** + * Set the HTTP cluster management endpoint port. + * + * @param httpGatewayEndpointPort the httpGatewayEndpointPort value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withHttpGatewayEndpointPort(int httpGatewayEndpointPort) { + this.httpGatewayEndpointPort = httpGatewayEndpointPort; + return this; + } + + /** + * Get possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @return the durabilityLevel value + */ + public String durabilityLevel() { + return this.durabilityLevel; + } + + /** + * Set possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @param durabilityLevel the durabilityLevel value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withDurabilityLevel(String durabilityLevel) { + this.durabilityLevel = durabilityLevel; + return this; + } + + /** + * Get the range of ports from which cluster assigned port to Service Fabric applications. + * + * @return the applicationPorts value + */ + public EndpointRangeDescription applicationPorts() { + return this.applicationPorts; + } + + /** + * Set the range of ports from which cluster assigned port to Service Fabric applications. + * + * @param applicationPorts the applicationPorts value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withApplicationPorts(EndpointRangeDescription applicationPorts) { + this.applicationPorts = applicationPorts; + return this; + } + + /** + * Get the range of empheral ports that nodes in this node type should be configured with. + * + * @return the ephemeralPorts value + */ + public EndpointRangeDescription ephemeralPorts() { + return this.ephemeralPorts; + } + + /** + * Set the range of empheral ports that nodes in this node type should be configured with. + * + * @param ephemeralPorts the ephemeralPorts value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withEphemeralPorts(EndpointRangeDescription ephemeralPorts) { + this.ephemeralPorts = ephemeralPorts; + return this; + } + + /** + * Get the node type on which system services will run. Only one node type should be marked as primary. Primary node type cannot be deleted or changed for existing clusters. + * + * @return the isPrimary value + */ + public boolean isPrimary() { + return this.isPrimary; + } + + /** + * Set the node type on which system services will run. Only one node type should be marked as primary. Primary node type cannot be deleted or changed for existing clusters. + * + * @param isPrimary the isPrimary value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withIsPrimary(boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get the number of nodes in the node type. This count should match the capacity property in the corresponding VirtualMachineScaleSet resource. + * + * @return the vmInstanceCount value + */ + public int vmInstanceCount() { + return this.vmInstanceCount; + } + + /** + * Set the number of nodes in the node type. This count should match the capacity property in the corresponding VirtualMachineScaleSet resource. + * + * @param vmInstanceCount the vmInstanceCount value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withVmInstanceCount(int vmInstanceCount) { + this.vmInstanceCount = vmInstanceCount; + return this; + } + + /** + * Get the endpoint used by reverse proxy. + * + * @return the reverseProxyEndpointPort value + */ + public Integer reverseProxyEndpointPort() { + return this.reverseProxyEndpointPort; + } + + /** + * Set the endpoint used by reverse proxy. + * + * @param reverseProxyEndpointPort the reverseProxyEndpointPort value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withReverseProxyEndpointPort(Integer reverseProxyEndpointPort) { + this.reverseProxyEndpointPort = reverseProxyEndpointPort; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/OperationResult.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/OperationResult.java new file mode 100644 index 000000000000..14852be75feb --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/OperationResult.java @@ -0,0 +1,40 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.ServiceFabricManager; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.OperationResultInner; + +/** + * Type representing OperationResult. + */ +public interface OperationResult extends HasInner, HasManager { + /** + * @return the display value. + */ + AvailableOperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the origin value. + */ + String origin(); + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Operations.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Operations.java new file mode 100644 index 000000000000..878ea0e58f4c --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Operations.java @@ -0,0 +1,28 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available ServiceFabric Resource Manager REST API operations. + * + * @param apiVersion The version of the ServiceFabric resouce provider api + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String apiVersion); + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/PartitionSchemeDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/PartitionSchemeDescription.java new file mode 100644 index 000000000000..4aecfe926931 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/PartitionSchemeDescription.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes how the service is partitioned. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("PartitionSchemeDescription") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Named", value = NamedPartitionSchemeDescription.class), + @JsonSubTypes.Type(name = "Singleton", value = SingletonPartitionSchemeDescription.class), + @JsonSubTypes.Type(name = "UniformInt64Range", value = UniformInt64RangePartitionSchemeDescription.class) +}) +public class PartitionSchemeDescription { +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ProvisioningState.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ProvisioningState.java new file mode 100644 index 000000000000..89b13f5d9c33 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ProvisioningState.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.servicefabric.v2017_07_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/RollingUpgradeMonitoringPolicy.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/RollingUpgradeMonitoringPolicy.java new file mode 100644 index 000000000000..0c2bdc8db265 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/RollingUpgradeMonitoringPolicy.java @@ -0,0 +1,147 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The policy used for monitoring the application upgrade. + */ +public class RollingUpgradeMonitoringPolicy { + /** + * The healthCheckWaitDuration property. + */ + @JsonProperty(value = "healthCheckWaitDuration") + private String healthCheckWaitDuration; + + /** + * The healthCheckStableDuration property. + */ + @JsonProperty(value = "healthCheckStableDuration") + private String healthCheckStableDuration; + + /** + * The healthCheckRetryTimeout property. + */ + @JsonProperty(value = "healthCheckRetryTimeout") + private String healthCheckRetryTimeout; + + /** + * The upgradeTimeout property. + */ + @JsonProperty(value = "upgradeTimeout") + private String upgradeTimeout; + + /** + * The upgradeDomainTimeout property. + */ + @JsonProperty(value = "upgradeDomainTimeout") + private String upgradeDomainTimeout; + + /** + * Get the healthCheckWaitDuration value. + * + * @return the healthCheckWaitDuration value + */ + public String healthCheckWaitDuration() { + return this.healthCheckWaitDuration; + } + + /** + * Set the healthCheckWaitDuration value. + * + * @param healthCheckWaitDuration the healthCheckWaitDuration value to set + * @return the RollingUpgradeMonitoringPolicy object itself. + */ + public RollingUpgradeMonitoringPolicy withHealthCheckWaitDuration(String healthCheckWaitDuration) { + this.healthCheckWaitDuration = healthCheckWaitDuration; + return this; + } + + /** + * Get the healthCheckStableDuration value. + * + * @return the healthCheckStableDuration value + */ + public String healthCheckStableDuration() { + return this.healthCheckStableDuration; + } + + /** + * Set the healthCheckStableDuration value. + * + * @param healthCheckStableDuration the healthCheckStableDuration value to set + * @return the RollingUpgradeMonitoringPolicy object itself. + */ + public RollingUpgradeMonitoringPolicy withHealthCheckStableDuration(String healthCheckStableDuration) { + this.healthCheckStableDuration = healthCheckStableDuration; + return this; + } + + /** + * Get the healthCheckRetryTimeout value. + * + * @return the healthCheckRetryTimeout value + */ + public String healthCheckRetryTimeout() { + return this.healthCheckRetryTimeout; + } + + /** + * Set the healthCheckRetryTimeout value. + * + * @param healthCheckRetryTimeout the healthCheckRetryTimeout value to set + * @return the RollingUpgradeMonitoringPolicy object itself. + */ + public RollingUpgradeMonitoringPolicy withHealthCheckRetryTimeout(String healthCheckRetryTimeout) { + this.healthCheckRetryTimeout = healthCheckRetryTimeout; + return this; + } + + /** + * Get the upgradeTimeout value. + * + * @return the upgradeTimeout value + */ + public String upgradeTimeout() { + return this.upgradeTimeout; + } + + /** + * Set the upgradeTimeout value. + * + * @param upgradeTimeout the upgradeTimeout value to set + * @return the RollingUpgradeMonitoringPolicy object itself. + */ + public RollingUpgradeMonitoringPolicy withUpgradeTimeout(String upgradeTimeout) { + this.upgradeTimeout = upgradeTimeout; + return this; + } + + /** + * Get the upgradeDomainTimeout value. + * + * @return the upgradeDomainTimeout value + */ + public String upgradeDomainTimeout() { + return this.upgradeDomainTimeout; + } + + /** + * Set the upgradeDomainTimeout value. + * + * @param upgradeDomainTimeout the upgradeDomainTimeout value to set + * @return the RollingUpgradeMonitoringPolicy object itself. + */ + public RollingUpgradeMonitoringPolicy withUpgradeDomainTimeout(String upgradeDomainTimeout) { + this.upgradeDomainTimeout = upgradeDomainTimeout; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceCorrelationDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceCorrelationDescription.java new file mode 100644 index 000000000000..a5c9d5b2dc75 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceCorrelationDescription.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Creates a particular correlation between services. + */ +public class ServiceCorrelationDescription { + /** + * Possible values include: 'Invalid', 'Affinity', 'AlignedAffinity', + * 'NonAlignedAffinity'. + */ + @JsonProperty(value = "Scheme", required = true) + private String scheme; + + /** + * The serviceName property. + */ + @JsonProperty(value = "ServiceName", required = true) + private String serviceName; + + /** + * Get possible values include: 'Invalid', 'Affinity', 'AlignedAffinity', 'NonAlignedAffinity'. + * + * @return the scheme value + */ + public String scheme() { + return this.scheme; + } + + /** + * Set possible values include: 'Invalid', 'Affinity', 'AlignedAffinity', 'NonAlignedAffinity'. + * + * @param scheme the scheme value to set + * @return the ServiceCorrelationDescription object itself. + */ + public ServiceCorrelationDescription withScheme(String scheme) { + this.scheme = scheme; + return this; + } + + /** + * Get the serviceName value. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName value. + * + * @param serviceName the serviceName value to set + * @return the ServiceCorrelationDescription object itself. + */ + public ServiceCorrelationDescription withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceLoadMetricDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceLoadMetricDescription.java new file mode 100644 index 000000000000..79ef78264cc3 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceLoadMetricDescription.java @@ -0,0 +1,154 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies a metric to load balance a service during runtime. + */ +public class ServiceLoadMetricDescription { + /** + * The name of the metric. If the service chooses to report load during + * runtime, the load metric name should match the name that is specified in + * Name exactly. Note that metric names are case sensitive. + */ + @JsonProperty(value = "Name", required = true) + private String name; + + /** + * Possible values include: 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "Weight") + private String weight; + + /** + * Used only for Stateful services. The default amount of load, as a + * number, that this service creates for this metric when it is a Primary + * replica. + */ + @JsonProperty(value = "PrimaryDefaultLoad") + private Integer primaryDefaultLoad; + + /** + * Used only for Stateful services. The default amount of load, as a + * number, that this service creates for this metric when it is a Secondary + * replica. + */ + @JsonProperty(value = "SecondaryDefaultLoad") + private Integer secondaryDefaultLoad; + + /** + * Used only for Stateless services. The default amount of load, as a + * number, that this service creates for this metric. + */ + @JsonProperty(value = "DefaultLoad") + private Integer defaultLoad; + + /** + * Get the name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the metric. If the service chooses to report load during runtime, the load metric name should match the name that is specified in Name exactly. Note that metric names are case sensitive. + * + * @param name the name value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @return the weight value + */ + public String weight() { + return this.weight; + } + + /** + * Set possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @param weight the weight value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withWeight(String weight) { + this.weight = weight; + return this; + } + + /** + * Get used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. + * + * @return the primaryDefaultLoad value + */ + public Integer primaryDefaultLoad() { + return this.primaryDefaultLoad; + } + + /** + * Set used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Primary replica. + * + * @param primaryDefaultLoad the primaryDefaultLoad value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withPrimaryDefaultLoad(Integer primaryDefaultLoad) { + this.primaryDefaultLoad = primaryDefaultLoad; + return this; + } + + /** + * Get used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. + * + * @return the secondaryDefaultLoad value + */ + public Integer secondaryDefaultLoad() { + return this.secondaryDefaultLoad; + } + + /** + * Set used only for Stateful services. The default amount of load, as a number, that this service creates for this metric when it is a Secondary replica. + * + * @param secondaryDefaultLoad the secondaryDefaultLoad value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withSecondaryDefaultLoad(Integer secondaryDefaultLoad) { + this.secondaryDefaultLoad = secondaryDefaultLoad; + return this; + } + + /** + * Get used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. + * + * @return the defaultLoad value + */ + public Integer defaultLoad() { + return this.defaultLoad; + } + + /** + * Set used only for Stateless services. The default amount of load, as a number, that this service creates for this metric. + * + * @param defaultLoad the defaultLoad value to set + * @return the ServiceLoadMetricDescription object itself. + */ + public ServiceLoadMetricDescription withDefaultLoad(Integer defaultLoad) { + this.defaultLoad = defaultLoad; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServicePlacementPolicyDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServicePlacementPolicyDescription.java new file mode 100644 index 000000000000..d79e84374e39 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServicePlacementPolicyDescription.java @@ -0,0 +1,20 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the policy to be used for placement of a Service Fabric service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Type") +@JsonTypeName("ServicePlacementPolicyDescription") +public class ServicePlacementPolicyDescription { +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceProperties.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceProperties.java new file mode 100644 index 000000000000..1fd1b031b2a7 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceProperties.java @@ -0,0 +1,94 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The service resource properties. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("ServiceProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceProperties.class), + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceProperties.class) +}) +public class ServiceProperties extends ServicePropertiesBase { + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the service type. + */ + @JsonProperty(value = "serviceTypeName") + private String serviceTypeName; + + /** + * The partitionDescription property. + */ + @JsonProperty(value = "partitionDescription") + private PartitionSchemeDescription partitionDescription; + + /** + * Get the current deployment or provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the service type. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set the name of the service type. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServiceProperties object itself. + */ + public ServiceProperties withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the partitionDescription value. + * + * @return the partitionDescription value + */ + public PartitionSchemeDescription partitionDescription() { + return this.partitionDescription; + } + + /** + * Set the partitionDescription value. + * + * @param partitionDescription the partitionDescription value to set + * @return the ServiceProperties object itself. + */ + public ServiceProperties withPartitionDescription(PartitionSchemeDescription partitionDescription) { + this.partitionDescription = partitionDescription; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServicePropertiesBase.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServicePropertiesBase.java new file mode 100644 index 000000000000..5b0dbbbe315e --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServicePropertiesBase.java @@ -0,0 +1,152 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The common service resource properties. + */ +public class ServicePropertiesBase { + /** + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "placementConstraints") + private String placementConstraints; + + /** + * The correlationScheme property. + */ + @JsonProperty(value = "correlationScheme") + private List correlationScheme; + + /** + * The serviceLoadMetrics property. + */ + @JsonProperty(value = "serviceLoadMetrics") + private List serviceLoadMetrics; + + /** + * The servicePlacementPolicies property. + */ + @JsonProperty(value = "servicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * Possible values include: 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "defaultMoveCost") + private String defaultMoveCost; + + /** + * Get the placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + * + * @param placementConstraints the placementConstraints value to set + * @return the ServicePropertiesBase object itself. + */ + public ServicePropertiesBase withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme value. + * + * @return the correlationScheme value + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme value. + * + * @param correlationScheme the correlationScheme value to set + * @return the ServicePropertiesBase object itself. + */ + public ServicePropertiesBase withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics value. + * + * @return the serviceLoadMetrics value + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics value. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set + * @return the ServicePropertiesBase object itself. + */ + public ServicePropertiesBase withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies value. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies value. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServicePropertiesBase object itself. + */ + public ServicePropertiesBase withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @return the defaultMoveCost value + */ + public String defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @param defaultMoveCost the defaultMoveCost value to set + * @return the ServicePropertiesBase object itself. + */ + public ServicePropertiesBase withDefaultMoveCost(String defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceResource.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceResource.java new file mode 100644 index 000000000000..3eafe7096077 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceResource.java @@ -0,0 +1,249 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The service resource. + */ +@JsonFlatten +public class ServiceResource extends ProxyResource { + /** + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "properties.placementConstraints") + private String placementConstraints; + + /** + * The correlationScheme property. + */ + @JsonProperty(value = "properties.correlationScheme") + private List correlationScheme; + + /** + * The serviceLoadMetrics property. + */ + @JsonProperty(value = "properties.serviceLoadMetrics") + private List serviceLoadMetrics; + + /** + * The servicePlacementPolicies property. + */ + @JsonProperty(value = "properties.servicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * Possible values include: 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "properties.defaultMoveCost") + private String defaultMoveCost; + + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the service type. + */ + @JsonProperty(value = "properties.serviceTypeName") + private String serviceTypeName; + + /** + * The partitionDescription property. + */ + @JsonProperty(value = "properties.partitionDescription") + private PartitionSchemeDescription partitionDescription; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + * + * @param placementConstraints the placementConstraints value to set + * @return the ServiceResource object itself. + */ + public ServiceResource withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme value. + * + * @return the correlationScheme value + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme value. + * + * @param correlationScheme the correlationScheme value to set + * @return the ServiceResource object itself. + */ + public ServiceResource withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics value. + * + * @return the serviceLoadMetrics value + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics value. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set + * @return the ServiceResource object itself. + */ + public ServiceResource withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies value. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies value. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServiceResource object itself. + */ + public ServiceResource withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @return the defaultMoveCost value + */ + public String defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @param defaultMoveCost the defaultMoveCost value to set + * @return the ServiceResource object itself. + */ + public ServiceResource withDefaultMoveCost(String defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + + /** + * Get the current deployment or provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the service type. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set the name of the service type. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServiceResource object itself. + */ + public ServiceResource withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the partitionDescription value. + * + * @return the partitionDescription value + */ + public PartitionSchemeDescription partitionDescription() { + return this.partitionDescription; + } + + /** + * Set the partitionDescription value. + * + * @param partitionDescription the partitionDescription value to set + * @return the ServiceResource object itself. + */ + public ServiceResource withPartitionDescription(PartitionSchemeDescription partitionDescription) { + this.partitionDescription = partitionDescription; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ServiceResource object itself. + */ + public ServiceResource withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceResourceList.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceResourceList.java new file mode 100644 index 000000000000..fba127f18acf --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceResourceList.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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of service resources. + */ +public class ServiceResourceList { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ServiceResourceList object itself. + */ + public ServiceResourceList withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceResourceUpdate.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceResourceUpdate.java new file mode 100644 index 000000000000..fe22fc845446 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceResourceUpdate.java @@ -0,0 +1,181 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The service resource for patch operations. + */ +@JsonFlatten +public class ServiceResourceUpdate extends ProxyResource { + /** + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "properties.placementConstraints") + private String placementConstraints; + + /** + * The correlationScheme property. + */ + @JsonProperty(value = "properties.correlationScheme") + private List correlationScheme; + + /** + * The serviceLoadMetrics property. + */ + @JsonProperty(value = "properties.serviceLoadMetrics") + private List serviceLoadMetrics; + + /** + * The servicePlacementPolicies property. + */ + @JsonProperty(value = "properties.servicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * Possible values include: 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "properties.defaultMoveCost") + private String defaultMoveCost; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + * + * @param placementConstraints the placementConstraints value to set + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme value. + * + * @return the correlationScheme value + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme value. + * + * @param correlationScheme the correlationScheme value to set + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics value. + * + * @return the serviceLoadMetrics value + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics value. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies value. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies value. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @return the defaultMoveCost value + */ + public String defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @param defaultMoveCost the defaultMoveCost value to set + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withDefaultMoveCost(String defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ServiceResourceUpdate object itself. + */ + public ServiceResourceUpdate withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceTypeDeltaHealthPolicy.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceTypeDeltaHealthPolicy.java new file mode 100644 index 000000000000..c8ce8ca0339d --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceTypeDeltaHealthPolicy.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service health policy. + */ +public class ServiceTypeDeltaHealthPolicy { + /** + * Maximum percentage of unhealthy services in cluster. + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyServices") + private Integer maxPercentDeltaUnhealthyServices; + + /** + * Get maximum percentage of unhealthy services in cluster. + * + * @return the maxPercentDeltaUnhealthyServices value + */ + public Integer maxPercentDeltaUnhealthyServices() { + return this.maxPercentDeltaUnhealthyServices; + } + + /** + * Set maximum percentage of unhealthy services in cluster. + * + * @param maxPercentDeltaUnhealthyServices the maxPercentDeltaUnhealthyServices value to set + * @return the ServiceTypeDeltaHealthPolicy object itself. + */ + public ServiceTypeDeltaHealthPolicy withMaxPercentDeltaUnhealthyServices(Integer maxPercentDeltaUnhealthyServices) { + this.maxPercentDeltaUnhealthyServices = maxPercentDeltaUnhealthyServices; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceTypeHealthPolicy.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceTypeHealthPolicy.java new file mode 100644 index 000000000000..d89da32f6e3d --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceTypeHealthPolicy.java @@ -0,0 +1,151 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health policy used to evaluate the health of services + * belonging to a service type. + */ +public class ServiceTypeHealthPolicy { + /** + * The maximum allowed percentage of unhealthy partitions per service. + * Allowed values are Byte values from zero to 100 + * + * The percentage represents the maximum tolerated percentage of partitions + * that can be unhealthy before the service is considered in error. + * If the percentage is respected but there is at least one unhealthy + * partition, the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy + * partitions over the total number of partitions in the service. + * The computation rounds up to tolerate one failure on small numbers of + * partitions. Default percentage is zero. + */ + @JsonProperty(value = "MaxPercentUnhealthyPartitionsPerService") + private Integer maxPercentUnhealthyPartitionsPerService; + + /** + * The maximum allowed percentage of unhealthy replicas per partition. + * Allowed values are Byte values from zero to 100. + * + * The percentage represents the maximum tolerated percentage of replicas + * that can be unhealthy before the partition is considered in error. + * If the percentage is respected but there is at least one unhealthy + * replica, the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy + * replicas over the total number of replicas in the partition. + * The computation rounds up to tolerate one failure on small numbers of + * replicas. Default percentage is zero. + */ + @JsonProperty(value = "MaxPercentUnhealthyReplicasPerPartition") + private Integer maxPercentUnhealthyReplicasPerPartition; + + /** + * The maximum maximum allowed percentage of unhealthy services. Allowed + * values are Byte values from zero to 100. + * + * The percentage represents the maximum tolerated percentage of services + * that can be unhealthy before the application is considered in error. + * If the percentage is respected but there is at least one unhealthy + * service, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy services of the + * specific service type over the total number of services of the specific + * service type. + * The computation rounds up to tolerate one failure on small numbers of + * services. Default percentage is zero. + */ + @JsonProperty(value = "MaxPercentUnhealthyServices") + private Integer maxPercentUnhealthyServices; + + /** + * Get the maximum allowed percentage of unhealthy partitions per service. Allowed values are Byte values from zero to 100 + The percentage represents the maximum tolerated percentage of partitions that can be unhealthy before the service is considered in error. + If the percentage is respected but there is at least one unhealthy partition, the health is evaluated as Warning. + The percentage is calculated by dividing the number of unhealthy partitions over the total number of partitions in the service. + The computation rounds up to tolerate one failure on small numbers of partitions. Default percentage is zero. + * + * @return the maxPercentUnhealthyPartitionsPerService value + */ + public Integer maxPercentUnhealthyPartitionsPerService() { + return this.maxPercentUnhealthyPartitionsPerService; + } + + /** + * Set the maximum allowed percentage of unhealthy partitions per service. Allowed values are Byte values from zero to 100 + The percentage represents the maximum tolerated percentage of partitions that can be unhealthy before the service is considered in error. + If the percentage is respected but there is at least one unhealthy partition, the health is evaluated as Warning. + The percentage is calculated by dividing the number of unhealthy partitions over the total number of partitions in the service. + The computation rounds up to tolerate one failure on small numbers of partitions. Default percentage is zero. + * + * @param maxPercentUnhealthyPartitionsPerService the maxPercentUnhealthyPartitionsPerService value to set + * @return the ServiceTypeHealthPolicy object itself. + */ + public ServiceTypeHealthPolicy withMaxPercentUnhealthyPartitionsPerService(Integer maxPercentUnhealthyPartitionsPerService) { + this.maxPercentUnhealthyPartitionsPerService = maxPercentUnhealthyPartitionsPerService; + return this; + } + + /** + * Get the maximum allowed percentage of unhealthy replicas per partition. Allowed values are Byte values from zero to 100. + The percentage represents the maximum tolerated percentage of replicas that can be unhealthy before the partition is considered in error. + If the percentage is respected but there is at least one unhealthy replica, the health is evaluated as Warning. + The percentage is calculated by dividing the number of unhealthy replicas over the total number of replicas in the partition. + The computation rounds up to tolerate one failure on small numbers of replicas. Default percentage is zero. + * + * @return the maxPercentUnhealthyReplicasPerPartition value + */ + public Integer maxPercentUnhealthyReplicasPerPartition() { + return this.maxPercentUnhealthyReplicasPerPartition; + } + + /** + * Set the maximum allowed percentage of unhealthy replicas per partition. Allowed values are Byte values from zero to 100. + The percentage represents the maximum tolerated percentage of replicas that can be unhealthy before the partition is considered in error. + If the percentage is respected but there is at least one unhealthy replica, the health is evaluated as Warning. + The percentage is calculated by dividing the number of unhealthy replicas over the total number of replicas in the partition. + The computation rounds up to tolerate one failure on small numbers of replicas. Default percentage is zero. + * + * @param maxPercentUnhealthyReplicasPerPartition the maxPercentUnhealthyReplicasPerPartition value to set + * @return the ServiceTypeHealthPolicy object itself. + */ + public ServiceTypeHealthPolicy withMaxPercentUnhealthyReplicasPerPartition(Integer maxPercentUnhealthyReplicasPerPartition) { + this.maxPercentUnhealthyReplicasPerPartition = maxPercentUnhealthyReplicasPerPartition; + return this; + } + + /** + * Get the maximum maximum allowed percentage of unhealthy services. Allowed values are Byte values from zero to 100. + The percentage represents the maximum tolerated percentage of services that can be unhealthy before the application is considered in error. + If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. + This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type. + The computation rounds up to tolerate one failure on small numbers of services. Default percentage is zero. + * + * @return the maxPercentUnhealthyServices value + */ + public Integer maxPercentUnhealthyServices() { + return this.maxPercentUnhealthyServices; + } + + /** + * Set the maximum maximum allowed percentage of unhealthy services. Allowed values are Byte values from zero to 100. + The percentage represents the maximum tolerated percentage of services that can be unhealthy before the application is considered in error. + If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. + This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type. + The computation rounds up to tolerate one failure on small numbers of services. Default percentage is zero. + * + * @param maxPercentUnhealthyServices the maxPercentUnhealthyServices value to set + * @return the ServiceTypeHealthPolicy object itself. + */ + public ServiceTypeHealthPolicy withMaxPercentUnhealthyServices(Integer maxPercentUnhealthyServices) { + this.maxPercentUnhealthyServices = maxPercentUnhealthyServices; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceTypeHealthPolicyMapItem.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceTypeHealthPolicyMapItem.java new file mode 100644 index 000000000000..4f66a28a5d39 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceTypeHealthPolicyMapItem.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines an item in ServiceTypeHealthPolicyMap. + */ +public class ServiceTypeHealthPolicyMapItem { + /** + * The key of the service type health policy map item. This is the name of + * the service type. + */ + @JsonProperty(value = "Key", required = true) + private String key; + + /** + * The value property. + */ + @JsonProperty(value = "Value", required = true) + private ServiceTypeHealthPolicy value; + + /** + * Get the key of the service type health policy map item. This is the name of the service type. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the key of the service type health policy map item. This is the name of the service type. + * + * @param key the key value to set + * @return the ServiceTypeHealthPolicyMapItem object itself. + */ + public ServiceTypeHealthPolicyMapItem withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public ServiceTypeHealthPolicy value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ServiceTypeHealthPolicyMapItem object itself. + */ + public ServiceTypeHealthPolicyMapItem withValue(ServiceTypeHealthPolicy value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceUpdateProperties.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceUpdateProperties.java new file mode 100644 index 000000000000..58cd08d187b4 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/ServiceUpdateProperties.java @@ -0,0 +1,25 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The service resource properties for patch operations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("ServiceUpdateProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceUpdateProperties.class), + @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceUpdateProperties.class) +}) +public class ServiceUpdateProperties extends ServicePropertiesBase { +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Services.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Services.java new file mode 100644 index 000000000000..2f155fe737ac --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Services.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.servicefabric.v2017_07_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.ServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Services. + */ +public interface Services extends SupportsCreating, HasInner { + /** + * Returns all service resources in the specified application. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion); + + /** + * Returns a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion); + + /** + * Deletes a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion); + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/SettingsParameterDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/SettingsParameterDescription.java new file mode 100644 index 000000000000..88de8af993e8 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/SettingsParameterDescription.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a parameter in fabric settings of the cluster. + */ +public class SettingsParameterDescription { + /** + * The parameter name of fabric setting. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The parameter value of fabric setting. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the parameter name of fabric setting. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the parameter name of fabric setting. + * + * @param name the name value to set + * @return the SettingsParameterDescription object itself. + */ + public SettingsParameterDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the parameter value of fabric setting. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the parameter value of fabric setting. + * + * @param value the value value to set + * @return the SettingsParameterDescription object itself. + */ + public SettingsParameterDescription withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/SettingsSectionDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/SettingsSectionDescription.java new file mode 100644 index 000000000000..36bf20922260 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/SettingsSectionDescription.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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a section in the fabric settings of the cluster. + */ +public class SettingsSectionDescription { + /** + * The section name of the fabric settings. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The collection of parameters in the section. + */ + @JsonProperty(value = "parameters", required = true) + private List parameters; + + /** + * Get the section name of the fabric settings. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the section name of the fabric settings. + * + * @param name the name value to set + * @return the SettingsSectionDescription object itself. + */ + public SettingsSectionDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the collection of parameters in the section. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the collection of parameters in the section. + * + * @param parameters the parameters value to set + * @return the SettingsSectionDescription object itself. + */ + public SettingsSectionDescription withParameters(List parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/SingletonPartitionSchemeDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/SingletonPartitionSchemeDescription.java new file mode 100644 index 000000000000..72aa0373d89f --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/SingletonPartitionSchemeDescription.java @@ -0,0 +1,21 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the partition scheme of a singleton-partitioned, or + * non-partitioned service. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("Singleton") +public class SingletonPartitionSchemeDescription extends PartitionSchemeDescription { +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatefulServiceProperties.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatefulServiceProperties.java new file mode 100644 index 000000000000..f35c89abbbf4 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatefulServiceProperties.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.servicefabric.v2017_07_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a stateful service resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateful") +public class StatefulServiceProperties extends ServiceProperties { + /** + * A flag indicating whether this is a persistent service which stores + * states on the local disk. If it is then the value of this property is + * true, if not it is false. + */ + @JsonProperty(value = "hasPersistedState") + private Boolean hasPersistedState; + + /** + * The target replica set size as a number. + */ + @JsonProperty(value = "targetReplicaSetSize") + private Integer targetReplicaSetSize; + + /** + * The minimum replica set size as a number. + */ + @JsonProperty(value = "minReplicaSetSize") + private Integer minReplicaSetSize; + + /** + * The duration between when a replica goes down and when a new replica is + * created, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "replicaRestartWaitDuration") + private DateTime replicaRestartWaitDuration; + + /** + * The maximum duration for which a partition is allowed to be in a state + * of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "quorumLossWaitDuration") + private DateTime quorumLossWaitDuration; + + /** + * The definition on how long StandBy replicas should be maintained before + * being removed, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "standByReplicaKeepDuration") + private DateTime standByReplicaKeepDuration; + + /** + * Get a flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. + * + * @return the hasPersistedState value + */ + public Boolean hasPersistedState() { + return this.hasPersistedState; + } + + /** + * Set a flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. + * + * @param hasPersistedState the hasPersistedState value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withHasPersistedState(Boolean hasPersistedState) { + this.hasPersistedState = hasPersistedState; + return this; + } + + /** + * Get the target replica set size as a number. + * + * @return the targetReplicaSetSize value + */ + public Integer targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set the target replica set size as a number. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withTargetReplicaSetSize(Integer targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get the minimum replica set size as a number. + * + * @return the minReplicaSetSize value + */ + public Integer minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set the minimum replica set size as a number. + * + * @param minReplicaSetSize the minReplicaSetSize value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withMinReplicaSetSize(Integer minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get the duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the replicaRestartWaitDuration value + */ + public DateTime replicaRestartWaitDuration() { + return this.replicaRestartWaitDuration; + } + + /** + * Set the duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param replicaRestartWaitDuration the replicaRestartWaitDuration value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withReplicaRestartWaitDuration(DateTime replicaRestartWaitDuration) { + this.replicaRestartWaitDuration = replicaRestartWaitDuration; + return this; + } + + /** + * Get the maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the quorumLossWaitDuration value + */ + public DateTime quorumLossWaitDuration() { + return this.quorumLossWaitDuration; + } + + /** + * Set the maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param quorumLossWaitDuration the quorumLossWaitDuration value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withQuorumLossWaitDuration(DateTime quorumLossWaitDuration) { + this.quorumLossWaitDuration = quorumLossWaitDuration; + return this; + } + + /** + * Get the definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the standByReplicaKeepDuration value + */ + public DateTime standByReplicaKeepDuration() { + return this.standByReplicaKeepDuration; + } + + /** + * Set the definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param standByReplicaKeepDuration the standByReplicaKeepDuration value to set + * @return the StatefulServiceProperties object itself. + */ + public StatefulServiceProperties withStandByReplicaKeepDuration(DateTime standByReplicaKeepDuration) { + this.standByReplicaKeepDuration = standByReplicaKeepDuration; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatefulServiceUpdateProperties.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatefulServiceUpdateProperties.java new file mode 100644 index 000000000000..2cac5591737a --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatefulServiceUpdateProperties.java @@ -0,0 +1,155 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a stateful service resource for patch operations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateful") +public class StatefulServiceUpdateProperties extends ServiceUpdateProperties { + /** + * The target replica set size as a number. + */ + @JsonProperty(value = "targetReplicaSetSize") + private Integer targetReplicaSetSize; + + /** + * The minimum replica set size as a number. + */ + @JsonProperty(value = "minReplicaSetSize") + private Integer minReplicaSetSize; + + /** + * The duration between when a replica goes down and when a new replica is + * created, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "replicaRestartWaitDuration") + private DateTime replicaRestartWaitDuration; + + /** + * The maximum duration for which a partition is allowed to be in a state + * of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "quorumLossWaitDuration") + private DateTime quorumLossWaitDuration; + + /** + * The definition on how long StandBy replicas should be maintained before + * being removed, represented in ISO 8601 format (hh:mm:ss.s). + */ + @JsonProperty(value = "standByReplicaKeepDuration") + private DateTime standByReplicaKeepDuration; + + /** + * Get the target replica set size as a number. + * + * @return the targetReplicaSetSize value + */ + public Integer targetReplicaSetSize() { + return this.targetReplicaSetSize; + } + + /** + * Set the target replica set size as a number. + * + * @param targetReplicaSetSize the targetReplicaSetSize value to set + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withTargetReplicaSetSize(Integer targetReplicaSetSize) { + this.targetReplicaSetSize = targetReplicaSetSize; + return this; + } + + /** + * Get the minimum replica set size as a number. + * + * @return the minReplicaSetSize value + */ + public Integer minReplicaSetSize() { + return this.minReplicaSetSize; + } + + /** + * Set the minimum replica set size as a number. + * + * @param minReplicaSetSize the minReplicaSetSize value to set + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withMinReplicaSetSize(Integer minReplicaSetSize) { + this.minReplicaSetSize = minReplicaSetSize; + return this; + } + + /** + * Get the duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the replicaRestartWaitDuration value + */ + public DateTime replicaRestartWaitDuration() { + return this.replicaRestartWaitDuration; + } + + /** + * Set the duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param replicaRestartWaitDuration the replicaRestartWaitDuration value to set + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withReplicaRestartWaitDuration(DateTime replicaRestartWaitDuration) { + this.replicaRestartWaitDuration = replicaRestartWaitDuration; + return this; + } + + /** + * Get the maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the quorumLossWaitDuration value + */ + public DateTime quorumLossWaitDuration() { + return this.quorumLossWaitDuration; + } + + /** + * Set the maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param quorumLossWaitDuration the quorumLossWaitDuration value to set + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withQuorumLossWaitDuration(DateTime quorumLossWaitDuration) { + this.quorumLossWaitDuration = quorumLossWaitDuration; + return this; + } + + /** + * Get the definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). + * + * @return the standByReplicaKeepDuration value + */ + public DateTime standByReplicaKeepDuration() { + return this.standByReplicaKeepDuration; + } + + /** + * Set the definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format (hh:mm:ss.s). + * + * @param standByReplicaKeepDuration the standByReplicaKeepDuration value to set + * @return the StatefulServiceUpdateProperties object itself. + */ + public StatefulServiceUpdateProperties withStandByReplicaKeepDuration(DateTime standByReplicaKeepDuration) { + this.standByReplicaKeepDuration = standByReplicaKeepDuration; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatelessServiceProperties.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatelessServiceProperties.java new file mode 100644 index 000000000000..b5f25297a007 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatelessServiceProperties.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a stateless service resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateless") +public class StatelessServiceProperties extends ServiceProperties { + /** + * The instance count. + */ + @JsonProperty(value = "instanceCount") + private Integer instanceCount; + + /** + * Get the instance count. + * + * @return the instanceCount value + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instance count. + * + * @param instanceCount the instanceCount value to set + * @return the StatelessServiceProperties object itself. + */ + public StatelessServiceProperties withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatelessServiceUpdateProperties.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatelessServiceUpdateProperties.java new file mode 100644 index 000000000000..037ba4d5235e --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/StatelessServiceUpdateProperties.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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a stateless service resource for patch operations. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "serviceKind") +@JsonTypeName("Stateless") +public class StatelessServiceUpdateProperties extends ServiceUpdateProperties { + /** + * The instance count. + */ + @JsonProperty(value = "instanceCount") + private Integer instanceCount; + + /** + * Get the instance count. + * + * @return the instanceCount value + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Set the instance count. + * + * @param instanceCount the instanceCount value to set + * @return the StatelessServiceUpdateProperties object itself. + */ + public StatelessServiceUpdateProperties withInstanceCount(Integer instanceCount) { + this.instanceCount = instanceCount; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/UniformInt64RangePartitionSchemeDescription.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/UniformInt64RangePartitionSchemeDescription.java new file mode 100644 index 000000000000..dcca51dc3cab --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/UniformInt64RangePartitionSchemeDescription.java @@ -0,0 +1,106 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes a partitioning scheme where an integer range is allocated evenly + * across a number of partitions. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "PartitionScheme") +@JsonTypeName("UniformInt64Range") +public class UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescription { + /** + * The number of partitions. + */ + @JsonProperty(value = "Count", required = true) + private int count; + + /** + * String indicating the lower bound of the partition key range that + * should be split between the partition ‘Count’. + */ + @JsonProperty(value = "LowKey", required = true) + private String lowKey; + + /** + * String indicating the upper bound of the partition key range that + * should be split between the partition ‘Count’. + */ + @JsonProperty(value = "HighKey", required = true) + private String highKey; + + /** + * Get the number of partitions. + * + * @return the count value + */ + public int count() { + return this.count; + } + + /** + * Set the number of partitions. + * + * @param count the count value to set + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withCount(int count) { + this.count = count; + return this; + } + + /** + * Get string indicating the lower bound of the partition key range that + should be split between the partition ‘Count’. + * + * @return the lowKey value + */ + public String lowKey() { + return this.lowKey; + } + + /** + * Set string indicating the lower bound of the partition key range that + should be split between the partition ‘Count’. + * + * @param lowKey the lowKey value to set + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withLowKey(String lowKey) { + this.lowKey = lowKey; + return this; + } + + /** + * Get string indicating the upper bound of the partition key range that + should be split between the partition ‘Count’. + * + * @return the highKey value + */ + public String highKey() { + return this.highKey; + } + + /** + * Set string indicating the upper bound of the partition key range that + should be split between the partition ‘Count’. + * + * @param highKey the highKey value to set + * @return the UniformInt64RangePartitionSchemeDescription object itself. + */ + public UniformInt64RangePartitionSchemeDescription withHighKey(String highKey) { + this.highKey = highKey; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/VersionResource.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/VersionResource.java new file mode 100644 index 000000000000..e7e84552e686 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/VersionResource.java @@ -0,0 +1,104 @@ +/** + * 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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A version resource for the specified application type name. + */ +@JsonFlatten +public class VersionResource extends ProxyResource { + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The URL to the application package. + */ + @JsonProperty(value = "properties.appPackageUrl", required = true) + private String appPackageUrl; + + /** + * The defaultParameterList property. + */ + @JsonProperty(value = "properties.defaultParameterList", access = JsonProperty.Access.WRITE_ONLY) + private List defaultParameterList; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the current deployment or provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the URL to the application package. + * + * @return the appPackageUrl value + */ + public String appPackageUrl() { + return this.appPackageUrl; + } + + /** + * Set the URL to the application package. + * + * @param appPackageUrl the appPackageUrl value to set + * @return the VersionResource object itself. + */ + public VersionResource withAppPackageUrl(String appPackageUrl) { + this.appPackageUrl = appPackageUrl; + return this; + } + + /** + * Get the defaultParameterList value. + * + * @return the defaultParameterList value + */ + public List defaultParameterList() { + return this.defaultParameterList; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the VersionResource object itself. + */ + public VersionResource withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/VersionResourceList.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/VersionResourceList.java new file mode 100644 index 000000000000..9acdab65536b --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/VersionResourceList.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.servicefabric.v2017_07_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of version resources for the specified application type name. + */ +public class VersionResourceList { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the VersionResourceList object itself. + */ + public VersionResourceList withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Versions.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Versions.java new file mode 100644 index 000000000000..335eed6c100d --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/Versions.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.servicefabric.v2017_07_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation.VersionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Versions. + */ +public interface Versions extends SupportsCreating, HasInner { + /** + * Returns all versions for the specified application type. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion); + + /** + * Returns an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion); + + /** + * Unprovisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion); + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceImpl.java new file mode 100644 index 000000000000..944fd5512c0c --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceImpl.java @@ -0,0 +1,266 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationParameter; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationUpgradePolicy; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationMetricDescription; +import rx.functions.Func1; + +class ApplicationResourceImpl extends CreatableUpdatableImpl implements ApplicationResource, ApplicationResource.Definition, ApplicationResource.Update { + private final ServiceFabricManager manager; + private String subscriptionId; + private String resourceGroupName; + private String clusterName; + private String applicationName; + private String capiVersion; + private String uapiVersion; + private ApplicationResourceUpdateInner updateParameter; + + ApplicationResourceImpl(String name, ServiceFabricManager manager) { + super(name, new ApplicationResourceInner()); + this.manager = manager; + // Set resource name + this.applicationName = name; + // + this.updateParameter = new ApplicationResourceUpdateInner(); + } + + ApplicationResourceImpl(ApplicationResourceInner inner, ServiceFabricManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.applicationName = inner.name(); + // set resource ancestor and positional variables + this.subscriptionId = IdParsingUtils.getValueFromIdByName(inner.id(), "subscriptions"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.applicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "applications"); + // + this.updateParameter = new ApplicationResourceUpdateInner(); + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.putAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationName, this.capiVersion, this.inner()) + .map(new Func1() { + @Override + public ApplicationResourceInner call(ApplicationResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.patchAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationName, this.uapiVersion, this.updateParameter) + .map(new Func1() { + @Override + public ApplicationResourceInner call(ApplicationResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.getAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ApplicationResourceUpdateInner(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public Long maximumNodes() { + return this.inner().maximumNodes(); + } + + @Override + public List metrics() { + return this.inner().metrics(); + } + + @Override + public Long minimumNodes() { + return this.inner().minimumNodes(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List parameters() { + return this.inner().parameters(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Boolean removeApplicationCapacity() { + return this.inner().removeApplicationCapacity(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String typeName() { + return this.inner().typeName(); + } + + @Override + public String typeVersion() { + return this.inner().typeVersion(); + } + + @Override + public ApplicationUpgradePolicy upgradePolicy() { + return this.inner().upgradePolicy(); + } + + @Override + public ApplicationResourceImpl withExistingCluster(String subscriptionId, String resourceGroupName, String clusterName) { + this.subscriptionId = subscriptionId; + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public ApplicationResourceImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ApplicationResourceImpl withTypeName(String typeName) { + this.inner().withTypeName(typeName); + return this; + } + + @Override + public ApplicationResourceImpl withApiVersion(String apiVersion) { + if (isInCreateMode()) { + this.capiVersion = apiVersion; + } else { + this.uapiVersion = apiVersion; + } + return this; + } + + @Override + public ApplicationResourceImpl withMaximumNodes(Long maximumNodes) { + if (isInCreateMode()) { + this.inner().withMaximumNodes(maximumNodes); + } else { + this.updateParameter.withMaximumNodes(maximumNodes); + } + return this; + } + + @Override + public ApplicationResourceImpl withMetrics(List metrics) { + if (isInCreateMode()) { + this.inner().withMetrics(metrics); + } else { + this.updateParameter.withMetrics(metrics); + } + return this; + } + + @Override + public ApplicationResourceImpl withMinimumNodes(Long minimumNodes) { + if (isInCreateMode()) { + this.inner().withMinimumNodes(minimumNodes); + } else { + this.updateParameter.withMinimumNodes(minimumNodes); + } + return this; + } + + @Override + public ApplicationResourceImpl withParameters(List parameters) { + if (isInCreateMode()) { + this.inner().withParameters(parameters); + } else { + this.updateParameter.withParameters(parameters); + } + return this; + } + + @Override + public ApplicationResourceImpl withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + if (isInCreateMode()) { + this.inner().withRemoveApplicationCapacity(removeApplicationCapacity); + } else { + this.updateParameter.withRemoveApplicationCapacity(removeApplicationCapacity); + } + return this; + } + + @Override + public ApplicationResourceImpl withTypeVersion(String typeVersion) { + if (isInCreateMode()) { + this.inner().withTypeVersion(typeVersion); + } else { + this.updateParameter.withTypeVersion(typeVersion); + } + return this; + } + + @Override + public ApplicationResourceImpl withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + if (isInCreateMode()) { + this.inner().withUpgradePolicy(upgradePolicy); + } else { + this.updateParameter.withUpgradePolicy(upgradePolicy); + } + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceInner.java new file mode 100644 index 000000000000..b845e4b9e837 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceInner.java @@ -0,0 +1,282 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationParameter; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationUpgradePolicy; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationMetricDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The application resource. + */ +@JsonFlatten +public class ApplicationResourceInner extends ProxyResource { + /** + * The typeVersion property. + */ + @JsonProperty(value = "properties.typeVersion") + private String typeVersion; + + /** + * The parameters property. + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /** + * The upgradePolicy property. + */ + @JsonProperty(value = "properties.upgradePolicy") + private ApplicationUpgradePolicy upgradePolicy; + + /** + * The minimum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. If this property + * is set to zero, no capacity will be reserved. The value of this property + * cannot be more than the value of the MaximumNodes property. + */ + @JsonProperty(value = "properties.minimumNodes") + private Long minimumNodes; + + /** + * The maximum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. By default, the + * value of this property is zero and it means that the services can be + * placed on any node. + */ + @JsonProperty(value = "properties.maximumNodes") + private Long maximumNodes; + + /** + * The version of the application type. + */ + @JsonProperty(value = "properties.removeApplicationCapacity") + private Boolean removeApplicationCapacity; + + /** + * The metrics property. + */ + @JsonProperty(value = "properties.metrics") + private List metrics; + + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The typeName property. + */ + @JsonProperty(value = "properties.typeName") + private String typeName; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the typeVersion value. + * + * @return the typeVersion value + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the typeVersion value. + * + * @param typeVersion the typeVersion value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get the parameters value. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @param parameters the parameters value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the upgradePolicy value. + * + * @return the upgradePolicy value + */ + public ApplicationUpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy value. + * + * @param upgradePolicy the upgradePolicy value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. + * + * @return the minimumNodes value + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set the minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. + * + * @param minimumNodes the minimumNodes value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get the maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @return the maximumNodes value + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set the maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @param maximumNodes the maximumNodes value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get the version of the application type. + * + * @return the removeApplicationCapacity value + */ + public Boolean removeApplicationCapacity() { + return this.removeApplicationCapacity; + } + + /** + * Set the version of the application type. + * + * @param removeApplicationCapacity the removeApplicationCapacity value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + this.removeApplicationCapacity = removeApplicationCapacity; + return this; + } + + /** + * Get the metrics value. + * + * @return the metrics value + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics value. + * + * @param metrics the metrics value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get the current deployment or provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the typeName value. + * + * @return the typeName value + */ + public String typeName() { + return this.typeName; + } + + /** + * Set the typeName value. + * + * @param typeName the typeName value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withTypeName(String typeName) { + this.typeName = typeName; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceListImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceListImpl.java new file mode 100644 index 000000000000..0d8be6de2aa7 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceListImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationResourceList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ApplicationResourceListImpl extends WrapperImpl implements ApplicationResourceList { + private final ServiceFabricManager manager; + ApplicationResourceListImpl(ApplicationResourceListInner inner, ServiceFabricManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceListInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceListInner.java new file mode 100644 index 000000000000..6e6f8d1eb90e --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceListInner.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.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of application resources. + */ +public class ApplicationResourceListInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ApplicationResourceListInner object itself. + */ + public ApplicationResourceListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceUpdateInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceUpdateInner.java new file mode 100644 index 000000000000..d29f8cee887a --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationResourceUpdateInner.java @@ -0,0 +1,240 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationParameter; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationUpgradePolicy; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationMetricDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The application resource for patch operations. + */ +@JsonFlatten +public class ApplicationResourceUpdateInner extends ProxyResource { + /** + * The typeVersion property. + */ + @JsonProperty(value = "properties.typeVersion") + private String typeVersion; + + /** + * The parameters property. + */ + @JsonProperty(value = "properties.parameters") + private List parameters; + + /** + * The upgradePolicy property. + */ + @JsonProperty(value = "properties.upgradePolicy") + private ApplicationUpgradePolicy upgradePolicy; + + /** + * The minimum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. If this property + * is set to zero, no capacity will be reserved. The value of this property + * cannot be more than the value of the MaximumNodes property. + */ + @JsonProperty(value = "properties.minimumNodes") + private Long minimumNodes; + + /** + * The maximum number of nodes where Service Fabric will reserve capacity + * for this application. Note that this does not mean that the services of + * this application will be placed on all of those nodes. By default, the + * value of this property is zero and it means that the services can be + * placed on any node. + */ + @JsonProperty(value = "properties.maximumNodes") + private Long maximumNodes; + + /** + * The version of the application type. + */ + @JsonProperty(value = "properties.removeApplicationCapacity") + private Boolean removeApplicationCapacity; + + /** + * The metrics property. + */ + @JsonProperty(value = "properties.metrics") + private List metrics; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the typeVersion value. + * + * @return the typeVersion value + */ + public String typeVersion() { + return this.typeVersion; + } + + /** + * Set the typeVersion value. + * + * @param typeVersion the typeVersion value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withTypeVersion(String typeVersion) { + this.typeVersion = typeVersion; + return this; + } + + /** + * Get the parameters value. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters value. + * + * @param parameters the parameters value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the upgradePolicy value. + * + * @return the upgradePolicy value + */ + public ApplicationUpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy value. + * + * @param upgradePolicy the upgradePolicy value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withUpgradePolicy(ApplicationUpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + + /** + * Get the minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. + * + * @return the minimumNodes value + */ + public Long minimumNodes() { + return this.minimumNodes; + } + + /** + * Set the minimum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. If this property is set to zero, no capacity will be reserved. The value of this property cannot be more than the value of the MaximumNodes property. + * + * @param minimumNodes the minimumNodes value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withMinimumNodes(Long minimumNodes) { + this.minimumNodes = minimumNodes; + return this; + } + + /** + * Get the maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @return the maximumNodes value + */ + public Long maximumNodes() { + return this.maximumNodes; + } + + /** + * Set the maximum number of nodes where Service Fabric will reserve capacity for this application. Note that this does not mean that the services of this application will be placed on all of those nodes. By default, the value of this property is zero and it means that the services can be placed on any node. + * + * @param maximumNodes the maximumNodes value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withMaximumNodes(Long maximumNodes) { + this.maximumNodes = maximumNodes; + return this; + } + + /** + * Get the version of the application type. + * + * @return the removeApplicationCapacity value + */ + public Boolean removeApplicationCapacity() { + return this.removeApplicationCapacity; + } + + /** + * Set the version of the application type. + * + * @param removeApplicationCapacity the removeApplicationCapacity value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withRemoveApplicationCapacity(Boolean removeApplicationCapacity) { + this.removeApplicationCapacity = removeApplicationCapacity; + return this; + } + + /** + * Get the metrics value. + * + * @return the metrics value + */ + public List metrics() { + return this.metrics; + } + + /** + * Set the metrics value. + * + * @param metrics the metrics value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withMetrics(List metrics) { + this.metrics = metrics; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ApplicationResourceUpdateInner object itself. + */ + public ApplicationResourceUpdateInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceImpl.java new file mode 100644 index 000000000000..e8a2b7775d11 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationTypeResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class ApplicationTypeResourceImpl extends CreatableUpdatableImpl implements ApplicationTypeResource, ApplicationTypeResource.Definition, ApplicationTypeResource.Update { + private final ServiceFabricManager manager; + private String subscriptionId; + private String resourceGroupName; + private String clusterName; + private String applicationTypeName; + private String capiVersion; + private String clocation; + private String uapiVersion; + private String ulocation; + + ApplicationTypeResourceImpl(String name, ServiceFabricManager manager) { + super(name, new ApplicationTypeResourceInner()); + this.manager = manager; + // Set resource name + this.applicationTypeName = name; + // + } + + ApplicationTypeResourceImpl(ApplicationTypeResourceInner inner, ServiceFabricManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.applicationTypeName = inner.name(); + // set resource ancestor and positional variables + this.subscriptionId = IdParsingUtils.getValueFromIdByName(inner.id(), "subscriptions"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.applicationTypeName = IdParsingUtils.getValueFromIdByName(inner.id(), "applicationTypes"); + // + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ApplicationTypesInner client = this.manager().inner().applicationTypes(); + return client.putAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationTypeName, this.capiVersion, this.clocation) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ApplicationTypesInner client = this.manager().inner().applicationTypes(); + return client.putAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationTypeName, this.uapiVersion, this.ulocation) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ApplicationTypesInner client = this.manager().inner().applicationTypes(); + return client.getAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationTypeName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ApplicationTypeResourceImpl withExistingCluster(String subscriptionId, String resourceGroupName, String clusterName) { + this.subscriptionId = subscriptionId; + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + @Override + public ApplicationTypeResourceImpl withApiVersion(String apiVersion) { + if (isInCreateMode()) { + this.capiVersion = apiVersion; + } else { + this.uapiVersion = apiVersion; + } + return this; + } + + @Override + public ApplicationTypeResourceImpl withLocation(String location) { + if (isInCreateMode()) { + this.clocation = location; + } else { + this.ulocation = location; + } + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceInner.java new file mode 100644 index 000000000000..cf6037bfefe9 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceInner.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.servicefabric.v2017_07_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The application type name resource. + */ +@JsonFlatten +public class ApplicationTypeResourceInner extends ProxyResource { + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the current deployment or provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ApplicationTypeResourceInner object itself. + */ + public ApplicationTypeResourceInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceListImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceListImpl.java new file mode 100644 index 000000000000..8b68624a460f --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceListImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationTypeResourceList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ApplicationTypeResourceListImpl extends WrapperImpl implements ApplicationTypeResourceList { + private final ServiceFabricManager manager; + ApplicationTypeResourceListImpl(ApplicationTypeResourceListInner inner, ServiceFabricManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceListInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceListInner.java new file mode 100644 index 000000000000..bab8c03dbbe3 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypeResourceListInner.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.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of application type names. + */ +public class ApplicationTypeResourceListInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ApplicationTypeResourceListInner object itself. + */ + public ApplicationTypeResourceListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypesImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypesImpl.java new file mode 100644 index 000000000000..6e0394f72977 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypesImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationTypes; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationTypeResourceList; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationTypeResource; + +class ApplicationTypesImpl extends WrapperImpl implements ApplicationTypes { + private final ServiceFabricManager manager; + + ApplicationTypesImpl(ServiceFabricManager manager) { + super(manager.inner().applicationTypes()); + this.manager = manager; + } + + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public ApplicationTypeResourceImpl define(String name) { + return wrapModel(name); + } + + private ApplicationTypeResourceImpl wrapModel(ApplicationTypeResourceInner inner) { + return new ApplicationTypeResourceImpl(inner, manager()); + } + + private ApplicationTypeResourceImpl wrapModel(String name) { + return new ApplicationTypeResourceImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String apiVersion) { + ApplicationTypesInner client = this.inner(); + return client.listAsync(subscriptionId, resourceGroupName, clusterName, apiVersion) + .map(new Func1() { + @Override + public ApplicationTypeResourceList call(ApplicationTypeResourceListInner inner) { + return new ApplicationTypeResourceListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + ApplicationTypesInner client = this.inner(); + return client.getAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion) + .map(new Func1() { + @Override + public ApplicationTypeResource call(ApplicationTypeResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + ApplicationTypesInner client = this.inner(); + return client.deleteAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion).toCompletable(); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypesInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypesInner.java new file mode 100644 index 000000000000..628bb229985e --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationTypesInner.java @@ -0,0 +1,568 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ErrorModelException; +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.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 ApplicationTypes. + */ +public class ApplicationTypesInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationTypesService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ApplicationTypesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationTypesInner(Retrofit retrofit, ServiceFabricManagementClientImpl client) { + this.service = retrofit.create(ApplicationTypesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationTypes to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationTypesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationTypes get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @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.servicefabric.v2017_07_01_preview.ApplicationTypes put" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}") + Observable> put(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ApplicationTypeResourceInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationTypes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @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.servicefabric.v2017_07_01_preview.ApplicationTypes beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @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.servicefabric.v2017_07_01_preview.ApplicationTypes list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes") + 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); + + } + + /** + * Returns an application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeResourceInner object if successful. + */ + public ApplicationTypeResourceInner get(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + return getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion).toBlocking().single().body(); + } + + /** + * Returns an application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion), serviceCallback); + } + + /** + * Returns an application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceInner object + */ + public Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + return getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion).map(new Func1, ApplicationTypeResourceInner>() { + @Override + public ApplicationTypeResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns an application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceInner object + */ + public Observable> getWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.get(subscriptionId, resourceGroupName, clusterName, applicationTypeName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Creates the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @param location Resource location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeResourceInner object if successful. + */ + public ApplicationTypeResourceInner put(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion, String location) { + return putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion, location).toBlocking().single().body(); + } + + /** + * Creates the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @param location Resource location. + * @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 putAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion, String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion, location), serviceCallback); + } + + /** + * Creates the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @param location Resource location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceInner object + */ + public Observable putAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion, String location) { + return putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion, location).map(new Func1, ApplicationTypeResourceInner>() { + @Override + public ApplicationTypeResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @param location Resource location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceInner object + */ + public Observable> putWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion, String location) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + ApplicationTypeResourceInner parameters = new ApplicationTypeResourceInner(); + parameters.withLocation(location); + return service.put(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion).toBlocking().last().body(); + } + + /** + * Deletes the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion), serviceCallback); + } + + /** + * Deletes the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + return deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + Observable> observable = service.delete(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion).toBlocking().single().body(); + } + + /** + * Deletes the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion), serviceCallback); + } + + /** + * Deletes the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + return beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the application type name resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.beginDelete(subscriptionId, resourceGroupName, clusterName, applicationTypeName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Returns all application type names in the specified cluster. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationTypeResourceListInner object if successful. + */ + public ApplicationTypeResourceListInner list(String subscriptionId, String resourceGroupName, String clusterName, String apiVersion) { + return listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, apiVersion).toBlocking().single().body(); + } + + /** + * Returns all application type names in the specified cluster. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, apiVersion), serviceCallback); + } + + /** + * Returns all application type names in the specified cluster. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceListInner object + */ + public Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String apiVersion) { + return listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, apiVersion).map(new Func1, ApplicationTypeResourceListInner>() { + @Override + public ApplicationTypeResourceListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns all application type names in the specified cluster. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationTypeResourceListInner object + */ + public Observable> listWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.list(subscriptionId, resourceGroupName, clusterName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationsImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationsImpl.java new file mode 100644 index 000000000000..87502249a2d6 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationsImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.Applications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationResourceList; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationResource; + +class ApplicationsImpl extends WrapperImpl implements Applications { + private final ServiceFabricManager manager; + + ApplicationsImpl(ServiceFabricManager manager) { + super(manager.inner().applications()); + this.manager = manager; + } + + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public ApplicationResourceImpl define(String name) { + return wrapModel(name); + } + + private ApplicationResourceImpl wrapModel(ApplicationResourceInner inner) { + return new ApplicationResourceImpl(inner, manager()); + } + + private ApplicationResourceImpl wrapModel(String name) { + return new ApplicationResourceImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String apiVersion) { + ApplicationsInner client = this.inner(); + return client.listAsync(subscriptionId, resourceGroupName, clusterName, apiVersion) + .map(new Func1() { + @Override + public ApplicationResourceList call(ApplicationResourceListInner inner) { + return new ApplicationResourceListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + ApplicationsInner client = this.inner(); + return client.getAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion) + .map(new Func1() { + @Override + public ApplicationResource call(ApplicationResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + ApplicationsInner client = this.inner(); + return client.deleteAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion).toCompletable(); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationsInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationsInner.java new file mode 100644 index 000000000000..bad1aa7d8f1c --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ApplicationsInner.java @@ -0,0 +1,874 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ErrorModelException; +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.PATCH; +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 Applications. + */ +public class ApplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationsService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl 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, ServiceFabricManagementClientImpl 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.servicefabric.v2017_07_01_preview.Applications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/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.servicefabric.v2017_07_01_preview.Applications put" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + Observable> put(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationResourceInner 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.servicefabric.v2017_07_01_preview.Applications beginPut" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + Observable> beginPut(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationResourceInner 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.servicefabric.v2017_07_01_preview.Applications patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + Observable> patch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationResourceUpdateInner 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.servicefabric.v2017_07_01_preview.Applications beginPatch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}") + Observable> beginPatch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Query("api-version") String apiVersion, @Body ApplicationResourceUpdateInner 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.servicefabric.v2017_07_01_preview.Applications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/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.servicefabric.v2017_07_01_preview.Applications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/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.servicefabric.v2017_07_01_preview.Applications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/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); + + } + + /** + * Returns an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceInner object if successful. + */ + public ApplicationResourceInner get(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + return getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion).toBlocking().single().body(); + } + + /** + * Returns an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion), serviceCallback); + } + + /** + * Returns an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceInner object + */ + public Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + return getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion).map(new Func1, ApplicationResourceInner>() { + @Override + public ApplicationResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceInner object + */ + public Observable> getWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.get(subscriptionId, resourceGroupName, clusterName, applicationName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Creates or updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceInner object if successful. + */ + public ApplicationResourceInner put(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceInner parameters) { + return putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource. + * @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 putAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters), serviceCallback); + } + + /** + * Creates or updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceInner parameters) { + return putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters).map(new Func1, ApplicationResourceInner>() { + @Override + public ApplicationResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceInner parameters) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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.put(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceInner object if successful. + */ + public ApplicationResourceInner beginPut(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceInner parameters) { + return beginPutWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource. + * @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 beginPutAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters), serviceCallback); + } + + /** + * Creates or updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceInner object + */ + public Observable beginPutAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceInner parameters) { + return beginPutWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters).map(new Func1, ApplicationResourceInner>() { + @Override + public ApplicationResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceInner object + */ + public Observable> beginPutWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceInner parameters) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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.beginPut(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceUpdateInner object if successful. + */ + public ApplicationResourceUpdateInner patch(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceUpdateInner parameters) { + return patchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters).toBlocking().last().body(); + } + + /** + * Updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource for patch 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 patchAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters), serviceCallback); + } + + /** + * Updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable patchAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceUpdateInner parameters) { + return patchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters).map(new Func1, ApplicationResourceUpdateInner>() { + @Override + public ApplicationResourceUpdateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> patchWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceUpdateInner parameters) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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.patch(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceUpdateInner object if successful. + */ + public ApplicationResourceUpdateInner beginPatch(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceUpdateInner parameters) { + return beginPatchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters).toBlocking().single().body(); + } + + /** + * Updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource for patch 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 beginPatchAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPatchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters), serviceCallback); + } + + /** + * Updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceUpdateInner object + */ + public Observable beginPatchAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceUpdateInner parameters) { + return beginPatchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters).map(new Func1, ApplicationResourceUpdateInner>() { + @Override + public ApplicationResourceUpdateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @param parameters The application resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceUpdateInner object + */ + public Observable> beginPatchWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, ApplicationResourceUpdateInner parameters) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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.beginPatch(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPatchDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion).toBlocking().last().body(); + } + + /** + * Deletes an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion), serviceCallback); + } + + /** + * Deletes an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + return deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + Observable> observable = service.delete(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion).toBlocking().single().body(); + } + + /** + * Deletes an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion), serviceCallback); + } + + /** + * Deletes an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + return beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an application resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.beginDelete(subscriptionId, resourceGroupName, clusterName, applicationName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Returns all application resources in the specified cluster. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceListInner object if successful. + */ + public ApplicationResourceListInner list(String subscriptionId, String resourceGroupName, String clusterName, String apiVersion) { + return listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, apiVersion).toBlocking().single().body(); + } + + /** + * Returns all application resources in the specified cluster. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, apiVersion), serviceCallback); + } + + /** + * Returns all application resources in the specified cluster. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceListInner object + */ + public Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String apiVersion) { + return listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, apiVersion).map(new Func1, ApplicationResourceListInner>() { + @Override + public ApplicationResourceListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns all application resources in the specified cluster. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceListInner object + */ + public Observable> listWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.list(subscriptionId, resourceGroupName, clusterName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterCodeVersionsListResultImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterCodeVersionsListResultImpl.java new file mode 100644 index 000000000000..dbfe2adec8b9 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterCodeVersionsListResultImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterCodeVersionsListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterCodeVersionsResult; + +class ClusterCodeVersionsListResultImpl extends WrapperImpl implements ClusterCodeVersionsListResult { + private final ServiceFabricManager manager; + private String location; + private String subscriptionId; + private String clusterVersion; + + ClusterCodeVersionsListResultImpl(ClusterCodeVersionsListResultInner inner, ServiceFabricManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterCodeVersionsListResultInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterCodeVersionsListResultInner.java new file mode 100644 index 000000000000..371074e01a5b --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterCodeVersionsListResultInner.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.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterCodeVersionsResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list results of the ServiceFabric runtime versions. + */ +public class ClusterCodeVersionsListResultInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ClusterCodeVersionsListResultInner object itself. + */ + public ClusterCodeVersionsListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to use for getting the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ClusterCodeVersionsListResultInner object itself. + */ + public ClusterCodeVersionsListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterImpl.java new file mode 100644 index 000000000000..e01783aa43a8 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterImpl.java @@ -0,0 +1,336 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.Cluster; +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterUpdateParameters; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterVersionDetails; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.CertificateDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClientCertificateThumbprint; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClientCertificateCommonName; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.SettingsSectionDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.NodeTypeDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.AzureActiveDirectory; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ProvisioningState; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.DiagnosticsStorageAccountConfig; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterUpgradePolicy; +import rx.functions.Func1; + +class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { + private String capiVersion; + private String uapiVersion; + private ClusterUpdateParameters updateParameter; + ClusterImpl(String name, ClusterInner inner, ServiceFabricManager manager) { + super(name, inner, manager); + this.updateParameter = new ClusterUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createAsync(this.resourceGroupName(), this.name(), this.capiVersion, this.inner()) + .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.updateAsync(this.resourceGroupName(), this.name(), this.uapiVersion, this.updateParameter) + .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 null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ClusterUpdateParameters(); + } + + @Override + public List addOnFeatures() { + return this.inner().addOnFeatures(); + } + + @Override + public List availableClusterVersions() { + return this.inner().availableClusterVersions(); + } + + @Override + public AzureActiveDirectory azureActiveDirectory() { + return this.inner().azureActiveDirectory(); + } + + @Override + public CertificateDescription certificate() { + return this.inner().certificate(); + } + + @Override + public List clientCertificateCommonNames() { + return this.inner().clientCertificateCommonNames(); + } + + @Override + public List clientCertificateThumbprints() { + return this.inner().clientCertificateThumbprints(); + } + + @Override + public String clusterCodeVersion() { + return this.inner().clusterCodeVersion(); + } + + @Override + public String clusterEndpoint() { + return this.inner().clusterEndpoint(); + } + + @Override + public String clusterId() { + return this.inner().clusterId(); + } + + @Override + public String clusterState() { + return this.inner().clusterState(); + } + + @Override + public DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig() { + return this.inner().diagnosticsStorageAccountConfig(); + } + + @Override + public List fabricSettings() { + return this.inner().fabricSettings(); + } + + @Override + public String managementEndpoint() { + return this.inner().managementEndpoint(); + } + + @Override + public List nodeTypes() { + return this.inner().nodeTypes(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String reliabilityLevel() { + return this.inner().reliabilityLevel(); + } + + @Override + public CertificateDescription reverseProxyCertificate() { + return this.inner().reverseProxyCertificate(); + } + + @Override + public ClusterUpgradePolicy upgradeDescription() { + return this.inner().upgradeDescription(); + } + + @Override + public String upgradeMode() { + return this.inner().upgradeMode(); + } + + @Override + public String vmImage() { + return this.inner().vmImage(); + } + + @Override + public ClusterImpl withManagementEndpoint(String managementEndpoint) { + this.inner().withManagementEndpoint(managementEndpoint); + return this; + } + + @Override + public ClusterImpl withAvailableClusterVersions(List availableClusterVersions) { + this.inner().withAvailableClusterVersions(availableClusterVersions); + return this; + } + + @Override + public ClusterImpl withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.inner().withAzureActiveDirectory(azureActiveDirectory); + return this; + } + + @Override + public ClusterImpl withClusterState(String clusterState) { + this.inner().withClusterState(clusterState); + return this; + } + + @Override + public ClusterImpl withDiagnosticsStorageAccountConfig(DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig) { + this.inner().withDiagnosticsStorageAccountConfig(diagnosticsStorageAccountConfig); + return this; + } + + @Override + public ClusterImpl withVmImage(String vmImage) { + this.inner().withVmImage(vmImage); + return this; + } + + @Override + public ClusterImpl withApiVersion(String apiVersion) { + if (isInCreateMode()) { + this.capiVersion = apiVersion; + } else { + this.uapiVersion = apiVersion; + } + return this; + } + + @Override + public ClusterImpl withNodeTypes(List nodeTypes) { + if (isInCreateMode()) { + this.inner().withNodeTypes(nodeTypes); + } else { + this.updateParameter.withNodeTypes(nodeTypes); + } + return this; + } + + @Override + public ClusterImpl withAddOnFeatures(List addOnFeatures) { + if (isInCreateMode()) { + this.inner().withAddOnFeatures(addOnFeatures); + } else { + this.updateParameter.withAddOnFeatures(addOnFeatures); + } + return this; + } + + @Override + public ClusterImpl withCertificate(CertificateDescription certificate) { + if (isInCreateMode()) { + this.inner().withCertificate(certificate); + } else { + this.updateParameter.withCertificate(certificate); + } + return this; + } + + @Override + public ClusterImpl withClientCertificateCommonNames(List clientCertificateCommonNames) { + if (isInCreateMode()) { + this.inner().withClientCertificateCommonNames(clientCertificateCommonNames); + } else { + this.updateParameter.withClientCertificateCommonNames(clientCertificateCommonNames); + } + return this; + } + + @Override + public ClusterImpl withClientCertificateThumbprints(List clientCertificateThumbprints) { + if (isInCreateMode()) { + this.inner().withClientCertificateThumbprints(clientCertificateThumbprints); + } else { + this.updateParameter.withClientCertificateThumbprints(clientCertificateThumbprints); + } + return this; + } + + @Override + public ClusterImpl withClusterCodeVersion(String clusterCodeVersion) { + if (isInCreateMode()) { + this.inner().withClusterCodeVersion(clusterCodeVersion); + } else { + this.updateParameter.withClusterCodeVersion(clusterCodeVersion); + } + return this; + } + + @Override + public ClusterImpl withFabricSettings(List fabricSettings) { + if (isInCreateMode()) { + this.inner().withFabricSettings(fabricSettings); + } else { + this.updateParameter.withFabricSettings(fabricSettings); + } + return this; + } + + @Override + public ClusterImpl withReliabilityLevel(String reliabilityLevel) { + if (isInCreateMode()) { + this.inner().withReliabilityLevel(reliabilityLevel); + } else { + this.updateParameter.withReliabilityLevel(reliabilityLevel); + } + return this; + } + + @Override + public ClusterImpl withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + if (isInCreateMode()) { + this.inner().withReverseProxyCertificate(reverseProxyCertificate); + } else { + this.updateParameter.withReverseProxyCertificate(reverseProxyCertificate); + } + return this; + } + + @Override + public ClusterImpl withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + if (isInCreateMode()) { + this.inner().withUpgradeDescription(upgradeDescription); + } else { + this.updateParameter.withUpgradeDescription(upgradeDescription); + } + return this; + } + + @Override + public ClusterImpl withUpgradeMode(String upgradeMode) { + if (isInCreateMode()) { + this.inner().withUpgradeMode(upgradeMode); + } else { + this.updateParameter.withUpgradeMode(upgradeMode); + } + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterInner.java new file mode 100644 index 000000000000..fb1a0cb11ddc --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterInner.java @@ -0,0 +1,534 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterVersionDetails; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.CertificateDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClientCertificateThumbprint; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClientCertificateCommonName; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.SettingsSectionDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.NodeTypeDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.AzureActiveDirectory; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ProvisioningState; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.DiagnosticsStorageAccountConfig; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterUpgradePolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The cluster resource. + */ +@JsonFlatten +public class ClusterInner extends Resource { + /** + * The Service Fabric runtime versions available for this cluster. + */ + @JsonProperty(value = "properties.availableClusterVersions") + private List availableClusterVersions; + + /** + * A service generated unique identifier for the cluster resource. + */ + @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /** + * Possible values include: 'WaitingForNodes', 'Deploying', + * 'BaselineUpgrade', 'UpdatingUserConfiguration', + * 'UpdatingUserCertificate', 'UpdatingInfrastructure', + * 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', + * 'Ready'. + */ + @JsonProperty(value = "properties.clusterState") + private String clusterState; + + /** + * The Azure Resource Provider endpoint. A system service in the cluster + * connects to this endpoint. + */ + @JsonProperty(value = "properties.clusterEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String clusterEndpoint; + + /** + * The Service Fabric runtime version of the cluster. This property can + * only by set the user when **upgradeMode** is set to 'Manual'. To get + * list of available Service Fabric versions for new clusters use + * [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /** + * The certificate to use for securing the cluster. The certificate + * provided will be used for node to node security within the cluster, SSL + * certificate for cluster management endpoint and default admin client. + */ + @JsonProperty(value = "properties.certificate") + private CertificateDescription certificate; + + /** + * Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum'. + */ + @JsonProperty(value = "properties.reliabilityLevel") + private String reliabilityLevel; + + /** + * Possible values include: 'Automatic', 'Manual'. + */ + @JsonProperty(value = "properties.upgradeMode") + private String upgradeMode; + + /** + * The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. + */ + @JsonProperty(value = "properties.clientCertificateThumbprints") + private List clientCertificateThumbprints; + + /** + * The list of client certificates referenced by common name that are + * allowed to manage the cluster. + */ + @JsonProperty(value = "properties.clientCertificateCommonNames") + private List clientCertificateCommonNames; + + /** + * The list of custom fabric settings to configure the cluster. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /** + * The server certificate used by reverse proxy. + */ + @JsonProperty(value = "properties.reverseProxyCertificate") + private CertificateDescription reverseProxyCertificate; + + /** + * The http management endpoint of the cluster. + */ + @JsonProperty(value = "properties.managementEndpoint", required = true) + private String managementEndpoint; + + /** + * The list of node types in the cluster. + */ + @JsonProperty(value = "properties.nodeTypes", required = true) + private List nodeTypes; + + /** + * The AAD authentication settings of the cluster. + */ + @JsonProperty(value = "properties.azureActiveDirectory") + private AzureActiveDirectory azureActiveDirectory; + + /** + * The provisioning state of the cluster resource. Possible values include: + * 'Updating', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The VM image VMSS has been configured with. Generic names such as + * Windows or Linux can be used. + */ + @JsonProperty(value = "properties.vmImage") + private String vmImage; + + /** + * The storage account information for storing Service Fabric diagnostic + * logs. + */ + @JsonProperty(value = "properties.diagnosticsStorageAccountConfig") + private DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig; + + /** + * The policy to use when upgrading the cluster. + */ + @JsonProperty(value = "properties.upgradeDescription") + private ClusterUpgradePolicy upgradeDescription; + + /** + * The list of add-on features to enable in the cluster. + */ + @JsonProperty(value = "properties.addOnFeatures") + private List addOnFeatures; + + /** + * Get the Service Fabric runtime versions available for this cluster. + * + * @return the availableClusterVersions value + */ + public List availableClusterVersions() { + return this.availableClusterVersions; + } + + /** + * Set the Service Fabric runtime versions available for this cluster. + * + * @param availableClusterVersions the availableClusterVersions value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withAvailableClusterVersions(List availableClusterVersions) { + this.availableClusterVersions = availableClusterVersions; + return this; + } + + /** + * Get a service generated unique identifier for the cluster resource. + * + * @return the clusterId value + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get possible values include: 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', 'UpdatingUserConfiguration', 'UpdatingUserCertificate', 'UpdatingInfrastructure', 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', 'Ready'. + * + * @return the clusterState value + */ + public String clusterState() { + return this.clusterState; + } + + /** + * Set possible values include: 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', 'UpdatingUserConfiguration', 'UpdatingUserCertificate', 'UpdatingInfrastructure', 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', 'Ready'. + * + * @param clusterState the clusterState value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterState(String clusterState) { + this.clusterState = clusterState; + return this; + } + + /** + * Get the Azure Resource Provider endpoint. A system service in the cluster connects to this endpoint. + * + * @return the clusterEndpoint value + */ + public String clusterEndpoint() { + return this.clusterEndpoint; + } + + /** + * Get the Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. + * + * @return the clusterCodeVersion value + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. + * + * @param clusterCodeVersion the clusterCodeVersion value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. + * + * @return the certificate value + */ + public CertificateDescription certificate() { + return this.certificate; + } + + /** + * Set the certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. + * + * @param certificate the certificate value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withCertificate(CertificateDescription certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum'. + * + * @return the reliabilityLevel value + */ + public String reliabilityLevel() { + return this.reliabilityLevel; + } + + /** + * Set possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum'. + * + * @param reliabilityLevel the reliabilityLevel value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withReliabilityLevel(String reliabilityLevel) { + this.reliabilityLevel = reliabilityLevel; + return this; + } + + /** + * Get possible values include: 'Automatic', 'Manual'. + * + * @return the upgradeMode value + */ + public String upgradeMode() { + return this.upgradeMode; + } + + /** + * Set possible values include: 'Automatic', 'Manual'. + * + * @param upgradeMode the upgradeMode value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withUpgradeMode(String upgradeMode) { + this.upgradeMode = upgradeMode; + return this; + } + + /** + * Get the list of client certificates referenced by thumbprint that are allowed to manage the cluster. + * + * @return the clientCertificateThumbprints value + */ + public List clientCertificateThumbprints() { + return this.clientCertificateThumbprints; + } + + /** + * Set the list of client certificates referenced by thumbprint that are allowed to manage the cluster. + * + * @param clientCertificateThumbprints the clientCertificateThumbprints value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClientCertificateThumbprints(List clientCertificateThumbprints) { + this.clientCertificateThumbprints = clientCertificateThumbprints; + return this; + } + + /** + * Get the list of client certificates referenced by common name that are allowed to manage the cluster. + * + * @return the clientCertificateCommonNames value + */ + public List clientCertificateCommonNames() { + return this.clientCertificateCommonNames; + } + + /** + * Set the list of client certificates referenced by common name that are allowed to manage the cluster. + * + * @param clientCertificateCommonNames the clientCertificateCommonNames value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClientCertificateCommonNames(List clientCertificateCommonNames) { + this.clientCertificateCommonNames = clientCertificateCommonNames; + return this; + } + + /** + * Get the list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the list of custom fabric settings to configure the cluster. + * + * @param fabricSettings the fabricSettings value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the server certificate used by reverse proxy. + * + * @return the reverseProxyCertificate value + */ + public CertificateDescription reverseProxyCertificate() { + return this.reverseProxyCertificate; + } + + /** + * Set the server certificate used by reverse proxy. + * + * @param reverseProxyCertificate the reverseProxyCertificate value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + this.reverseProxyCertificate = reverseProxyCertificate; + return this; + } + + /** + * Get the http management endpoint of the cluster. + * + * @return the managementEndpoint value + */ + public String managementEndpoint() { + return this.managementEndpoint; + } + + /** + * Set the http management endpoint of the cluster. + * + * @param managementEndpoint the managementEndpoint value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withManagementEndpoint(String managementEndpoint) { + this.managementEndpoint = managementEndpoint; + return this; + } + + /** + * Get the list of node types in the cluster. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of node types in the cluster. + * + * @param nodeTypes the nodeTypes value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the AAD authentication settings of the cluster. + * + * @return the azureActiveDirectory value + */ + public AzureActiveDirectory azureActiveDirectory() { + return this.azureActiveDirectory; + } + + /** + * Set the AAD authentication settings of the cluster. + * + * @param azureActiveDirectory the azureActiveDirectory value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.azureActiveDirectory = azureActiveDirectory; + return this; + } + + /** + * Get the provisioning state of the cluster resource. Possible values include: 'Updating', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. + * + * @return the vmImage value + */ + public String vmImage() { + return this.vmImage; + } + + /** + * Set the VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. + * + * @param vmImage the vmImage value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withVmImage(String vmImage) { + this.vmImage = vmImage; + return this; + } + + /** + * Get the storage account information for storing Service Fabric diagnostic logs. + * + * @return the diagnosticsStorageAccountConfig value + */ + public DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig() { + return this.diagnosticsStorageAccountConfig; + } + + /** + * Set the storage account information for storing Service Fabric diagnostic logs. + * + * @param diagnosticsStorageAccountConfig the diagnosticsStorageAccountConfig value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withDiagnosticsStorageAccountConfig(DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig) { + this.diagnosticsStorageAccountConfig = diagnosticsStorageAccountConfig; + return this; + } + + /** + * Get the policy to use when upgrading the cluster. + * + * @return the upgradeDescription value + */ + public ClusterUpgradePolicy upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set the policy to use when upgrading the cluster. + * + * @param upgradeDescription the upgradeDescription value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + + /** + * Get the list of add-on features to enable in the cluster. + * + * @return the addOnFeatures value + */ + public List addOnFeatures() { + return this.addOnFeatures; + } + + /** + * Set the list of add-on features to enable in the cluster. + * + * @param addOnFeatures the addOnFeatures value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withAddOnFeatures(List addOnFeatures) { + this.addOnFeatures = addOnFeatures; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterVersionsImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterVersionsImpl.java new file mode 100644 index 000000000000..745303922678 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterVersionsImpl.java @@ -0,0 +1,82 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterVersions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterCodeVersionsListResult; + +class ClusterVersionsImpl extends WrapperImpl implements ClusterVersions { + private final ServiceFabricManager manager; + + ClusterVersionsImpl(ServiceFabricManager manager) { + super(manager.inner().clusterVersions()); + this.manager = manager; + } + + public ServiceFabricManager manager() { + return this.manager; + } + + private ClusterCodeVersionsListResultImpl wrapModel(ClusterCodeVersionsListResultInner inner) { + return new ClusterCodeVersionsListResultImpl(inner, manager()); + } + + @Override + public Observable getByEnvironmentAsync(String location, String environment, String subscriptionId, String clusterVersion, String apiVersion) { + ClusterVersionsInner client = this.inner(); + return client.getByEnvironmentAsync(location, environment, subscriptionId, clusterVersion, apiVersion) + .map(new Func1() { + @Override + public ClusterCodeVersionsListResult call(ClusterCodeVersionsListResultInner inner) { + return new ClusterCodeVersionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String location, String subscriptionId, String apiVersion) { + ClusterVersionsInner client = this.inner(); + return client.listAsync(location, subscriptionId, apiVersion) + .map(new Func1() { + @Override + public ClusterCodeVersionsListResult call(ClusterCodeVersionsListResultInner inner) { + return new ClusterCodeVersionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByEnvironmentAsync(String location, String environment, String subscriptionId, String apiVersion) { + ClusterVersionsInner client = this.inner(); + return client.listByEnvironmentAsync(location, environment, subscriptionId, apiVersion) + .map(new Func1() { + @Override + public ClusterCodeVersionsListResult call(ClusterCodeVersionsListResultInner inner) { + return new ClusterCodeVersionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String location, String subscriptionId, String clusterVersion, String apiVersion) { + ClusterVersionsInner client = this.inner(); + return client.getAsync(location, subscriptionId, clusterVersion, apiVersion) + .map(new Func1() { + @Override + public ClusterCodeVersionsListResult call(ClusterCodeVersionsListResultInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterVersionsInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterVersionsInner.java new file mode 100644 index 000000000000..b8d38bcb2bb2 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClusterVersionsInner.java @@ -0,0 +1,464 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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 ClusterVersions. + */ +public class ClusterVersionsInner { + /** The Retrofit service to perform REST calls. */ + private ClusterVersionsService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ClusterVersionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClusterVersionsInner(Retrofit retrofit, ServiceFabricManagementClientImpl client) { + this.service = retrofit.create(ClusterVersionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ClusterVersions to be + * used by Retrofit to perform actually REST calls. + */ + interface ClusterVersionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterVersions get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}") + Observable> get(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Path("clusterVersion") String clusterVersion, @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.servicefabric.v2017_07_01_preview.ClusterVersions getByEnvironment" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}") + Observable> getByEnvironment(@Path("location") String location, @Path("environment") String environment, @Path("subscriptionId") String subscriptionId, @Path("clusterVersion") String clusterVersion, @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.servicefabric.v2017_07_01_preview.ClusterVersions list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions") + Observable> list(@Path("location") String location, @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.servicefabric.v2017_07_01_preview.ClusterVersions listByEnvironment" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions") + Observable> listByEnvironment(@Path("location") String location, @Path("environment") String environment, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get cluster code versions. + * Get cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param subscriptionId The customer subscription identifier + * @param clusterVersion The cluster code version + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterCodeVersionsListResultInner object if successful. + */ + public ClusterCodeVersionsListResultInner get(String location, String subscriptionId, String clusterVersion, String apiVersion) { + return getWithServiceResponseAsync(location, subscriptionId, clusterVersion, apiVersion).toBlocking().single().body(); + } + + /** + * Get cluster code versions. + * Get cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param subscriptionId The customer subscription identifier + * @param clusterVersion The cluster code version + * @param apiVersion The version of the API. + * @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 location, String subscriptionId, String clusterVersion, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(location, subscriptionId, clusterVersion, apiVersion), serviceCallback); + } + + /** + * Get cluster code versions. + * Get cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param subscriptionId The customer subscription identifier + * @param clusterVersion The cluster code version + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable getAsync(String location, String subscriptionId, String clusterVersion, String apiVersion) { + return getWithServiceResponseAsync(location, subscriptionId, clusterVersion, apiVersion).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get cluster code versions. + * Get cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param subscriptionId The customer subscription identifier + * @param clusterVersion The cluster code version + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable> getWithServiceResponseAsync(String location, String subscriptionId, String clusterVersion, String apiVersion) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (clusterVersion == null) { + throw new IllegalArgumentException("Parameter clusterVersion is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.get(location, subscriptionId, clusterVersion, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get cluster code versions by environment. + * Get cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param subscriptionId The customer subscription identifier + * @param clusterVersion The cluster code version + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterCodeVersionsListResultInner object if successful. + */ + public ClusterCodeVersionsListResultInner getByEnvironment(String location, String environment, String subscriptionId, String clusterVersion, String apiVersion) { + return getByEnvironmentWithServiceResponseAsync(location, environment, subscriptionId, clusterVersion, apiVersion).toBlocking().single().body(); + } + + /** + * Get cluster code versions by environment. + * Get cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param subscriptionId The customer subscription identifier + * @param clusterVersion The cluster code version + * @param apiVersion The version of the API. + * @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 getByEnvironmentAsync(String location, String environment, String subscriptionId, String clusterVersion, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByEnvironmentWithServiceResponseAsync(location, environment, subscriptionId, clusterVersion, apiVersion), serviceCallback); + } + + /** + * Get cluster code versions by environment. + * Get cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param subscriptionId The customer subscription identifier + * @param clusterVersion The cluster code version + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable getByEnvironmentAsync(String location, String environment, String subscriptionId, String clusterVersion, String apiVersion) { + return getByEnvironmentWithServiceResponseAsync(location, environment, subscriptionId, clusterVersion, apiVersion).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get cluster code versions by environment. + * Get cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param subscriptionId The customer subscription identifier + * @param clusterVersion The cluster code version + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable> getByEnvironmentWithServiceResponseAsync(String location, String environment, String subscriptionId, String clusterVersion, String apiVersion) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (environment == null) { + throw new IllegalArgumentException("Parameter environment is required and cannot be null."); + } + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (clusterVersion == null) { + throw new IllegalArgumentException("Parameter clusterVersion is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.getByEnvironment(location, environment, subscriptionId, clusterVersion, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByEnvironmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByEnvironmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List cluster code versions by location. + * List cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterCodeVersionsListResultInner object if successful. + */ + public ClusterCodeVersionsListResultInner list(String location, String subscriptionId, String apiVersion) { + return listWithServiceResponseAsync(location, subscriptionId, apiVersion).toBlocking().single().body(); + } + + /** + * List cluster code versions by location. + * List cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @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 location, String subscriptionId, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(location, subscriptionId, apiVersion), serviceCallback); + } + + /** + * List cluster code versions by location. + * List cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable listAsync(String location, String subscriptionId, String apiVersion) { + return listWithServiceResponseAsync(location, subscriptionId, apiVersion).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List cluster code versions by location. + * List cluster code versions by location. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable> listWithServiceResponseAsync(String location, String subscriptionId, String apiVersion) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.list(location, subscriptionId, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List cluster code versions by environment. + * List cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterCodeVersionsListResultInner object if successful. + */ + public ClusterCodeVersionsListResultInner listByEnvironment(String location, String environment, String subscriptionId, String apiVersion) { + return listByEnvironmentWithServiceResponseAsync(location, environment, subscriptionId, apiVersion).toBlocking().single().body(); + } + + /** + * List cluster code versions by environment. + * List cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @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 listByEnvironmentAsync(String location, String environment, String subscriptionId, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByEnvironmentWithServiceResponseAsync(location, environment, subscriptionId, apiVersion), serviceCallback); + } + + /** + * List cluster code versions by environment. + * List cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable listByEnvironmentAsync(String location, String environment, String subscriptionId, String apiVersion) { + return listByEnvironmentWithServiceResponseAsync(location, environment, subscriptionId, apiVersion).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List cluster code versions by environment. + * List cluster code versions by environment. + * + * @param location The location for the cluster code versions, this is different from cluster location + * @param environment Cluster operating system, the default means all. Possible values include: 'Windows', 'Linux' + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable> listByEnvironmentWithServiceResponseAsync(String location, String environment, String subscriptionId, String apiVersion) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (environment == null) { + throw new IllegalArgumentException("Parameter environment is required and cannot be null."); + } + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.listByEnvironment(location, environment, subscriptionId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByEnvironmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByEnvironmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClustersImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClustersImpl.java new file mode 100644 index 000000000000..cb4f976c113c --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClustersImpl.java @@ -0,0 +1,105 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.Clusters; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.Cluster; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.Page; + +class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { + protected ClustersImpl(ServiceFabricManager manager) { + super(manager.inner().clusters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public ClusterImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion) { + ClustersInner client = this.inner(); + return client.deleteAsync(resourceGroupName, clusterName, subscriptionId, apiVersion).toCompletable(); + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion) { + ClustersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, clusterName, subscriptionId, apiVersion) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return new ClusterImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName, String subscriptionId, String apiVersion) { + ClustersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName, subscriptionId, apiVersion) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return new ClusterImpl(inner.name(), inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String subscriptionId, String apiVersion) { + ClustersInner client = this.inner(); + return client.listAsync(subscriptionId, apiVersion) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return new ClusterImpl(inner.name(), inner, manager()); + } + }); + } + + @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()); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClustersInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClustersInner.java new file mode 100644 index 000000000000..bf6df9099203 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ClustersInner.java @@ -0,0 +1,878 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterUpdateParameters; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ErrorModelException; +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.PATCH; +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 Clusters. + */ +public class ClustersInner { + /** The Retrofit service to perform REST calls. */ + private ClustersService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl 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, ServiceFabricManagementClientImpl 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.servicefabric.v2017_07_01_preview.Clusters create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterInner 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.servicefabric.v2017_07_01_preview.Clusters beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterInner 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.servicefabric.v2017_07_01_preview.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.servicefabric.v2017_07_01_preview.Clusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.servicefabric.v2017_07_01_preview.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterUpdateParameters 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.servicefabric.v2017_07_01_preview.Clusters beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Body ClusterUpdateParameters 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.servicefabric.v2017_07_01_preview.Clusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.servicefabric.v2017_07_01_preview.Clusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create a ServiceFabric cluster. + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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, String subscriptionId, String apiVersion, ClusterInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters).toBlocking().last().body(); + } + + /** + * Create a ServiceFabric cluster. + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The cluster resource. + * @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 subscriptionId, String apiVersion, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters), serviceCallback); + } + + /** + * Create a ServiceFabric cluster. + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a ServiceFabric cluster. + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterInner parameters) { + 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 (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create a ServiceFabric cluster. + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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, String subscriptionId, String apiVersion, ClusterInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters).toBlocking().single().body(); + } + + /** + * Create a ServiceFabric cluster. + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The cluster resource. + * @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 subscriptionId, String apiVersion, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters), serviceCallback); + } + + /** + * Create a ServiceFabric cluster. + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create a ServiceFabric cluster. + * Create cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterInner parameters) { + 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 (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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(resourceGroupName, clusterName, subscriptionId, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Delete cluster resource. + * Delete cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 subscriptionId, String apiVersion) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion).toBlocking().single().body(); + } + + /** + * Delete cluster resource. + * Delete cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @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 subscriptionId, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion), serviceCallback); + } + + /** + * Delete cluster resource. + * Delete cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete cluster resource. + * Delete cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion) { + 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 (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.delete(resourceGroupName, clusterName, subscriptionId, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Get cluster resource. + * Get cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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, String subscriptionId, String apiVersion) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion).toBlocking().single().body(); + } + + /** + * Get cluster resource. + * Get cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @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, String subscriptionId, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion), serviceCallback); + } + + /** + * Get cluster resource. + * Get cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get cluster resource. + * Get cluster resource. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion) { + 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 (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, clusterName, subscriptionId, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Update cluster configuration. + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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, String subscriptionId, String apiVersion, ClusterUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters).toBlocking().last().body(); + } + + /** + * Update cluster configuration. + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The parameters which contains the property value and property name which used to update 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 updateAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters), serviceCallback); + } + + /** + * Update cluster configuration. + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update cluster configuration. + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterUpdateParameters parameters) { + 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 (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update cluster configuration. + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 beginUpdate(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters).toBlocking().single().body(); + } + + /** + * Update cluster configuration. + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The parameters which contains the property value and property name which used to update 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 beginUpdateAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters), serviceCallback); + } + + /** + * Update cluster configuration. + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterUpdateParameters parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, subscriptionId, apiVersion, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update cluster configuration. + * Update cluster configuration. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param parameters The parameters which contains the property value and property name which used to update the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, String subscriptionId, String apiVersion, ClusterUpdateParameters parameters) { + 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 (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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(resourceGroupName, clusterName, subscriptionId, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * List cluster resource by resource group. + * List cluster resource by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName, String subscriptionId, String apiVersion) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName, subscriptionId, apiVersion).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * List cluster resource by resource group. + * List cluster resource by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, String subscriptionId, String apiVersion, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName, subscriptionId, apiVersion), serviceCallback); + } + + /** + * List cluster resource by resource group. + * List cluster resource by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @return the observable to the List<ClusterInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName, String subscriptionId, String apiVersion) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, subscriptionId, apiVersion).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * List cluster resource by resource group. + * List cluster resource by resource group. + * + * @param resourceGroupName The name of the resource group. + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @return the observable to the List<ClusterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName, String subscriptionId, String apiVersion) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, subscriptionId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * List cluster resource. + * List cluster resource. + * + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @return the PagedList object if successful. + */ + public PagedList list(String subscriptionId, String apiVersion) { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync(subscriptionId, apiVersion).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * List cluster resource. + * List cluster resource. + * + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String subscriptionId, String apiVersion, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(subscriptionId, apiVersion), serviceCallback); + } + + /** + * List cluster resource. + * List cluster resource. + * + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @return the observable to the List<ClusterInner> object + */ + public Observable> listAsync(String subscriptionId, String apiVersion) { + return listWithServiceResponseAsync(subscriptionId, apiVersion).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * List cluster resource. + * List cluster resource. + * + * @param subscriptionId The customer subscription identifier + * @param apiVersion The version of the API. + * @return the observable to the List<ClusterInner> object + */ + public Observable>> listWithServiceResponseAsync(String subscriptionId, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.list(subscriptionId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/IdParsingUtils.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..68ad55463f02 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_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.servicefabric.v2017_07_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/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationResultImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationResultImpl.java new file mode 100644 index 000000000000..f0bfd5843530 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationResultImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.OperationResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.AvailableOperationDisplay; + +class OperationResultImpl extends WrapperImpl implements OperationResult { + private final ServiceFabricManager manager; + OperationResultImpl(OperationResultInner inner, ServiceFabricManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public AvailableOperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationResultInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationResultInner.java new file mode 100644 index 000000000000..d8449c1e1411 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationResultInner.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.AvailableOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Available operation list result. + */ +public class OperationResultInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private AvailableOperationDisplay display; + + /** + * Origin result. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the operation. + * + * @param name the name value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public AvailableOperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withDisplay(AvailableOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin result. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin result. + * + * @param origin the origin value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the URL to use for getting the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationsImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..1296addfe92f --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.OperationResult; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ServiceFabricManager manager; + + OperationsImpl(ServiceFabricManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public Observable listAsync(final String apiVersion) { + OperationsInner client = this.inner(); + return client.listAsync(apiVersion) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationResult call(OperationResultInner inner) { + return new OperationResultImpl(inner, manager()); + } + }); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationsInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..2e77c9fd01c2 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/OperationsInner.java @@ -0,0 +1,288 @@ +/** + * 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.servicefabric.v2017_07_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.servicefabric.v2017_07_01_preview.ErrorModelException; +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 ServiceFabricManagementClientImpl 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, ServiceFabricManagementClientImpl 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.servicefabric.v2017_07_01_preview.Operations list" }) + @GET("providers/Microsoft.ServiceFabric/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.servicefabric.v2017_07_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 ServiceFabric Resource Manager REST API operations. + * + * @param apiVersion The version of the ServiceFabric resouce provider api + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<OperationResultInner> object if successful. + */ + public PagedList list(final String apiVersion) { + ServiceResponse> response = listSinglePageAsync(apiVersion).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available ServiceFabric Resource Manager REST API operations. + * + * @param apiVersion The version of the ServiceFabric resouce provider api + * @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 apiVersion, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(apiVersion), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available ServiceFabric Resource Manager REST API operations. + * + * @param apiVersion The version of the ServiceFabric resouce provider api + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> object + */ + public Observable> listAsync(final String apiVersion) { + return listWithServiceResponseAsync(apiVersion) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available ServiceFabric Resource Manager REST API operations. + * + * @param apiVersion The version of the ServiceFabric resouce provider api + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> object + */ + public Observable>> listWithServiceResponseAsync(final String apiVersion) { + return listSinglePageAsync(apiVersion) + .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 ServiceFabric Resource Manager REST API operations. + * + ServiceResponse> * @param apiVersion The version of the ServiceFabric resouce provider api + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String apiVersion) { + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.list(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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Lists all of the available ServiceFabric Resource Manager REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<OperationResultInner> 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 ServiceFabric Resource Manager 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 ServiceFabric Resource Manager 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<OperationResultInner> 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 ServiceFabric Resource Manager 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<OperationResultInner> 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 ServiceFabric Resource Manager 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<OperationResultInner> 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/PageImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..bcdf33bbabbd --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_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.servicefabric.v2017_07_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("") + 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/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/PageImpl1.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/PageImpl1.java new file mode 100644 index 000000000000..af78c4d81ac3 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/PageImpl1.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.servicefabric.v2017_07_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 PageImpl1 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 PageImpl1 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 PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceFabricManagementClientImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceFabricManagementClientImpl.java new file mode 100644 index 000000000000..7042a014ed48 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceFabricManagementClientImpl.java @@ -0,0 +1,188 @@ +/** + * 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.servicefabric.v2017_07_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 ServiceFabricManagementClientImpl class. + */ +public class ServiceFabricManagementClientImpl 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 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 ServiceFabricManagementClientImpl 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 ServiceFabricManagementClientImpl 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 ServiceFabricManagementClientImpl 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 ClusterVersionsInner object to access its operations. + */ + private ClusterVersionsInner clusterVersions; + + /** + * Gets the ClusterVersionsInner object to access its operations. + * @return the ClusterVersionsInner object. + */ + public ClusterVersionsInner clusterVersions() { + return this.clusterVersions; + } + + /** + * 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 ServiceFabricManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ServiceFabricManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ServiceFabricManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ServiceFabricManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ServiceFabricManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ServiceFabricManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.clusterVersions = new ClusterVersionsInner(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(), "ServiceFabricManagementClient", "2017-07-01-preview"); + } +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceFabricManager.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceFabricManager.java new file mode 100644 index 000000000000..468e908cca86 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceFabricManager.java @@ -0,0 +1,120 @@ +/** + * 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.servicefabric.v2017_07_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.servicefabric.v2017_07_01_preview.Clusters; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ClusterVersions; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ServiceFabric resource management. + */ +public final class ServiceFabricManager extends ManagerCore { + private Clusters clusters; + private ClusterVersions clusterVersions; + private Operations operations; + /** + * Get a Configurable instance that can be used to create ServiceFabricManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ServiceFabricManager.ConfigurableImpl(); + } + /** + * Creates an instance of ServiceFabricManager that exposes ServiceFabric resource management API entry points. + * + * @param credentials the credentials to use + * @return the ServiceFabricManager + */ + public static ServiceFabricManager authenticate(AzureTokenCredentials credentials) { + return new ServiceFabricManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build()); + } + /** + * Creates an instance of ServiceFabricManager that exposes ServiceFabric resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @return the ServiceFabricManager + */ + public static ServiceFabricManager authenticate(RestClient restClient) { + return new ServiceFabricManager(restClient); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ServiceFabricManager that exposes ServiceFabric management API entry points. + * + * @param credentials the credentials to use + * @return the interface exposing ServiceFabric management API entry points that work across subscriptions + */ + ServiceFabricManager authenticate(AzureTokenCredentials credentials); + } + + /** + * @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 ClusterVersions. + */ + public ClusterVersions clusterVersions() { + if (this.clusterVersions == null) { + this.clusterVersions = new ClusterVersionsImpl(this); + } + return this.clusterVersions; + } + + /** + * @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 ServiceFabricManager authenticate(AzureTokenCredentials credentials) { + return ServiceFabricManager.authenticate(buildRestClient(credentials)); + } + } + private ServiceFabricManager(RestClient restClient) { + super( + restClient, + null, + new ServiceFabricManagementClientImpl(restClient)); + } +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceImpl.java new file mode 100644 index 000000000000..b01fc1f75e05 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceImpl.java @@ -0,0 +1,251 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServiceResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServiceCorrelationDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServiceLoadMetricDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServicePlacementPolicyDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.PartitionSchemeDescription; +import rx.functions.Func1; + +class ServiceResourceImpl extends CreatableUpdatableImpl implements ServiceResource, ServiceResource.Definition, ServiceResource.Update { + private final ServiceFabricManager manager; + private String subscriptionId; + private String resourceGroupName; + private String clusterName; + private String applicationName; + private String serviceName; + private String capiVersion; + private String uapiVersion; + private ServiceResourceUpdateInner updateParameter; + + ServiceResourceImpl(String name, ServiceFabricManager manager) { + super(name, new ServiceResourceInner()); + this.manager = manager; + // Set resource name + this.serviceName = name; + // + this.updateParameter = new ServiceResourceUpdateInner(); + } + + ServiceResourceImpl(ServiceResourceInner inner, ServiceFabricManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.serviceName = inner.name(); + // set resource ancestor and positional variables + this.subscriptionId = IdParsingUtils.getValueFromIdByName(inner.id(), "subscriptions"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.applicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "applications"); + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + // + this.updateParameter = new ServiceResourceUpdateInner(); + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.putAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationName, this.serviceName, this.capiVersion, this.inner()) + .map(new Func1() { + @Override + public ServiceResourceInner call(ServiceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ServicesInner client = this.manager().inner().services(); + return client.patchAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationName, this.serviceName, this.uapiVersion, this.updateParameter) + .map(new Func1() { + @Override + public ServiceResourceInner call(ServiceResourceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ServicesInner client = this.manager().inner().services(); + return client.getAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationName, this.serviceName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ServiceResourceUpdateInner(); + } + + @Override + public List correlationScheme() { + return this.inner().correlationScheme(); + } + + @Override + public String defaultMoveCost() { + return this.inner().defaultMoveCost(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PartitionSchemeDescription partitionDescription() { + return this.inner().partitionDescription(); + } + + @Override + public String placementConstraints() { + return this.inner().placementConstraints(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List serviceLoadMetrics() { + return this.inner().serviceLoadMetrics(); + } + + @Override + public List servicePlacementPolicies() { + return this.inner().servicePlacementPolicies(); + } + + @Override + public String serviceTypeName() { + return this.inner().serviceTypeName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ServiceResourceImpl withExistingApplication(String subscriptionId, String resourceGroupName, String clusterName, String applicationName) { + this.subscriptionId = subscriptionId; + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.applicationName = applicationName; + return this; + } + + @Override + public ServiceResourceImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ServiceResourceImpl withPartitionDescription(PartitionSchemeDescription partitionDescription) { + this.inner().withPartitionDescription(partitionDescription); + return this; + } + + @Override + public ServiceResourceImpl withServiceTypeName(String serviceTypeName) { + this.inner().withServiceTypeName(serviceTypeName); + return this; + } + + @Override + public ServiceResourceImpl withApiVersion(String apiVersion) { + if (isInCreateMode()) { + this.capiVersion = apiVersion; + } else { + this.uapiVersion = apiVersion; + } + return this; + } + + @Override + public ServiceResourceImpl withCorrelationScheme(List correlationScheme) { + if (isInCreateMode()) { + this.inner().withCorrelationScheme(correlationScheme); + } else { + this.updateParameter.withCorrelationScheme(correlationScheme); + } + return this; + } + + @Override + public ServiceResourceImpl withDefaultMoveCost(String defaultMoveCost) { + if (isInCreateMode()) { + this.inner().withDefaultMoveCost(defaultMoveCost); + } else { + this.updateParameter.withDefaultMoveCost(defaultMoveCost); + } + return this; + } + + @Override + public ServiceResourceImpl withPlacementConstraints(String placementConstraints) { + if (isInCreateMode()) { + this.inner().withPlacementConstraints(placementConstraints); + } else { + this.updateParameter.withPlacementConstraints(placementConstraints); + } + return this; + } + + @Override + public ServiceResourceImpl withServiceLoadMetrics(List serviceLoadMetrics) { + if (isInCreateMode()) { + this.inner().withServiceLoadMetrics(serviceLoadMetrics); + } else { + this.updateParameter.withServiceLoadMetrics(serviceLoadMetrics); + } + return this; + } + + @Override + public ServiceResourceImpl withServicePlacementPolicies(List servicePlacementPolicies) { + if (isInCreateMode()) { + this.inner().withServicePlacementPolicies(servicePlacementPolicies); + } else { + this.updateParameter.withServicePlacementPolicies(servicePlacementPolicies); + } + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceInner.java new file mode 100644 index 000000000000..8a92fc4f23e7 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceInner.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.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServiceCorrelationDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServiceLoadMetricDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServicePlacementPolicyDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.PartitionSchemeDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The service resource. + */ +@JsonFlatten +public class ServiceResourceInner extends ProxyResource { + /** + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "properties.placementConstraints") + private String placementConstraints; + + /** + * The correlationScheme property. + */ + @JsonProperty(value = "properties.correlationScheme") + private List correlationScheme; + + /** + * The serviceLoadMetrics property. + */ + @JsonProperty(value = "properties.serviceLoadMetrics") + private List serviceLoadMetrics; + + /** + * The servicePlacementPolicies property. + */ + @JsonProperty(value = "properties.servicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * Possible values include: 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "properties.defaultMoveCost") + private String defaultMoveCost; + + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The name of the service type. + */ + @JsonProperty(value = "properties.serviceTypeName") + private String serviceTypeName; + + /** + * The partitionDescription property. + */ + @JsonProperty(value = "properties.partitionDescription") + private PartitionSchemeDescription partitionDescription; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + * + * @param placementConstraints the placementConstraints value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme value. + * + * @return the correlationScheme value + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme value. + * + * @param correlationScheme the correlationScheme value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics value. + * + * @return the serviceLoadMetrics value + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics value. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies value. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies value. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @return the defaultMoveCost value + */ + public String defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @param defaultMoveCost the defaultMoveCost value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withDefaultMoveCost(String defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + + /** + * Get the current deployment or provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the name of the service type. + * + * @return the serviceTypeName value + */ + public String serviceTypeName() { + return this.serviceTypeName; + } + + /** + * Set the name of the service type. + * + * @param serviceTypeName the serviceTypeName value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServiceTypeName(String serviceTypeName) { + this.serviceTypeName = serviceTypeName; + return this; + } + + /** + * Get the partitionDescription value. + * + * @return the partitionDescription value + */ + public PartitionSchemeDescription partitionDescription() { + return this.partitionDescription; + } + + /** + * Set the partitionDescription value. + * + * @param partitionDescription the partitionDescription value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withPartitionDescription(PartitionSchemeDescription partitionDescription) { + this.partitionDescription = partitionDescription; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceListImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceListImpl.java new file mode 100644 index 000000000000..d997242f53eb --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceListImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServiceResourceList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ServiceResourceListImpl extends WrapperImpl implements ServiceResourceList { + private final ServiceFabricManager manager; + ServiceResourceListImpl(ServiceResourceListInner inner, ServiceFabricManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceListInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceListInner.java new file mode 100644 index 000000000000..41f5ac9b8a73 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceListInner.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.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of service resources. + */ +public class ServiceResourceListInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ServiceResourceListInner object itself. + */ + public ServiceResourceListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceUpdateInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceUpdateInner.java new file mode 100644 index 000000000000..15343a7ea102 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServiceResourceUpdateInner.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. + */ + +package com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServiceCorrelationDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServiceLoadMetricDescription; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServicePlacementPolicyDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The service resource for patch operations. + */ +@JsonFlatten +public class ServiceResourceUpdateInner extends ProxyResource { + /** + * The placement constraints as a string. Placement constraints are boolean + * expressions on node properties and allow for restricting a service to + * particular nodes based on the service requirements. For example, to + * place a service on nodes where NodeType is blue specify the following: + * "NodeColor == blue)". + */ + @JsonProperty(value = "properties.placementConstraints") + private String placementConstraints; + + /** + * The correlationScheme property. + */ + @JsonProperty(value = "properties.correlationScheme") + private List correlationScheme; + + /** + * The serviceLoadMetrics property. + */ + @JsonProperty(value = "properties.serviceLoadMetrics") + private List serviceLoadMetrics; + + /** + * The servicePlacementPolicies property. + */ + @JsonProperty(value = "properties.servicePlacementPolicies") + private List servicePlacementPolicies; + + /** + * Possible values include: 'Zero', 'Low', 'Medium', 'High'. + */ + @JsonProperty(value = "properties.defaultMoveCost") + private String defaultMoveCost; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + * + * @return the placementConstraints value + */ + public String placementConstraints() { + return this.placementConstraints; + } + + /** + * Set the placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + * + * @param placementConstraints the placementConstraints value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withPlacementConstraints(String placementConstraints) { + this.placementConstraints = placementConstraints; + return this; + } + + /** + * Get the correlationScheme value. + * + * @return the correlationScheme value + */ + public List correlationScheme() { + return this.correlationScheme; + } + + /** + * Set the correlationScheme value. + * + * @param correlationScheme the correlationScheme value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withCorrelationScheme(List correlationScheme) { + this.correlationScheme = correlationScheme; + return this; + } + + /** + * Get the serviceLoadMetrics value. + * + * @return the serviceLoadMetrics value + */ + public List serviceLoadMetrics() { + return this.serviceLoadMetrics; + } + + /** + * Set the serviceLoadMetrics value. + * + * @param serviceLoadMetrics the serviceLoadMetrics value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withServiceLoadMetrics(List serviceLoadMetrics) { + this.serviceLoadMetrics = serviceLoadMetrics; + return this; + } + + /** + * Get the servicePlacementPolicies value. + * + * @return the servicePlacementPolicies value + */ + public List servicePlacementPolicies() { + return this.servicePlacementPolicies; + } + + /** + * Set the servicePlacementPolicies value. + * + * @param servicePlacementPolicies the servicePlacementPolicies value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withServicePlacementPolicies(List servicePlacementPolicies) { + this.servicePlacementPolicies = servicePlacementPolicies; + return this; + } + + /** + * Get possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @return the defaultMoveCost value + */ + public String defaultMoveCost() { + return this.defaultMoveCost; + } + + /** + * Set possible values include: 'Zero', 'Low', 'Medium', 'High'. + * + * @param defaultMoveCost the defaultMoveCost value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withDefaultMoveCost(String defaultMoveCost) { + this.defaultMoveCost = defaultMoveCost; + return this; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the ServiceResourceUpdateInner object itself. + */ + public ServiceResourceUpdateInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServicesImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServicesImpl.java new file mode 100644 index 000000000000..5f116c5d31d7 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServicesImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.Services; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServiceResourceList; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ServiceResource; + +class ServicesImpl extends WrapperImpl implements Services { + private final ServiceFabricManager manager; + + ServicesImpl(ServiceFabricManager manager) { + super(manager.inner().services()); + this.manager = manager; + } + + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public ServiceResourceImpl define(String name) { + return wrapModel(name); + } + + private ServiceResourceImpl wrapModel(ServiceResourceInner inner) { + return new ServiceResourceImpl(inner, manager()); + } + + private ServiceResourceImpl wrapModel(String name) { + return new ServiceResourceImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + ServicesInner client = this.inner(); + return client.listAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion) + .map(new Func1() { + @Override + public ServiceResourceList call(ServiceResourceListInner inner) { + return new ServiceResourceListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + ServicesInner client = this.inner(); + return client.getAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion) + .map(new Func1() { + @Override + public ServiceResource call(ServiceResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + ServicesInner client = this.inner(); + return client.deleteAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion).toCompletable(); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServicesInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServicesInner.java new file mode 100644 index 000000000000..6323ddd9dd7a --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/ServicesInner.java @@ -0,0 +1,930 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ErrorModelException; +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.PATCH; +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 Services. + */ +public class ServicesInner { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServicesInner(Retrofit retrofit, ServiceFabricManagementClientImpl client) { + this.service = retrofit.create(ServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Services to be + * used by Retrofit to perform actually REST calls. + */ + interface ServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.v2017_07_01_preview.Services get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @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.servicefabric.v2017_07_01_preview.Services put" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + Observable> put(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner 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.servicefabric.v2017_07_01_preview.Services beginPut" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + Observable> beginPut(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner 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.servicefabric.v2017_07_01_preview.Services patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + Observable> patch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceUpdateInner 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.servicefabric.v2017_07_01_preview.Services beginPatch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}") + Observable> beginPatch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceUpdateInner 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.servicefabric.v2017_07_01_preview.Services delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @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.servicefabric.v2017_07_01_preview.Services beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationName") String applicationName, @Path("serviceName") String serviceName, @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.servicefabric.v2017_07_01_preview.Services list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services") + Observable> list(@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); + + } + + /** + * Returns a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceInner object if successful. + */ + public ServiceResourceInner get(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + return getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion).toBlocking().single().body(); + } + + /** + * Returns a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion), serviceCallback); + } + + /** + * Returns a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + return getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion).map(new Func1, ServiceResourceInner>() { + @Override + public ServiceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable> getWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.get(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Creates or updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceInner object if successful. + */ + public ServiceResourceInner put(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceInner parameters) { + return putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource. + * @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 putAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters), serviceCallback); + } + + /** + * Creates or updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceInner parameters) { + return putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters).map(new Func1, ServiceResourceInner>() { + @Override + public ServiceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceInner parameters) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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.put(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceInner object if successful. + */ + public ServiceResourceInner beginPut(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceInner parameters) { + return beginPutWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource. + * @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 beginPutAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters), serviceCallback); + } + + /** + * Creates or updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable beginPutAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceInner parameters) { + return beginPutWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters).map(new Func1, ServiceResourceInner>() { + @Override + public ServiceResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceInner object + */ + public Observable> beginPutWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceInner parameters) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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.beginPut(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceUpdateInner object if successful. + */ + public ServiceResourceUpdateInner patch(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceUpdateInner parameters) { + return patchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters).toBlocking().last().body(); + } + + /** + * Updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource for patch 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 patchAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters), serviceCallback); + } + + /** + * Updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable patchAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceUpdateInner parameters) { + return patchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters).map(new Func1, ServiceResourceUpdateInner>() { + @Override + public ServiceResourceUpdateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> patchWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceUpdateInner parameters) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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.patch(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceUpdateInner object if successful. + */ + public ServiceResourceUpdateInner beginPatch(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceUpdateInner parameters) { + return beginPatchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters).toBlocking().single().body(); + } + + /** + * Updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource for patch 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 beginPatchAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceUpdateInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPatchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters), serviceCallback); + } + + /** + * Updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceUpdateInner object + */ + public Observable beginPatchAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceUpdateInner parameters) { + return beginPatchWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters).map(new Func1, ServiceResourceUpdateInner>() { + @Override + public ServiceResourceUpdateInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @param parameters The service resource for patch operations. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceUpdateInner object + */ + public Observable> beginPatchWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, ServiceResourceUpdateInner parameters) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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.beginPatch(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPatchDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion).toBlocking().last().body(); + } + + /** + * Deletes a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion), serviceCallback); + } + + /** + * Deletes a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + return deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + Observable> observable = service.delete(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion).toBlocking().single().body(); + } + + /** + * Deletes a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion), serviceCallback); + } + + /** + * Deletes a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + return beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a service resource with the specified name. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param serviceName The name of the service resource in the format of {applicationName}~{serviceName}. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String serviceName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.beginDelete(subscriptionId, resourceGroupName, clusterName, applicationName, serviceName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Returns all service resources in the specified application. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceListInner object if successful. + */ + public ServiceResourceListInner list(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + return listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion).toBlocking().single().body(); + } + + /** + * Returns all service resources in the specified application. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion), serviceCallback); + } + + /** + * Returns all service resources in the specified application. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceListInner object + */ + public Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + return listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationName, apiVersion).map(new Func1, ServiceResourceListInner>() { + @Override + public ServiceResourceListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns all service resources in the specified application. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationName The name of the application resource. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceListInner object + */ + public Observable> listWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.list(subscriptionId, resourceGroupName, clusterName, applicationName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceImpl.java new file mode 100644 index 000000000000..f6eb83063f4f --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceImpl.java @@ -0,0 +1,146 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.VersionResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationParameter; + +class VersionResourceImpl extends CreatableUpdatableImpl implements VersionResource, VersionResource.Definition, VersionResource.Update { + private final ServiceFabricManager manager; + private String subscriptionId; + private String resourceGroupName; + private String clusterName; + private String applicationTypeName; + private String version; + private String capiVersion; + private String uapiVersion; + + VersionResourceImpl(String name, ServiceFabricManager manager) { + super(name, new VersionResourceInner()); + this.manager = manager; + // Set resource name + this.version = name; + // + } + + VersionResourceImpl(VersionResourceInner inner, ServiceFabricManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.version = inner.name(); + // set resource ancestor and positional variables + this.subscriptionId = IdParsingUtils.getValueFromIdByName(inner.id(), "subscriptions"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.clusterName = IdParsingUtils.getValueFromIdByName(inner.id(), "clusters"); + this.applicationTypeName = IdParsingUtils.getValueFromIdByName(inner.id(), "applicationTypes"); + this.version = IdParsingUtils.getValueFromIdByName(inner.id(), "versions"); + // + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + VersionsInner client = this.manager().inner().versions(); + return client.putAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationTypeName, this.version, this.capiVersion, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + VersionsInner client = this.manager().inner().versions(); + return client.putAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationTypeName, this.version, this.uapiVersion, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + VersionsInner client = this.manager().inner().versions(); + return client.getAsync(this.subscriptionId, this.resourceGroupName, this.clusterName, this.applicationTypeName, this.version); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String appPackageUrl() { + return this.inner().appPackageUrl(); + } + + @Override + public List defaultParameterList() { + return this.inner().defaultParameterList(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public VersionResourceImpl withExistingApplicationType(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName) { + this.subscriptionId = subscriptionId; + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + this.applicationTypeName = applicationTypeName; + return this; + } + + @Override + public VersionResourceImpl withAppPackageUrl(String appPackageUrl) { + this.inner().withAppPackageUrl(appPackageUrl); + return this; + } + + @Override + public VersionResourceImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public VersionResourceImpl withApiVersion(String apiVersion) { + if (isInCreateMode()) { + this.capiVersion = apiVersion; + } else { + this.uapiVersion = apiVersion; + } + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceInner.java new file mode 100644 index 000000000000..e527e038fb21 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceInner.java @@ -0,0 +1,105 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ApplicationParameter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A version resource for the specified application type name. + */ +@JsonFlatten +public class VersionResourceInner extends ProxyResource { + /** + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The URL to the application package. + */ + @JsonProperty(value = "properties.appPackageUrl", required = true) + private String appPackageUrl; + + /** + * The defaultParameterList property. + */ + @JsonProperty(value = "properties.defaultParameterList", access = JsonProperty.Access.WRITE_ONLY) + private List defaultParameterList; + + /** + * Resource location. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * Get the current deployment or provisioning state, which only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the URL to the application package. + * + * @return the appPackageUrl value + */ + public String appPackageUrl() { + return this.appPackageUrl; + } + + /** + * Set the URL to the application package. + * + * @param appPackageUrl the appPackageUrl value to set + * @return the VersionResourceInner object itself. + */ + public VersionResourceInner withAppPackageUrl(String appPackageUrl) { + this.appPackageUrl = appPackageUrl; + return this; + } + + /** + * Get the defaultParameterList value. + * + * @return the defaultParameterList value + */ + public List defaultParameterList() { + return this.defaultParameterList; + } + + /** + * Get resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set resource location. + * + * @param location the location value to set + * @return the VersionResourceInner object itself. + */ + public VersionResourceInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceListImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceListImpl.java new file mode 100644 index 000000000000..85fe316fe7b3 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceListImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.VersionResourceList; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class VersionResourceListImpl extends WrapperImpl implements VersionResourceList { + private final ServiceFabricManager manager; + VersionResourceListImpl(VersionResourceListInner inner, ServiceFabricManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceListInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceListInner.java new file mode 100644 index 000000000000..776879e02c01 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionResourceListInner.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.servicefabric.v2017_07_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of version resources for the specified application type name. + */ +public class VersionResourceListInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the VersionResourceListInner object itself. + */ + public VersionResourceListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionsImpl.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionsImpl.java new file mode 100644 index 000000000000..3b411125b8e6 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionsImpl.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.servicefabric.v2017_07_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.Versions; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.VersionResourceList; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.VersionResource; + +class VersionsImpl extends WrapperImpl implements Versions { + private final ServiceFabricManager manager; + + VersionsImpl(ServiceFabricManager manager) { + super(manager.inner().versions()); + this.manager = manager; + } + + public ServiceFabricManager manager() { + return this.manager; + } + + @Override + public VersionResourceImpl define(String name) { + return wrapModel(name); + } + + private VersionResourceImpl wrapModel(VersionResourceInner inner) { + return new VersionResourceImpl(inner, manager()); + } + + private VersionResourceImpl wrapModel(String name) { + return new VersionResourceImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + VersionsInner client = this.inner(); + return client.listAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion) + .map(new Func1() { + @Override + public VersionResourceList call(VersionResourceListInner inner) { + return new VersionResourceListImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + VersionsInner client = this.inner(); + return client.getAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion) + .map(new Func1() { + @Override + public VersionResource call(VersionResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + VersionsInner client = this.inner(); + return client.deleteAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion).toCompletable(); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionsInner.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionsInner.java new file mode 100644 index 000000000000..30b9e9a3ffcf --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/VersionsInner.java @@ -0,0 +1,706 @@ +/** + * 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.servicefabric.v2017_07_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicefabric.v2017_07_01_preview.ErrorModelException; +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 Versions. + */ +public class VersionsInner { + /** The Retrofit service to perform REST calls. */ + private VersionsService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of VersionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VersionsInner(Retrofit retrofit, ServiceFabricManagementClientImpl client) { + this.service = retrofit.create(VersionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Versions to be + * used by Retrofit to perform actually REST calls. + */ + interface VersionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.v2017_07_01_preview.Versions get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Path("version") String version, @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.servicefabric.v2017_07_01_preview.Versions put" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}") + Observable> put(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Path("version") String version, @Query("api-version") String apiVersion, @Body VersionResourceInner 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.servicefabric.v2017_07_01_preview.Versions beginPut" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}") + Observable> beginPut(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Path("version") String version, @Query("api-version") String apiVersion, @Body VersionResourceInner 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.servicefabric.v2017_07_01_preview.Versions delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Path("version") String version, @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.servicefabric.v2017_07_01_preview.Versions beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Path("version") String version, @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.servicefabric.v2017_07_01_preview.Versions list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("applicationTypeName") String applicationTypeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VersionResourceInner object if successful. + */ + public VersionResourceInner get(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + return getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion).toBlocking().single().body(); + } + + /** + * Returns an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion), serviceCallback); + } + + /** + * Returns an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VersionResourceInner object + */ + public Observable getAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + return getWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion).map(new Func1, VersionResourceInner>() { + @Override + public VersionResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VersionResourceInner object + */ + public Observable> getWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.get(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Provisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VersionResourceInner object if successful. + */ + public VersionResourceInner put(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, VersionResourceInner parameters) { + return putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion, parameters).toBlocking().last().body(); + } + + /** + * Provisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @param parameters The application type version resource. + * @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 putAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, VersionResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion, parameters), serviceCallback); + } + + /** + * Provisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, VersionResourceInner parameters) { + return putWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion, parameters).map(new Func1, VersionResourceInner>() { + @Override + public VersionResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, VersionResourceInner parameters) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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.put(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Provisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VersionResourceInner object if successful. + */ + public VersionResourceInner beginPut(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, VersionResourceInner parameters) { + return beginPutWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion, parameters).toBlocking().single().body(); + } + + /** + * Provisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @param parameters The application type version resource. + * @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 beginPutAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, VersionResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion, parameters), serviceCallback); + } + + /** + * Provisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VersionResourceInner object + */ + public Observable beginPutAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, VersionResourceInner parameters) { + return beginPutWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion, parameters).map(new Func1, VersionResourceInner>() { + @Override + public VersionResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @param parameters The application type version resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VersionResourceInner object + */ + public Observable> beginPutWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, VersionResourceInner parameters) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter 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.beginPut(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Unprovisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion).toBlocking().last().body(); + } + + /** + * Unprovisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion), serviceCallback); + } + + /** + * Unprovisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + return deleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Unprovisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + Observable> observable = service.delete(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Unprovisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion).toBlocking().single().body(); + } + + /** + * Unprovisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion), serviceCallback); + } + + /** + * Unprovisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + return beginDeleteWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Unprovisions an application type version resource. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param version The application type version. + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String version, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.beginDelete(subscriptionId, resourceGroupName, clusterName, applicationTypeName, version, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Returns all versions for the specified application type. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VersionResourceListInner object if successful. + */ + public VersionResourceListInner list(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + return listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion).toBlocking().single().body(); + } + + /** + * Returns all versions for the specified application type. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @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 subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion), serviceCallback); + } + + /** + * Returns all versions for the specified application type. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VersionResourceListInner object + */ + public Observable listAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + return listWithServiceResponseAsync(subscriptionId, resourceGroupName, clusterName, applicationTypeName, apiVersion).map(new Func1, VersionResourceListInner>() { + @Override + public VersionResourceListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns all versions for the specified application type. + * + * @param subscriptionId The customer subscription identifier + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource + * @param applicationTypeName The name of the application type name resource + * @param apiVersion The version of the API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VersionResourceListInner object + */ + public Observable> listWithServiceResponseAsync(String subscriptionId, String resourceGroupName, String clusterName, String applicationTypeName, String apiVersion) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter 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 (applicationTypeName == null) { + throw new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.list(subscriptionId, resourceGroupName, clusterName, applicationTypeName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/package-info.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..8342980602db --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_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 ServiceFabricManagementClient. + * Service Fabric Management Client. + */ +package com.microsoft.azure.management.servicefabric.v2017_07_01_preview.implementation; diff --git a/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/package-info.java b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_01_preview/package-info.java new file mode 100644 index 000000000000..107293ad33a4 --- /dev/null +++ b/servicefabric/resource-manager/v2017_07_01_preview/src/main/java/com/microsoft/azure/management/servicefabric/v2017_07_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 ServiceFabricManagementClient. + * Service Fabric Management Client. + */ +package com.microsoft.azure.management.servicefabric.v2017_07_01_preview;