From 1c1af9cbacd64b1759b0af59716bba19a2808e76 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 29 Jul 2019 20:51:29 +0000 Subject: [PATCH] Generated from 2380d7af2f3e2d507c5486d8fb6abfd816a65bed change location description in ProxyResource to dcument as deprecated --- .../resource-manager/v2016_09_01/pom.xml | 133 ++ .../AvailableOperationDisplay.java | 121 ++ .../v2016_09_01/AzureActiveDirectory.java | 95 ++ .../v2016_09_01/CertificateDescription.java | 97 ++ .../ClientCertificateCommonName.java | 97 ++ .../ClientCertificateThumbprint.java | 70 ++ .../servicefabric/v2016_09_01/Cluster.java | 452 +++++++ .../ClusterCodeVersionsResult.java | 50 + .../v2016_09_01/ClusterHealthPolicy.java | 74 ++ .../v2016_09_01/ClusterUpdateParameters.java | 319 +++++ .../ClusterUpgradeDeltaHealthPolicy.java | 95 ++ .../v2016_09_01/ClusterUpgradePolicy.java | 280 +++++ .../v2016_09_01/ClusterVersionDetails.java | 95 ++ .../v2016_09_01/ClusterVersions.java | 59 + .../servicefabric/v2016_09_01/Clusters.java | 25 + .../DiagnosticsStorageAccountConfig.java | 147 +++ .../v2016_09_01/EndpointRangeDescription.java | 69 ++ .../servicefabric/v2016_09_01/ErrorModel.java | 43 + .../v2016_09_01/ErrorModelError.java | 69 ++ .../v2016_09_01/ErrorModelException.java | 44 + .../v2016_09_01/NodeTypeDescription.java | 309 +++++ .../v2016_09_01/OperationResult.java | 40 + .../servicefabric/v2016_09_01/Operations.java | 27 + .../v2016_09_01/ProvisioningState.java | 47 + .../SettingsParameterDescription.java | 69 ++ .../SettingsSectionDescription.java | 71 ++ .../ClusterCodeVersionsResultImpl.java | 60 + .../ClusterCodeVersionsResultInner.java | 175 +++ .../implementation/ClusterImpl.java | 297 +++++ .../implementation/ClusterInner.java | 484 ++++++++ .../implementation/ClusterVersionsImpl.java | 101 ++ .../implementation/ClusterVersionsInner.java | 877 ++++++++++++++ .../implementation/ClustersImpl.java | 138 +++ .../implementation/ClustersInner.java | 1072 +++++++++++++++++ .../implementation/IdParsingUtils.java | 57 + .../implementation/OperationResultImpl.java | 47 + .../implementation/OperationResultInner.java | 122 ++ .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 +++++ .../v2016_09_01/implementation/PageImpl.java | 75 ++ .../ServiceFabricManagementClientImpl.java | 224 ++++ .../implementation/ServiceFabricManager.java | 123 ++ .../implementation/package-info.java | 11 + .../v2016_09_01/package-info.java | 11 + 44 files changed, 7203 insertions(+) create mode 100644 servicefabric/resource-manager/v2016_09_01/pom.xml create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/AvailableOperationDisplay.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/AzureActiveDirectory.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/CertificateDescription.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClientCertificateCommonName.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClientCertificateThumbprint.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Cluster.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterCodeVersionsResult.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterHealthPolicy.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpdateParameters.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpgradeDeltaHealthPolicy.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterUpgradePolicy.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterVersionDetails.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ClusterVersions.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Clusters.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/DiagnosticsStorageAccountConfig.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/EndpointRangeDescription.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModel.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModelError.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ErrorModelException.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/NodeTypeDescription.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/OperationResult.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/Operations.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/ProvisioningState.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/SettingsParameterDescription.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/SettingsSectionDescription.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterCodeVersionsResultImpl.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterCodeVersionsResultInner.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterImpl.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterInner.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterVersionsImpl.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClusterVersionsInner.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClustersImpl.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ClustersInner.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/IdParsingUtils.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationResultImpl.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationResultInner.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationsImpl.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/OperationsInner.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/PageImpl.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ServiceFabricManagementClientImpl.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/ServiceFabricManager.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/implementation/package-info.java create mode 100644 servicefabric/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/servicefabric/v2016_09_01/package-info.java 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 0000000000000..8c66688680701 --- /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 0000000000000..27fa7f21aab46 --- /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 0000000000000..aeae31da955a7 --- /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 0000000000000..6b5d57e4d153c --- /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 0000000000000..4f5e6ec072aad --- /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 careful 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 careful using wild card common names. + * + * @return the certificateCommonName value + */ + public String certificateCommonName() { + return this.certificateCommonName; + } + + /** + * Set certificate common name to be granted access; be careful 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 0000000000000..bd5f540725e43 --- /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 0000000000000..306554c975273 --- /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 node types 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 primary 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 primary 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 node types 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 0000000000000..c85dc07ca6ed4 --- /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 0000000000000..c65c627a16a16 --- /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 0000000000000..19b64d5075f2c --- /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 primary 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 node types 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 primary 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 primary 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 node types that make up the cluster, it will override. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of node types 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 0000000000000..a4ff166279da8 --- /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 0000000000000..09673be199abb --- /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 0000000000000..b1686db35fea5 --- /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 0000000000000..0a69c6ee9c41e --- /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 0000000000000..bab50c1c8dac9 --- /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 0000000000000..d15bfe12fa7b1 --- /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 0000000000000..e7afb85c4b34e --- /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 0000000000000..85b55f3ace455 --- /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 0000000000000..a43a818c6f08a --- /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 0000000000000..3737168829b8f --- /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 0000000000000..42a615ae55cb4 --- /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; + + /** + * Node type 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 assigned 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 node type durability Level. Possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @return the durabilityLevel value + */ + public String durabilityLevel() { + return this.durabilityLevel; + } + + /** + * Set node type 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 assigned application ports. + * + * @return the ephemeralPorts value + */ + public EndpointRangeDescription ephemeralPorts() { + return this.ephemeralPorts; + } + + /** + * Set system assigned 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 0000000000000..c7f7cbdfe61d8 --- /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 0000000000000..f809f0dc4ddc9 --- /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 0000000000000..523738410f720 --- /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 0000000000000..59963838cbb3c --- /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 0000000000000..bdf92f880884f --- /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 0000000000000..ef05abfc455d6 --- /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 0000000000000..ab0b331e1697b --- /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 0000000000000..d3236e1e68622 --- /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 0000000000000..4eaa38c2f9de0 --- /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 primary 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 node types 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 primary 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 primary 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 node types that make up the cluster. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of node types 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 0000000000000..c4a3c663ee3d9 --- /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 0000000000000..3cd98554f05e1 --- /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 0000000000000..1d9952d53c6e5 --- /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 0000000000000..53f9560dd1c2e --- /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 0000000000000..3fd6689238ca2 --- /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 0000000000000..0ea1869a91e6b --- /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 0000000000000..4e73f175a5c18 --- /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; + + /** + * Display 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 display of the result. + * + * @return the display value + */ + public AvailableOperationDisplay display() { + return this.display; + } + + /** + * Set display 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 0000000000000..d15be2ae2500b --- /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 0000000000000..572f4453d76a5 --- /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 0000000000000..5c817cc90e84a --- /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 0000000000000..3a41073d07491 --- /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 resource provider api. */ + private String apiVersion; + + /** + * Gets The version of the ServiceFabric resource 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 0000000000000..da714d2799de9 --- /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 0000000000000..4aa0cb09d1faf --- /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 0000000000000..c29a2be188086 --- /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;