diff --git a/api-specs.json b/api-specs.json index 3795f24269ae0..27c355ca8ab52 100644 --- a/api-specs.json +++ b/api-specs.json @@ -223,6 +223,10 @@ "source": "specification/resources/resource-manager/readme.md", "args": "--multiapi --fluent" }, + "servicefabric/resource-manager": { + "source": "specification/servicefabric/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, "servicebus/resource-manager": { "source": "specification/servicebus/resource-manager/readme.md", "args": "--multiapi --fluent" diff --git a/servicefabric/resource-manager/v2018_02_01/pom.xml b/servicefabric/resource-manager/v2018_02_01/pom.xml new file mode 100644 index 0000000000000..f711362b446c0 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.servicefabric.v2018_02_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ApplicationDeltaHealthPolicy.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ApplicationDeltaHealthPolicy.java new file mode 100644 index 0000000000000..34492fbad4c09 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ApplicationDeltaHealthPolicy.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a delta health policy used to evaluate the health of an application + * or one of its child entities when upgrading the cluster. + */ +public class ApplicationDeltaHealthPolicy { + /** + * The delta health policy used by default to evaluate the health of a + * service type when upgrading the cluster. + */ + @JsonProperty(value = "defaultServiceTypeDeltaHealthPolicy") + private ServiceTypeDeltaHealthPolicy defaultServiceTypeDeltaHealthPolicy; + + /** + * The map with service type delta health policy per service type name. The + * map is empty by default. + */ + @JsonProperty(value = "serviceTypeDeltaHealthPolicies") + private Map serviceTypeDeltaHealthPolicies; + + /** + * Get the delta health policy used by default to evaluate the health of a service type when upgrading the cluster. + * + * @return the defaultServiceTypeDeltaHealthPolicy value + */ + public ServiceTypeDeltaHealthPolicy defaultServiceTypeDeltaHealthPolicy() { + return this.defaultServiceTypeDeltaHealthPolicy; + } + + /** + * Set the delta health policy used by default to evaluate the health of a service type when upgrading the cluster. + * + * @param defaultServiceTypeDeltaHealthPolicy the defaultServiceTypeDeltaHealthPolicy value to set + * @return the ApplicationDeltaHealthPolicy object itself. + */ + public ApplicationDeltaHealthPolicy withDefaultServiceTypeDeltaHealthPolicy(ServiceTypeDeltaHealthPolicy defaultServiceTypeDeltaHealthPolicy) { + this.defaultServiceTypeDeltaHealthPolicy = defaultServiceTypeDeltaHealthPolicy; + return this; + } + + /** + * Get the map with service type delta health policy per service type name. The map is empty by default. + * + * @return the serviceTypeDeltaHealthPolicies value + */ + public Map serviceTypeDeltaHealthPolicies() { + return this.serviceTypeDeltaHealthPolicies; + } + + /** + * Set the map with service type delta health policy per service type name. The map is empty by default. + * + * @param serviceTypeDeltaHealthPolicies the serviceTypeDeltaHealthPolicies value to set + * @return the ApplicationDeltaHealthPolicy object itself. + */ + public ApplicationDeltaHealthPolicy withServiceTypeDeltaHealthPolicies(Map serviceTypeDeltaHealthPolicies) { + this.serviceTypeDeltaHealthPolicies = serviceTypeDeltaHealthPolicies; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ApplicationHealthPolicy.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ApplicationHealthPolicy.java new file mode 100644 index 0000000000000..a5889b8219363 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ApplicationHealthPolicy.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a health policy used to evaluate the health of an application or one + * of its children entities. + */ +public class ApplicationHealthPolicy { + /** + * The health policy used by default to evaluate the health of a service + * type. + */ + @JsonProperty(value = "defaultServiceTypeHealthPolicy") + private ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy; + + /** + * The map with service type health policy per service type name. The map + * is empty by default. + */ + @JsonProperty(value = "serviceTypeHealthPolicies") + private Map serviceTypeHealthPolicies; + + /** + * Get the health policy used by default to evaluate the health of a service type. + * + * @return the defaultServiceTypeHealthPolicy value + */ + public ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy() { + return this.defaultServiceTypeHealthPolicy; + } + + /** + * Set the health policy used by default to evaluate the health of a service type. + * + * @param defaultServiceTypeHealthPolicy the defaultServiceTypeHealthPolicy value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withDefaultServiceTypeHealthPolicy(ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy) { + this.defaultServiceTypeHealthPolicy = defaultServiceTypeHealthPolicy; + return this; + } + + /** + * Get the map with service type health policy per service type name. The map is empty by default. + * + * @return the serviceTypeHealthPolicies value + */ + public Map serviceTypeHealthPolicies() { + return this.serviceTypeHealthPolicies; + } + + /** + * Set the map with service type health policy per service type name. The map is empty by default. + * + * @param serviceTypeHealthPolicies the serviceTypeHealthPolicies value to set + * @return the ApplicationHealthPolicy object itself. + */ + public ApplicationHealthPolicy withServiceTypeHealthPolicies(Map serviceTypeHealthPolicies) { + this.serviceTypeHealthPolicies = serviceTypeHealthPolicies; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/AvailableOperationDisplay.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/AvailableOperationDisplay.java new file mode 100644 index 0000000000000..4baabff4e9894 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation supported by Service Fabric resource provider. + */ +public class AvailableOperationDisplay { + /** + * The name of the provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation that can be performed. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name of the provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the name of the provider. + * + * @param provider the provider value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation that can be performed. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation that can be performed. + * + * @param operation the operation value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation description. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set operation description. + * + * @param description the description value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/AzureActiveDirectory.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/AzureActiveDirectory.java new file mode 100644 index 0000000000000..d0b1c065c9b95 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/CertificateDescription.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/CertificateDescription.java new file mode 100644 index 0000000000000..59bc73ebaab67 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the certificate details. + */ +public class CertificateDescription { + /** + * Thumbprint of the primary certificate. + */ + @JsonProperty(value = "thumbprint", required = true) + private String thumbprint; + + /** + * Thumbprint of the secondary certificate. + */ + @JsonProperty(value = "thumbprintSecondary") + private String thumbprintSecondary; + + /** + * The local certificate store location. Possible values include: + * 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', + * 'Root', 'TrustedPeople', 'TrustedPublisher'. + */ + @JsonProperty(value = "x509StoreName") + private String x509StoreName; + + /** + * Get thumbprint of the primary certificate. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set thumbprint of the primary certificate. + * + * @param thumbprint the thumbprint value to set + * @return the CertificateDescription object itself. + */ + public CertificateDescription withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get thumbprint of the secondary certificate. + * + * @return the thumbprintSecondary value + */ + public String thumbprintSecondary() { + return this.thumbprintSecondary; + } + + /** + * Set thumbprint of the secondary certificate. + * + * @param thumbprintSecondary the thumbprintSecondary value to set + * @return the CertificateDescription object itself. + */ + public CertificateDescription withThumbprintSecondary(String thumbprintSecondary) { + this.thumbprintSecondary = thumbprintSecondary; + return this; + } + + /** + * Get the local certificate store location. Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher'. + * + * @return the x509StoreName value + */ + public String x509StoreName() { + return this.x509StoreName; + } + + /** + * Set the local certificate store location. Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher'. + * + * @param x509StoreName the x509StoreName value to set + * @return the CertificateDescription object itself. + */ + public CertificateDescription withX509StoreName(String x509StoreName) { + this.x509StoreName = x509StoreName; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClientCertificateCommonName.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClientCertificateCommonName.java new file mode 100644 index 0000000000000..6e0e2f7ac94a8 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClientCertificateCommonName.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the client certificate details using common name. + */ +public class ClientCertificateCommonName { + /** + * Indicates if the client certificate has admin access to the cluster. Non + * admin clients can perform only read only operations on the cluster. + */ + @JsonProperty(value = "isAdmin", required = true) + private boolean isAdmin; + + /** + * The common name of the client certificate. + */ + @JsonProperty(value = "certificateCommonName", required = true) + private String certificateCommonName; + + /** + * The issuer thumbprint of the client certificate. + */ + @JsonProperty(value = "certificateIssuerThumbprint", required = true) + private String certificateIssuerThumbprint; + + /** + * Get indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. + * + * @return the isAdmin value + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. + * + * @param isAdmin the isAdmin value to set + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withIsAdmin(boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get the common name of the client certificate. + * + * @return the certificateCommonName value + */ + public String certificateCommonName() { + return this.certificateCommonName; + } + + /** + * Set the common name of the client certificate. + * + * @param certificateCommonName the certificateCommonName value to set + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withCertificateCommonName(String certificateCommonName) { + this.certificateCommonName = certificateCommonName; + return this; + } + + /** + * Get the issuer thumbprint of the client certificate. + * + * @return the certificateIssuerThumbprint value + */ + public String certificateIssuerThumbprint() { + return this.certificateIssuerThumbprint; + } + + /** + * Set the issuer thumbprint of the client certificate. + * + * @param certificateIssuerThumbprint the certificateIssuerThumbprint value to set + * @return the ClientCertificateCommonName object itself. + */ + public ClientCertificateCommonName withCertificateIssuerThumbprint(String certificateIssuerThumbprint) { + this.certificateIssuerThumbprint = certificateIssuerThumbprint; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClientCertificateThumbprint.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClientCertificateThumbprint.java new file mode 100644 index 0000000000000..dfde6d72683e2 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the client certificate details using thumbprint. + */ +public class ClientCertificateThumbprint { + /** + * Indicates if the client certificate has admin access to the cluster. Non + * admin clients can perform only read only operations on the cluster. + */ + @JsonProperty(value = "isAdmin", required = true) + private boolean isAdmin; + + /** + * The thumbprint of the client certificate. + */ + @JsonProperty(value = "certificateThumbprint", required = true) + private String certificateThumbprint; + + /** + * Get indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. + * + * @return the isAdmin value + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. + * + * @param isAdmin the isAdmin value to set + * @return the ClientCertificateThumbprint object itself. + */ + public ClientCertificateThumbprint withIsAdmin(boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get the thumbprint of the client certificate. + * + * @return the certificateThumbprint value + */ + public String certificateThumbprint() { + return this.certificateThumbprint; + } + + /** + * Set the thumbprint of the client certificate. + * + * @param certificateThumbprint the certificateThumbprint value to set + * @return the ClientCertificateThumbprint object itself. + */ + public ClientCertificateThumbprint withCertificateThumbprint(String certificateThumbprint) { + this.certificateThumbprint = certificateThumbprint; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/Cluster.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/Cluster.java new file mode 100644 index 0000000000000..397296274b821 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/Cluster.java @@ -0,0 +1,545 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_02_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.v2018_02_01.implementation.ServiceFabricManager; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2018_02_01.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the addOnFeatures value. + */ + List addOnFeatures(); + + /** + * @return the availableClusterVersions value. + */ + List availableClusterVersions(); + + /** + * @return the azureActiveDirectory value. + */ + AzureActiveDirectory azureActiveDirectory(); + + /** + * @return the certificate value. + */ + CertificateDescription certificate(); + + /** + * @return the certificateCommonNames value. + */ + ServerCertificateCommonNames certificateCommonNames(); + + /** + * @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 reverseProxyCertificateCommonNames value. + */ + ServerCertificateCommonNames reverseProxyCertificateCommonNames(); + + /** + * @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 in the cluster + * @return the next definition stage +*/ + WithCreate withNodeTypes(List nodeTypes); + } + + /** + * The stage of the cluster definition allowing to specify AddOnFeatures. + */ + interface WithAddOnFeatures { + /** + * Specifies addOnFeatures. + * @param addOnFeatures The list of add-on features to enable in the cluster + * @return the next definition stage + */ + WithCreate withAddOnFeatures(List addOnFeatures); + } + + /** + * The stage of the cluster definition allowing to specify AzureActiveDirectory. + */ + interface WithAzureActiveDirectory { + /** + * Specifies azureActiveDirectory. + * @param azureActiveDirectory The AAD authentication settings of the cluster + * @return the next definition stage + */ + WithCreate withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory); + } + + /** + * The stage of the cluster definition allowing to specify Certificate. + */ + interface WithCertificate { + /** + * Specifies certificate. + * @param certificate The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client + * @return the next definition stage + */ + WithCreate withCertificate(CertificateDescription certificate); + } + + /** + * The stage of the cluster definition allowing to specify CertificateCommonNames. + */ + interface WithCertificateCommonNames { + /** + * Specifies certificateCommonNames. + * @param certificateCommonNames Describes a list of server certificates referenced by common name that are used to secure the cluster + * @return the next definition stage + */ + WithCreate withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames); + } + + /** + * The stage of the cluster definition allowing to specify ClientCertificateCommonNames. + */ + interface WithClientCertificateCommonNames { + /** + * Specifies clientCertificateCommonNames. + * @param clientCertificateCommonNames The list of client certificates referenced by common name that are allowed to manage the cluster + * @return the next definition stage + */ + WithCreate withClientCertificateCommonNames(List clientCertificateCommonNames); + } + + /** + * The stage of the cluster definition allowing to specify ClientCertificateThumbprints. + */ + interface WithClientCertificateThumbprints { + /** + * Specifies clientCertificateThumbprints. + * @param clientCertificateThumbprints The list of client certificates referenced by thumbprint that are allowed to manage the cluster + * @return the next definition stage + */ + WithCreate withClientCertificateThumbprints(List clientCertificateThumbprints); + } + + /** + * The stage of the cluster definition allowing to specify ClusterCodeVersion. + */ + interface WithClusterCodeVersion { + /** + * Specifies clusterCodeVersion. + * @param clusterCodeVersion The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions** + * @return the next definition stage + */ + WithCreate withClusterCodeVersion(String clusterCodeVersion); + } + + /** + * The stage of the cluster definition allowing to specify DiagnosticsStorageAccountConfig. + */ + interface WithDiagnosticsStorageAccountConfig { + /** + * Specifies diagnosticsStorageAccountConfig. + * @param diagnosticsStorageAccountConfig The storage account information for storing Service Fabric diagnostic logs + * @return the next definition stage + */ + WithCreate withDiagnosticsStorageAccountConfig(DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig); + } + + /** + * The stage of the cluster definition allowing to specify FabricSettings. + */ + interface WithFabricSettings { + /** + * Specifies fabricSettings. + * @param fabricSettings The list of custom fabric settings to configure the cluster + * @return the next definition stage + */ + WithCreate withFabricSettings(List fabricSettings); + } + + /** + * The stage of the cluster definition allowing to specify ReliabilityLevel. + */ + interface WithReliabilityLevel { + /** + * Specifies reliabilityLevel. + * @param reliabilityLevel The reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + - None - Run the System services with a target replica set count of 1. This should only be used for test clusters. + - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters. + - Silver - Run the System services with a target replica set count of 5. + - Gold - Run the System services with a target replica set count of 7. + - Platinum - Run the System services with a target replica set count of 9. + . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * @return the next definition stage + */ + WithCreate withReliabilityLevel(String reliabilityLevel); + } + + /** + * The stage of the cluster definition allowing to specify ReverseProxyCertificate. + */ + interface WithReverseProxyCertificate { + /** + * Specifies reverseProxyCertificate. + * @param reverseProxyCertificate The server certificate used by reverse proxy + * @return the next definition stage + */ + WithCreate withReverseProxyCertificate(CertificateDescription reverseProxyCertificate); + } + + /** + * The stage of the cluster definition allowing to specify ReverseProxyCertificateCommonNames. + */ + interface WithReverseProxyCertificateCommonNames { + /** + * Specifies reverseProxyCertificateCommonNames. + * @param reverseProxyCertificateCommonNames Describes a list of server certificates referenced by common name that are used to secure the cluster + * @return the next definition stage + */ + WithCreate withReverseProxyCertificateCommonNames(ServerCertificateCommonNames reverseProxyCertificateCommonNames); + } + + /** + * 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 The upgrade mode of the cluster when new Service Fabric runtime version is available. + - Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon as it is available. + - Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource. + . Possible values include: 'Automatic', 'Manual' + * @return the next definition stage + */ + WithCreate withUpgradeMode(String upgradeMode); + } + + /** + * The stage of the cluster definition allowing to specify VmImage. + */ + interface WithVmImage { + /** + * Specifies vmImage. + * @param vmImage The VM image VMSS has been configured with. Generic names such as Windows or Linux can be used + * @return the next definition stage + */ + WithCreate withVmImage(String vmImage); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAddOnFeatures, DefinitionStages.WithAzureActiveDirectory, DefinitionStages.WithCertificate, DefinitionStages.WithCertificateCommonNames, DefinitionStages.WithClientCertificateCommonNames, DefinitionStages.WithClientCertificateThumbprints, DefinitionStages.WithClusterCodeVersion, DefinitionStages.WithDiagnosticsStorageAccountConfig, DefinitionStages.WithFabricSettings, DefinitionStages.WithReliabilityLevel, DefinitionStages.WithReverseProxyCertificate, DefinitionStages.WithReverseProxyCertificateCommonNames, 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.WithAddOnFeatures, UpdateStages.WithCertificate, UpdateStages.WithCertificateCommonNames, 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 AddOnFeatures. + */ + interface WithAddOnFeatures { + /** + * Specifies addOnFeatures. + * @param addOnFeatures The list of add-on features to enable in the cluster + * @return the next update stage + */ + Update withAddOnFeatures(List addOnFeatures); + } + + /** + * The stage of the cluster update allowing to specify Certificate. + */ + interface WithCertificate { + /** + * Specifies certificate. + * @param certificate The certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client + * @return the next update stage + */ + Update withCertificate(CertificateDescription certificate); + } + + /** + * The stage of the cluster update allowing to specify CertificateCommonNames. + */ + interface WithCertificateCommonNames { + /** + * Specifies certificateCommonNames. + * @param certificateCommonNames Describes a list of server certificates referenced by common name that are used to secure the cluster + * @return the next update stage + */ + Update withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames); + } + + /** + * The stage of the cluster update allowing to specify ClientCertificateCommonNames. + */ + interface WithClientCertificateCommonNames { + /** + * Specifies clientCertificateCommonNames. + * @param clientCertificateCommonNames The list of client certificates referenced by common name that are allowed to manage the cluster. This will overwrite the existing list + * @return the next update stage + */ + Update withClientCertificateCommonNames(List clientCertificateCommonNames); + } + + /** + * The stage of the cluster update allowing to specify ClientCertificateThumbprints. + */ + interface WithClientCertificateThumbprints { + /** + * Specifies clientCertificateThumbprints. + * @param clientCertificateThumbprints The list of client certificates referenced by thumbprint that are allowed to manage the cluster. This will overwrite the existing list + * @return the next update stage + */ + Update withClientCertificateThumbprints(List clientCertificateThumbprints); + } + + /** + * The stage of the cluster update allowing to specify ClusterCodeVersion. + */ + interface WithClusterCodeVersion { + /** + * Specifies clusterCodeVersion. + * @param clusterCodeVersion The Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions** + * @return the next update stage + */ + Update withClusterCodeVersion(String clusterCodeVersion); + } + + /** + * The stage of the cluster update allowing to specify FabricSettings. + */ + interface WithFabricSettings { + /** + * Specifies fabricSettings. + * @param fabricSettings The list of custom fabric settings to configure the cluster. This will overwrite the existing list + * @return the next update stage + */ + Update withFabricSettings(List fabricSettings); + } + + /** + * The stage of the cluster update allowing to specify NodeTypes. + */ + interface WithNodeTypes { + /** + * Specifies nodeTypes. + * @param nodeTypes The list of node types in the cluster. This will overwrite the existing list + * @return the next update stage + */ + Update withNodeTypes(List nodeTypes); + } + + /** + * The stage of the cluster update allowing to specify ReliabilityLevel. + */ + interface WithReliabilityLevel { + /** + * Specifies reliabilityLevel. + * @param reliabilityLevel The reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + - None - Run the System services with a target replica set count of 1. This should only be used for test clusters. + - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters. + - Silver - Run the System services with a target replica set count of 5. + - Gold - Run the System services with a target replica set count of 7. + - Platinum - Run the System services with a target replica set count of 9. + . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * @return the next update stage + */ + Update withReliabilityLevel(String reliabilityLevel); + } + + /** + * The stage of the cluster update allowing to specify ReverseProxyCertificate. + */ + interface WithReverseProxyCertificate { + /** + * Specifies reverseProxyCertificate. + * @param reverseProxyCertificate The server certificate used by reverse proxy + * @return the next update stage + */ + Update withReverseProxyCertificate(CertificateDescription reverseProxyCertificate); + } + + /** + * The stage of the cluster update allowing to specify UpgradeDescription. + */ + interface WithUpgradeDescription { + /** + * Specifies upgradeDescription. + * @param upgradeDescription The policy to use when upgrading the cluster + * @return the next update stage + */ + Update withUpgradeDescription(ClusterUpgradePolicy upgradeDescription); + } + + /** + * The stage of the cluster update allowing to specify UpgradeMode. + */ + interface WithUpgradeMode { + /** + * Specifies upgradeMode. + * @param upgradeMode The upgrade mode of the cluster when new Service Fabric runtime version is available. + - Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon as it is available. + - Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource. + . Possible values include: 'Automatic', 'Manual' + * @return the next update stage + */ + Update withUpgradeMode(String upgradeMode); + } + + } +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterCodeVersionsListResult.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterCodeVersionsListResult.java new file mode 100644 index 0000000000000..a57d7ef20df16 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterCodeVersionsListResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.servicefabric.v2018_02_01.implementation.ClusterCodeVersionsListResultInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicefabric.v2018_02_01.implementation.ServiceFabricManager; +import java.util.List; + +/** + * Type representing ClusterCodeVersionsListResult. + */ +public interface ClusterCodeVersionsListResult extends HasInner, HasManager { + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterCodeVersionsResult.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterCodeVersionsResult.java new file mode 100644 index 0000000000000..a8b015c05ef71 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterCodeVersionsResult.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The result of the ServiceFabric runtime versions. + */ +@JsonFlatten +public class ClusterCodeVersionsResult { + /** + * The identification of the result. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the result. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The result resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The Service Fabric runtime version of the cluster. + */ + @JsonProperty(value = "properties.codeVersion") + private String codeVersion; + + /** + * The date of expiry of support of the version. + */ + @JsonProperty(value = "properties.supportExpiryUtc") + private String supportExpiryUtc; + + /** + * Indicates if this version is for Windows or Linux operating system. + * Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.environment") + private String environment; + + /** + * Get the identification of the result. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the identification of the result. + * + * @param id the id value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the result. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the result. + * + * @param name the name value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withName(String name) { + this.name = name; + return this; + } + + /** + * Get the result resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the result resource type. + * + * @param type the type value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withType(String type) { + this.type = type; + return this; + } + + /** + * Get the Service Fabric runtime version of the cluster. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the Service Fabric runtime version of the cluster. + * + * @param codeVersion the codeVersion value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the date of expiry of support of the version. + * + * @return the supportExpiryUtc value + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the date of expiry of support of the version. + * + * @param supportExpiryUtc the supportExpiryUtc value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get indicates if this version is for Windows or Linux operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the environment value + */ + public String environment() { + return this.environment; + } + + /** + * Set indicates if this version is for Windows or Linux operating system. Possible values include: 'Windows', 'Linux'. + * + * @param environment the environment value to set + * @return the ClusterCodeVersionsResult object itself. + */ + public ClusterCodeVersionsResult withEnvironment(String environment) { + this.environment = environment; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterHealthPolicy.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterHealthPolicy.java new file mode 100644 index 0000000000000..978a68e876865 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterHealthPolicy.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_02_01; + +import java.util.Map; +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. + * + * The percentage represents the maximum tolerated percentage of nodes that + * can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, + * the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes + * over the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of + * nodes. Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + */ + @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. + * + * The percentage represents the maximum tolerated percentage of + * applications that can be unhealthy before the cluster is considered in + * error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over + * the total number of application instances in the cluster, excluding + * applications of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + */ + @JsonProperty(value = "maxPercentUnhealthyApplications") + private Integer maxPercentUnhealthyApplications; + + /** + * Defines the application health policy map used to evaluate the health of + * an application or one of its children entities. + */ + @JsonProperty(value = "applicationHealthPolicies") + private Map applicationHealthPolicies; + + /** + * 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. + The percentage represents the maximum tolerated percentage of nodes that can be unhealthy before the cluster is considered in error. + If the percentage is respected but there is at least one unhealthy node, the health is evaluated as Warning. + The percentage is calculated by dividing the number of unhealthy nodes over the total number of nodes in the cluster. + The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. + In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate that. + * + * @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. + The percentage represents the maximum tolerated percentage of nodes that can be unhealthy before the cluster is considered in error. + If the percentage is respected but there is at least one unhealthy node, the health is evaluated as Warning. + The percentage is calculated by dividing the number of unhealthy nodes over the total number of nodes in the cluster. + The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. + In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate that. + * + * @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. + The percentage represents the maximum tolerated percentage of applications that can be unhealthy before the cluster is considered in error. + If the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning. + This is calculated by dividing the number of unhealthy applications over the total number of application instances in the cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap. + The computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero. + * + * @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. + The percentage represents the maximum tolerated percentage of applications that can be unhealthy before the cluster is considered in error. + If the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning. + This is calculated by dividing the number of unhealthy applications over the total number of application instances in the cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap. + The computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero. + * + * @param maxPercentUnhealthyApplications the maxPercentUnhealthyApplications value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withMaxPercentUnhealthyApplications(Integer maxPercentUnhealthyApplications) { + this.maxPercentUnhealthyApplications = maxPercentUnhealthyApplications; + return this; + } + + /** + * Get defines the application health policy map used to evaluate the health of an application or one of its children entities. + * + * @return the applicationHealthPolicies value + */ + public Map applicationHealthPolicies() { + return this.applicationHealthPolicies; + } + + /** + * Set defines the application health policy map used to evaluate the health of an application or one of its children entities. + * + * @param applicationHealthPolicies the applicationHealthPolicies value to set + * @return the ClusterHealthPolicy object itself. + */ + public ClusterHealthPolicy withApplicationHealthPolicies(Map applicationHealthPolicies) { + this.applicationHealthPolicies = applicationHealthPolicies; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterUpdateParameters.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterUpdateParameters.java new file mode 100644 index 0000000000000..2993ea8a85621 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterUpdateParameters.java @@ -0,0 +1,409 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_02_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 { + /** + * The list of add-on features to enable in the cluster. + */ + @JsonProperty(value = "properties.addOnFeatures") + private List addOnFeatures; + + /** + * The certificate to use for securing the cluster. The certificate + * provided will be used for node to node security within the cluster, SSL + * certificate for cluster management endpoint and default admin client. + */ + @JsonProperty(value = "properties.certificate") + private CertificateDescription certificate; + + /** + * Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + */ + @JsonProperty(value = "properties.certificateCommonNames") + private ServerCertificateCommonNames certificateCommonNames; + + /** + * The list of client certificates referenced by common name that are + * allowed to manage the cluster. This will overwrite the existing list. + */ + @JsonProperty(value = "properties.clientCertificateCommonNames") + private List clientCertificateCommonNames; + + /** + * The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. This will overwrite the existing list. + */ + @JsonProperty(value = "properties.clientCertificateThumbprints") + private List clientCertificateThumbprints; + + /** + * The Service Fabric runtime version of the cluster. This property can + * only by set the user when **upgradeMode** is set to 'Manual'. To get + * list of available Service Fabric versions for new clusters use + * [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /** + * The list of custom fabric settings to configure the cluster. This will + * overwrite the existing list. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /** + * The list of node types in the cluster. This will overwrite the existing + * list. + */ + @JsonProperty(value = "properties.nodeTypes") + private List nodeTypes; + + /** + * The reliability level sets the replica set size of system services. + * Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. + * This should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of + * 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', + * 'Platinum'. + */ + @JsonProperty(value = "properties.reliabilityLevel") + private String reliabilityLevel; + + /** + * The server certificate used by reverse proxy. + */ + @JsonProperty(value = "properties.reverseProxyCertificate") + private CertificateDescription reverseProxyCertificate; + + /** + * The policy to use when upgrading the cluster. + */ + @JsonProperty(value = "properties.upgradeDescription") + private ClusterUpgradePolicy upgradeDescription; + + /** + * The upgrade mode of the cluster when new Service Fabric runtime version + * is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual'. + */ + @JsonProperty(value = "properties.upgradeMode") + private String upgradeMode; + + /** + * Cluster update parameters. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the list of add-on features to enable in the cluster. + * + * @return the addOnFeatures value + */ + public List addOnFeatures() { + return this.addOnFeatures; + } + + /** + * Set the list of add-on features to enable in the cluster. + * + * @param addOnFeatures the addOnFeatures value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withAddOnFeatures(List addOnFeatures) { + this.addOnFeatures = addOnFeatures; + return this; + } + + /** + * Get the certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. + * + * @return the certificate value + */ + public CertificateDescription certificate() { + return this.certificate; + } + + /** + * Set the certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. + * + * @param certificate the certificate value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withCertificate(CertificateDescription certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get describes a list of server certificates referenced by common name that are used to secure the cluster. + * + * @return the certificateCommonNames value + */ + public ServerCertificateCommonNames certificateCommonNames() { + return this.certificateCommonNames; + } + + /** + * Set describes a list of server certificates referenced by common name that are used to secure the cluster. + * + * @param certificateCommonNames the certificateCommonNames value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames) { + this.certificateCommonNames = certificateCommonNames; + return this; + } + + /** + * Get the list of client certificates referenced by common name that are allowed to manage the cluster. This will overwrite the existing list. + * + * @return the clientCertificateCommonNames value + */ + public List clientCertificateCommonNames() { + return this.clientCertificateCommonNames; + } + + /** + * Set the list of client certificates referenced by common name that are allowed to manage the cluster. This will overwrite the existing list. + * + * @param clientCertificateCommonNames the clientCertificateCommonNames value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClientCertificateCommonNames(List clientCertificateCommonNames) { + this.clientCertificateCommonNames = clientCertificateCommonNames; + return this; + } + + /** + * Get the list of client certificates referenced by thumbprint that are allowed to manage the cluster. This will overwrite the existing list. + * + * @return the clientCertificateThumbprints value + */ + public List clientCertificateThumbprints() { + return this.clientCertificateThumbprints; + } + + /** + * Set the list of client certificates referenced by thumbprint that are allowed to manage the cluster. This will overwrite the existing list. + * + * @param clientCertificateThumbprints the clientCertificateThumbprints value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClientCertificateThumbprints(List clientCertificateThumbprints) { + this.clientCertificateThumbprints = clientCertificateThumbprints; + return this; + } + + /** + * Get the Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. + * + * @return the clusterCodeVersion value + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. + * + * @param clusterCodeVersion the clusterCodeVersion value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the list of custom fabric settings to configure the cluster. This will overwrite the existing list. + * + * @return the fabricSettings value + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the list of custom fabric settings to configure the cluster. This will overwrite the existing list. + * + * @param fabricSettings the fabricSettings value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the list of node types in the cluster. This will overwrite the existing list. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of node types in the cluster. This will overwrite the existing list. + * + * @param nodeTypes the nodeTypes value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + - None - Run the System services with a target replica set count of 1. This should only be used for test clusters. + - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters. + - Silver - Run the System services with a target replica set count of 5. + - Gold - Run the System services with a target replica set count of 7. + - Platinum - Run the System services with a target replica set count of 9. + . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum'. + * + * @return the reliabilityLevel value + */ + public String reliabilityLevel() { + return this.reliabilityLevel; + } + + /** + * Set the reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + - None - Run the System services with a target replica set count of 1. This should only be used for test clusters. + - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters. + - Silver - Run the System services with a target replica set count of 5. + - Gold - Run the System services with a target replica set count of 7. + - Platinum - Run the System services with a target replica set count of 9. + . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum'. + * + * @param reliabilityLevel the reliabilityLevel value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withReliabilityLevel(String reliabilityLevel) { + this.reliabilityLevel = reliabilityLevel; + return this; + } + + /** + * Get the server certificate used by reverse proxy. + * + * @return the reverseProxyCertificate value + */ + public CertificateDescription reverseProxyCertificate() { + return this.reverseProxyCertificate; + } + + /** + * Set the server certificate used by reverse proxy. + * + * @param reverseProxyCertificate the reverseProxyCertificate value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withReverseProxyCertificate(CertificateDescription reverseProxyCertificate) { + this.reverseProxyCertificate = reverseProxyCertificate; + return this; + } + + /** + * Get the policy to use when upgrading the cluster. + * + * @return the upgradeDescription value + */ + public ClusterUpgradePolicy upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set the policy to use when upgrading the cluster. + * + * @param upgradeDescription the upgradeDescription value to set + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + + /** + * Get the upgrade mode of the cluster when new Service Fabric runtime version is available. + - Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon as it is available. + - Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource. + . Possible values include: 'Automatic', 'Manual'. + * + * @return the upgradeMode value + */ + public String upgradeMode() { + return this.upgradeMode; + } + + /** + * Set the upgrade mode of the cluster when new Service Fabric runtime version is available. + - Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon as it is available. + - Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource. + . 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 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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterUpgradeDeltaHealthPolicy.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterUpgradeDeltaHealthPolicy.java new file mode 100644 index 0000000000000..d1763ff97bd03 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterUpgradeDeltaHealthPolicy.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the delta health policies for the cluster upgrade. + */ +public class ClusterUpgradeDeltaHealthPolicy { + /** + * The maximum allowed percentage of nodes health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyNodes", required = true) + private int maxPercentDeltaUnhealthyNodes; + + /** + * The maximum allowed percentage of upgrade domain nodes health + * degradation allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at + * the beginning of upgrade and the state of the upgrade domain nodes at + * the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for + * all completed upgrade domains to make sure the state of the upgrade + * domains is within tolerated limits. + */ + @JsonProperty(value = "maxPercentUpgradeDomainDeltaUnhealthyNodes", required = true) + private int maxPercentUpgradeDomainDeltaUnhealthyNodes; + + /** + * The maximum allowed percentage of applications health degradation + * allowed during cluster upgrades. + * The delta is measured between the state of the applications at the + * beginning of upgrade and the state of the applications at the time of + * the health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * System services are not included in this. + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyApplications", required = true) + private int maxPercentDeltaUnhealthyApplications; + + /** + * Defines the application delta health policy map used to evaluate the + * health of an application or one of its child entities when upgrading the + * cluster. + */ + @JsonProperty(value = "applicationDeltaHealthPolicies") + private Map applicationDeltaHealthPolicies; + + /** + * Get the maximum allowed percentage of nodes health degradation allowed during cluster upgrades. + The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation. + The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. + * + * @return the maxPercentDeltaUnhealthyNodes value + */ + public int maxPercentDeltaUnhealthyNodes() { + return this.maxPercentDeltaUnhealthyNodes; + } + + /** + * Set the maximum allowed percentage of nodes health degradation allowed during cluster upgrades. + The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation. + The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. + * + * @param maxPercentDeltaUnhealthyNodes the maxPercentDeltaUnhealthyNodes value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentDeltaUnhealthyNodes(int maxPercentDeltaUnhealthyNodes) { + this.maxPercentDeltaUnhealthyNodes = maxPercentDeltaUnhealthyNodes; + return this; + } + + /** + * Get the maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. + The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health evaluation. + The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the state of the upgrade domains is within tolerated limits. + * + * @return the maxPercentUpgradeDomainDeltaUnhealthyNodes value + */ + public int maxPercentUpgradeDomainDeltaUnhealthyNodes() { + return this.maxPercentUpgradeDomainDeltaUnhealthyNodes; + } + + /** + * Set the maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. + The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health evaluation. + The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the state of the upgrade domains is within tolerated limits. + * + * @param maxPercentUpgradeDomainDeltaUnhealthyNodes the maxPercentUpgradeDomainDeltaUnhealthyNodes value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentUpgradeDomainDeltaUnhealthyNodes(int maxPercentUpgradeDomainDeltaUnhealthyNodes) { + this.maxPercentUpgradeDomainDeltaUnhealthyNodes = maxPercentUpgradeDomainDeltaUnhealthyNodes; + return this; + } + + /** + * Get the maximum allowed percentage of applications health degradation allowed during cluster upgrades. + The delta is measured between the state of the applications at the beginning of upgrade and the state of the applications at the time of the health evaluation. + The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. System services are not included in this. + * + * @return the maxPercentDeltaUnhealthyApplications value + */ + public int maxPercentDeltaUnhealthyApplications() { + return this.maxPercentDeltaUnhealthyApplications; + } + + /** + * Set the maximum allowed percentage of applications health degradation allowed during cluster upgrades. + The delta is measured between the state of the applications at the beginning of upgrade and the state of the applications at the time of the health evaluation. + The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. System services are not included in this. + * + * @param maxPercentDeltaUnhealthyApplications the maxPercentDeltaUnhealthyApplications value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withMaxPercentDeltaUnhealthyApplications(int maxPercentDeltaUnhealthyApplications) { + this.maxPercentDeltaUnhealthyApplications = maxPercentDeltaUnhealthyApplications; + return this; + } + + /** + * Get defines the application delta health policy map used to evaluate the health of an application or one of its child entities when upgrading the cluster. + * + * @return the applicationDeltaHealthPolicies value + */ + public Map applicationDeltaHealthPolicies() { + return this.applicationDeltaHealthPolicies; + } + + /** + * Set defines the application delta health policy map used to evaluate the health of an application or one of its child entities when upgrading the cluster. + * + * @param applicationDeltaHealthPolicies the applicationDeltaHealthPolicies value to set + * @return the ClusterUpgradeDeltaHealthPolicy object itself. + */ + public ClusterUpgradeDeltaHealthPolicy withApplicationDeltaHealthPolicies(Map applicationDeltaHealthPolicies) { + this.applicationDeltaHealthPolicies = applicationDeltaHealthPolicies; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterUpgradePolicy.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterUpgradePolicy.java new file mode 100644 index 0000000000000..d1e1424c3b9bc --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterUpgradePolicy.java @@ -0,0 +1,268 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the policy used when upgrading the cluster. + */ +public class ClusterUpgradePolicy { + /** + * If true, then processes are forcefully restarted during upgrade even + * when the code version has not changed (the upgrade only changes + * configuration or data). + */ + @JsonProperty(value = "forceRestart") + private Boolean forceRestart; + + /** + * The maximum amount of time to block processing of an upgrade domain and + * prevent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed + * regardless of availability loss issues. The timeout is reset at the + * start of each upgrade domain. The timeout can be in either hh:mm:ss or + * in d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "upgradeReplicaSetCheckTimeout", required = true) + private String upgradeReplicaSetCheckTimeout; + + /** + * The length of time to wait after completing an upgrade domain before + * performing health checks. The duration can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "healthCheckWaitDuration", required = true) + private String healthCheckWaitDuration; + + /** + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. The duration can + * be in either hh:mm:ss or in d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "healthCheckStableDuration", required = true) + private String healthCheckStableDuration; + + /** + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before the upgrade rolls back. The timeout can be + * in either hh:mm:ss or in d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "healthCheckRetryTimeout", required = true) + private String healthCheckRetryTimeout; + + /** + * The amount of time the overall upgrade has to complete before the + * upgrade rolls back. The timeout can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "upgradeTimeout", required = true) + private String upgradeTimeout; + + /** + * The amount of time each upgrade domain has to complete before the + * upgrade rolls back. The timeout can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + */ + @JsonProperty(value = "upgradeDomainTimeout", required = true) + private String upgradeDomainTimeout; + + /** + * The cluster health policy used when upgrading the cluster. + */ + @JsonProperty(value = "healthPolicy", required = true) + private ClusterHealthPolicy healthPolicy; + + /** + * The cluster delta health policy used when upgrading the cluster. + */ + @JsonProperty(value = "deltaHealthPolicy") + private ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy; + + /** + * Get if true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). + * + * @return the forceRestart value + */ + public Boolean forceRestart() { + return this.forceRestart; + } + + /** + * Set if true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). + * + * @param forceRestart the forceRestart value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withForceRestart(Boolean forceRestart) { + this.forceRestart = forceRestart; + return this; + } + + /** + * Get the maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the upgradeReplicaSetCheckTimeout value + */ + public String upgradeReplicaSetCheckTimeout() { + return this.upgradeReplicaSetCheckTimeout; + } + + /** + * Set the maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param upgradeReplicaSetCheckTimeout the upgradeReplicaSetCheckTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeReplicaSetCheckTimeout(String upgradeReplicaSetCheckTimeout) { + this.upgradeReplicaSetCheckTimeout = upgradeReplicaSetCheckTimeout; + return this; + } + + /** + * Get the length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the healthCheckWaitDuration value + */ + public String healthCheckWaitDuration() { + return this.healthCheckWaitDuration; + } + + /** + * Set the length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param healthCheckWaitDuration the healthCheckWaitDuration value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckWaitDuration(String healthCheckWaitDuration) { + this.healthCheckWaitDuration = healthCheckWaitDuration; + return this; + } + + /** + * Get the amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the healthCheckStableDuration value + */ + public String healthCheckStableDuration() { + return this.healthCheckStableDuration; + } + + /** + * Set the amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param healthCheckStableDuration the healthCheckStableDuration value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckStableDuration(String healthCheckStableDuration) { + this.healthCheckStableDuration = healthCheckStableDuration; + return this; + } + + /** + * Get the amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the healthCheckRetryTimeout value + */ + public String healthCheckRetryTimeout() { + return this.healthCheckRetryTimeout; + } + + /** + * Set the amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param healthCheckRetryTimeout the healthCheckRetryTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthCheckRetryTimeout(String healthCheckRetryTimeout) { + this.healthCheckRetryTimeout = healthCheckRetryTimeout; + return this; + } + + /** + * Get the amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the upgradeTimeout value + */ + public String upgradeTimeout() { + return this.upgradeTimeout; + } + + /** + * Set the amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param upgradeTimeout the upgradeTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeTimeout(String upgradeTimeout) { + this.upgradeTimeout = upgradeTimeout; + return this; + } + + /** + * Get the amount of time each upgrade domain has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @return the upgradeDomainTimeout value + */ + public String upgradeDomainTimeout() { + return this.upgradeDomainTimeout; + } + + /** + * Set the amount of time each upgrade domain has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param upgradeDomainTimeout the upgradeDomainTimeout value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withUpgradeDomainTimeout(String upgradeDomainTimeout) { + this.upgradeDomainTimeout = upgradeDomainTimeout; + return this; + } + + /** + * Get the cluster health policy used when upgrading the cluster. + * + * @return the healthPolicy value + */ + public ClusterHealthPolicy healthPolicy() { + return this.healthPolicy; + } + + /** + * Set the cluster health policy used when upgrading the cluster. + * + * @param healthPolicy the healthPolicy value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withHealthPolicy(ClusterHealthPolicy healthPolicy) { + this.healthPolicy = healthPolicy; + return this; + } + + /** + * Get the cluster delta health policy used when upgrading the cluster. + * + * @return the deltaHealthPolicy value + */ + public ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy() { + return this.deltaHealthPolicy; + } + + /** + * Set the cluster delta health policy used when upgrading the cluster. + * + * @param deltaHealthPolicy the deltaHealthPolicy value to set + * @return the ClusterUpgradePolicy object itself. + */ + public ClusterUpgradePolicy withDeltaHealthPolicy(ClusterUpgradeDeltaHealthPolicy deltaHealthPolicy) { + this.deltaHealthPolicy = deltaHealthPolicy; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterVersionDetails.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterVersionDetails.java new file mode 100644 index 0000000000000..dc363b78d0063 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterVersionDetails.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The detail of the Service Fabric runtime version result. + */ +public class ClusterVersionDetails { + /** + * The Service Fabric runtime version of the cluster. + */ + @JsonProperty(value = "codeVersion") + private String codeVersion; + + /** + * The date of expiry of support of the version. + */ + @JsonProperty(value = "supportExpiryUtc") + private String supportExpiryUtc; + + /** + * Indicates if this version is for Windows or Linux operating system. + * Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "environment") + private String environment; + + /** + * Get the Service Fabric runtime version of the cluster. + * + * @return the codeVersion value + */ + public String codeVersion() { + return this.codeVersion; + } + + /** + * Set the Service Fabric runtime version of the cluster. + * + * @param codeVersion the codeVersion value to set + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withCodeVersion(String codeVersion) { + this.codeVersion = codeVersion; + return this; + } + + /** + * Get the date of expiry of support of the version. + * + * @return the supportExpiryUtc value + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the date of expiry of support of the version. + * + * @param supportExpiryUtc the supportExpiryUtc value to set + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get indicates if this version is for Windows or Linux operating system. Possible values include: 'Windows', 'Linux'. + * + * @return the environment value + */ + public String environment() { + return this.environment; + } + + /** + * Set indicates if this version is for Windows or Linux operating system. Possible values include: 'Windows', 'Linux'. + * + * @param environment the environment value to set + * @return the ClusterVersionDetails object itself. + */ + public ClusterVersionDetails withEnvironment(String environment) { + this.environment = environment; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterVersions.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterVersions.java new file mode 100644 index 0000000000000..229ebca33b4d9 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ClusterVersions.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2018_02_01.implementation.ClusterVersionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ClusterVersions. + */ +public interface ClusterVersions extends HasInner { + /** + * Gets information about a Service Fabric cluster code version available for the specified environment. + * Gets information about an available Service Fabric cluster code version by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. 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 getByEnvironmentAsync(String location, String environment, String clusterVersion); + + /** + * Gets the list of Service Fabric cluster code versions available for the specified location. + * Gets all available code versions for Service Fabric cluster resources 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(String location); + + /** + * Gets the list of Service Fabric cluster code versions available for the specified environment. + * Gets all available code versions for Service Fabric cluster resources by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. 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(String location, String environment); + + /** + * Gets information about a Service Fabric cluster code version available in the specified location. + * Gets information about an available Service Fabric cluster code 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 getAsync(String location, String clusterVersion); + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/Clusters.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/Clusters.java new file mode 100644 index 0000000000000..029fcc0822bcb --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_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.v2018_02_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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/DiagnosticsStorageAccountConfig.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/DiagnosticsStorageAccountConfig.java new file mode 100644 index 0000000000000..2c74ba5dead0a --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The storage account information for storing Service Fabric diagnostic logs. + */ +public class DiagnosticsStorageAccountConfig { + /** + * The Azure storage account name. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /** + * The protected diagnostics storage key name. + */ + @JsonProperty(value = "protectedAccountKeyName", required = true) + private String protectedAccountKeyName; + + /** + * The blob endpoint of the azure storage account. + */ + @JsonProperty(value = "blobEndpoint", required = true) + private String blobEndpoint; + + /** + * The queue endpoint of the azure storage account. + */ + @JsonProperty(value = "queueEndpoint", required = true) + private String queueEndpoint; + + /** + * The table endpoint of the azure storage account. + */ + @JsonProperty(value = "tableEndpoint", required = true) + private String tableEndpoint; + + /** + * Get the Azure storage account name. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the Azure storage account name. + * + * @param storageAccountName the storageAccountName value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the protected diagnostics storage key name. + * + * @return the protectedAccountKeyName value + */ + public String protectedAccountKeyName() { + return this.protectedAccountKeyName; + } + + /** + * Set the protected diagnostics storage key name. + * + * @param protectedAccountKeyName the protectedAccountKeyName value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withProtectedAccountKeyName(String protectedAccountKeyName) { + this.protectedAccountKeyName = protectedAccountKeyName; + return this; + } + + /** + * Get the blob endpoint of the azure storage account. + * + * @return the blobEndpoint value + */ + public String blobEndpoint() { + return this.blobEndpoint; + } + + /** + * Set the blob endpoint of the azure storage account. + * + * @param blobEndpoint the blobEndpoint value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withBlobEndpoint(String blobEndpoint) { + this.blobEndpoint = blobEndpoint; + return this; + } + + /** + * Get the queue endpoint of the azure storage account. + * + * @return the queueEndpoint value + */ + public String queueEndpoint() { + return this.queueEndpoint; + } + + /** + * Set the queue endpoint of the azure storage account. + * + * @param queueEndpoint the queueEndpoint value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withQueueEndpoint(String queueEndpoint) { + this.queueEndpoint = queueEndpoint; + return this; + } + + /** + * Get the table endpoint of the azure storage account. + * + * @return the tableEndpoint value + */ + public String tableEndpoint() { + return this.tableEndpoint; + } + + /** + * Set the table endpoint of the azure storage account. + * + * @param tableEndpoint the tableEndpoint value to set + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withTableEndpoint(String tableEndpoint) { + this.tableEndpoint = tableEndpoint; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/EndpointRangeDescription.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/EndpointRangeDescription.java new file mode 100644 index 0000000000000..310d892cd9a49 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ErrorModel.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ErrorModel.java new file mode 100644 index 0000000000000..42d22a92dd848 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The structure of the error. + */ +public class ErrorModel { + /** + * The error details. + */ + @JsonProperty(value = "error") + private ErrorModelError error; + + /** + * Get the error details. + * + * @return the error value + */ + public ErrorModelError error() { + return this.error; + } + + /** + * Set the error details. + * + * @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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ErrorModelError.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ErrorModelError.java new file mode 100644 index 0000000000000..d73cf0a805f6f --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error details. + */ +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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ErrorModelException.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ErrorModelException.java new file mode 100644 index 0000000000000..7b72042285ec3 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/NodeTypeDescription.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/NodeTypeDescription.java new file mode 100644 index 0000000000000..8d3cabc81ab75 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/NodeTypeDescription.java @@ -0,0 +1,330 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_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 { + /** + * The name of the node type. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The placement tags applied to nodes in the node type, which can be used + * to indicate where certain services (workload) should run. + */ + @JsonProperty(value = "placementProperties") + private Map placementProperties; + + /** + * The capacity tags applied to the nodes in the node type, the cluster + * resource manager uses these tags to understand how much resource a node + * has. + */ + @JsonProperty(value = "capacities") + private Map capacities; + + /** + * The TCP cluster management endpoint port. + */ + @JsonProperty(value = "clientConnectionEndpointPort", required = true) + private int clientConnectionEndpointPort; + + /** + * The HTTP cluster management endpoint port. + */ + @JsonProperty(value = "httpGatewayEndpointPort", required = true) + private int httpGatewayEndpointPort; + + /** + * The durability level of the node type. Learn about + * [DurabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - Bronze - No privileges. This is the default. + * - Silver - The infrastructure jobs can be paused for a duration of 10 + * minutes per UD. + * - Gold - The infrastructure jobs can be paused for a duration of 2 hours + * per UD. Gold durability can be enabled only on full node VM SKUs like + * D15_V2, G5 etc. + * . Possible values include: 'Bronze', 'Silver', 'Gold'. + */ + @JsonProperty(value = "durabilityLevel") + private String durabilityLevel; + + /** + * The range of ports from which cluster assigned port to Service Fabric + * applications. + */ + @JsonProperty(value = "applicationPorts") + private EndpointRangeDescription applicationPorts; + + /** + * The range of ephemeral ports that nodes in this node type should be + * configured with. + */ + @JsonProperty(value = "ephemeralPorts") + private EndpointRangeDescription ephemeralPorts; + + /** + * The node type on which system services will run. Only one node type + * should be marked as primary. Primary node type cannot be deleted or + * changed for existing clusters. + */ + @JsonProperty(value = "isPrimary", required = true) + private boolean isPrimary; + + /** + * The number of nodes in the node type. This count should match the + * capacity property in the corresponding VirtualMachineScaleSet resource. + */ + @JsonProperty(value = "vmInstanceCount", required = true) + private int vmInstanceCount; + + /** + * The endpoint used by reverse proxy. + */ + @JsonProperty(value = "reverseProxyEndpointPort") + private Integer reverseProxyEndpointPort; + + /** + * Get the name of the node type. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the node type. + * + * @param name the name value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run. + * + * @return the placementProperties value + */ + public Map placementProperties() { + return this.placementProperties; + } + + /** + * Set the placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run. + * + * @param placementProperties the placementProperties value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withPlacementProperties(Map placementProperties) { + this.placementProperties = placementProperties; + return this; + } + + /** + * Get the capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much resource a node has. + * + * @return the capacities value + */ + public Map capacities() { + return this.capacities; + } + + /** + * Set the capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much resource a node has. + * + * @param capacities the capacities value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withCapacities(Map capacities) { + this.capacities = capacities; + return this; + } + + /** + * Get the TCP cluster management endpoint port. + * + * @return the clientConnectionEndpointPort value + */ + public int clientConnectionEndpointPort() { + return this.clientConnectionEndpointPort; + } + + /** + * Set the TCP cluster management endpoint port. + * + * @param clientConnectionEndpointPort the clientConnectionEndpointPort value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withClientConnectionEndpointPort(int clientConnectionEndpointPort) { + this.clientConnectionEndpointPort = clientConnectionEndpointPort; + return this; + } + + /** + * Get the HTTP cluster management endpoint port. + * + * @return the httpGatewayEndpointPort value + */ + public int httpGatewayEndpointPort() { + return this.httpGatewayEndpointPort; + } + + /** + * Set the HTTP cluster management endpoint port. + * + * @param httpGatewayEndpointPort the httpGatewayEndpointPort value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withHttpGatewayEndpointPort(int httpGatewayEndpointPort) { + this.httpGatewayEndpointPort = httpGatewayEndpointPort; + return this; + } + + /** + * Get the durability level of the node type. Learn about [DurabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + - Bronze - No privileges. This is the default. + - Silver - The infrastructure jobs can be paused for a duration of 10 minutes per UD. + - Gold - The infrastructure jobs can be paused for a duration of 2 hours per UD. Gold durability can be enabled only on full node VM SKUs like D15_V2, G5 etc. + . Possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @return the durabilityLevel value + */ + public String durabilityLevel() { + return this.durabilityLevel; + } + + /** + * Set the durability level of the node type. Learn about [DurabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + - Bronze - No privileges. This is the default. + - Silver - The infrastructure jobs can be paused for a duration of 10 minutes per UD. + - Gold - The infrastructure jobs can be paused for a duration of 2 hours per UD. Gold durability can be enabled only on full node VM SKUs like D15_V2, G5 etc. + . Possible values include: 'Bronze', 'Silver', 'Gold'. + * + * @param durabilityLevel the durabilityLevel value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withDurabilityLevel(String durabilityLevel) { + this.durabilityLevel = durabilityLevel; + return this; + } + + /** + * Get the range of ports from which cluster assigned port to Service Fabric applications. + * + * @return the applicationPorts value + */ + public EndpointRangeDescription applicationPorts() { + return this.applicationPorts; + } + + /** + * Set the range of ports from which cluster assigned port to Service Fabric applications. + * + * @param applicationPorts the applicationPorts value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withApplicationPorts(EndpointRangeDescription applicationPorts) { + this.applicationPorts = applicationPorts; + return this; + } + + /** + * Get the range of ephemeral ports that nodes in this node type should be configured with. + * + * @return the ephemeralPorts value + */ + public EndpointRangeDescription ephemeralPorts() { + return this.ephemeralPorts; + } + + /** + * Set the range of ephemeral ports that nodes in this node type should be configured with. + * + * @param ephemeralPorts the ephemeralPorts value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withEphemeralPorts(EndpointRangeDescription ephemeralPorts) { + this.ephemeralPorts = ephemeralPorts; + return this; + } + + /** + * Get the node type on which system services will run. Only one node type should be marked as primary. Primary node type cannot be deleted or changed for existing clusters. + * + * @return the isPrimary value + */ + public boolean isPrimary() { + return this.isPrimary; + } + + /** + * Set the node type on which system services will run. Only one node type should be marked as primary. Primary node type cannot be deleted or changed for existing clusters. + * + * @param isPrimary the isPrimary value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withIsPrimary(boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get the number of nodes in the node type. This count should match the capacity property in the corresponding VirtualMachineScaleSet resource. + * + * @return the vmInstanceCount value + */ + public int vmInstanceCount() { + return this.vmInstanceCount; + } + + /** + * Set the number of nodes in the node type. This count should match the capacity property in the corresponding VirtualMachineScaleSet resource. + * + * @param vmInstanceCount the vmInstanceCount value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withVmInstanceCount(int vmInstanceCount) { + this.vmInstanceCount = vmInstanceCount; + return this; + } + + /** + * Get the endpoint used by reverse proxy. + * + * @return the reverseProxyEndpointPort value + */ + public Integer reverseProxyEndpointPort() { + return this.reverseProxyEndpointPort; + } + + /** + * Set the endpoint used by reverse proxy. + * + * @param reverseProxyEndpointPort the reverseProxyEndpointPort value to set + * @return the NodeTypeDescription object itself. + */ + public NodeTypeDescription withReverseProxyEndpointPort(Integer reverseProxyEndpointPort) { + this.reverseProxyEndpointPort = reverseProxyEndpointPort; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/OperationResult.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/OperationResult.java new file mode 100644 index 0000000000000..4775e41ee634a --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.servicefabric.v2018_02_01.implementation.ServiceFabricManager; +import com.microsoft.azure.management.servicefabric.v2018_02_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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/Operations.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/Operations.java new file mode 100644 index 0000000000000..b8ef774a63d95 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/Operations.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_02_01; + +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2018_02_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. + * + * @param apiVersion The version of the Service Fabric resource provider API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String apiVersion); + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ProvisioningState.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ProvisioningState.java new file mode 100644 index 0000000000000..1966f17f5a1b6 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServerCertificateCommonName.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServerCertificateCommonName.java new file mode 100644 index 0000000000000..a8cd6b1631f7e --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServerCertificateCommonName.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.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the server certificate details using common name. + */ +public class ServerCertificateCommonName { + /** + * The common name of the server certificate. + */ + @JsonProperty(value = "certificateCommonName", required = true) + private String certificateCommonName; + + /** + * The issuer thumbprint of the server certificate. + */ + @JsonProperty(value = "certificateIssuerThumbprint", required = true) + private String certificateIssuerThumbprint; + + /** + * Get the common name of the server certificate. + * + * @return the certificateCommonName value + */ + public String certificateCommonName() { + return this.certificateCommonName; + } + + /** + * Set the common name of the server certificate. + * + * @param certificateCommonName the certificateCommonName value to set + * @return the ServerCertificateCommonName object itself. + */ + public ServerCertificateCommonName withCertificateCommonName(String certificateCommonName) { + this.certificateCommonName = certificateCommonName; + return this; + } + + /** + * Get the issuer thumbprint of the server certificate. + * + * @return the certificateIssuerThumbprint value + */ + public String certificateIssuerThumbprint() { + return this.certificateIssuerThumbprint; + } + + /** + * Set the issuer thumbprint of the server certificate. + * + * @param certificateIssuerThumbprint the certificateIssuerThumbprint value to set + * @return the ServerCertificateCommonName object itself. + */ + public ServerCertificateCommonName withCertificateIssuerThumbprint(String certificateIssuerThumbprint) { + this.certificateIssuerThumbprint = certificateIssuerThumbprint; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServerCertificateCommonNames.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServerCertificateCommonNames.java new file mode 100644 index 0000000000000..f130d8648c13d --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServerCertificateCommonNames.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.v2018_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a list of server certificates referenced by common name that are + * used to secure the cluster. + */ +public class ServerCertificateCommonNames { + /** + * The list of server certificates referenced by common name that are used + * to secure the cluster. + */ + @JsonProperty(value = "commonNames") + private List commonNames; + + /** + * The local certificate store location. Possible values include: + * 'AddressBook', 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', + * 'Root', 'TrustedPeople', 'TrustedPublisher'. + */ + @JsonProperty(value = "x509StoreName") + private String x509StoreName; + + /** + * Get the list of server certificates referenced by common name that are used to secure the cluster. + * + * @return the commonNames value + */ + public List commonNames() { + return this.commonNames; + } + + /** + * Set the list of server certificates referenced by common name that are used to secure the cluster. + * + * @param commonNames the commonNames value to set + * @return the ServerCertificateCommonNames object itself. + */ + public ServerCertificateCommonNames withCommonNames(List commonNames) { + this.commonNames = commonNames; + 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 ServerCertificateCommonNames object itself. + */ + public ServerCertificateCommonNames withX509StoreName(String x509StoreName) { + this.x509StoreName = x509StoreName; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServiceTypeDeltaHealthPolicy.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServiceTypeDeltaHealthPolicy.java new file mode 100644 index 0000000000000..af92c896f6a7d --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServiceTypeDeltaHealthPolicy.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the delta health policy used to evaluate the health of services + * belonging to a service type when upgrading the cluster. + */ +public class ServiceTypeDeltaHealthPolicy { + /** + * The maximum allowed percentage of services health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the services at the beginning + * of upgrade and the state of the services at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + */ + @JsonProperty(value = "maxPercentDeltaUnhealthyServices") + private Integer maxPercentDeltaUnhealthyServices; + + /** + * Get the maximum allowed percentage of services health degradation allowed during cluster upgrades. + The delta is measured between the state of the services at the beginning of upgrade and the state of the services at the time of the health evaluation. + The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. + * + * @return the maxPercentDeltaUnhealthyServices value + */ + public Integer maxPercentDeltaUnhealthyServices() { + return this.maxPercentDeltaUnhealthyServices; + } + + /** + * Set the maximum allowed percentage of services health degradation allowed during cluster upgrades. + The delta is measured between the state of the services at the beginning of upgrade and the state of the services at the time of the health evaluation. + The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. + * + * @param maxPercentDeltaUnhealthyServices the maxPercentDeltaUnhealthyServices value to set + * @return the ServiceTypeDeltaHealthPolicy object itself. + */ + public ServiceTypeDeltaHealthPolicy withMaxPercentDeltaUnhealthyServices(Integer maxPercentDeltaUnhealthyServices) { + this.maxPercentDeltaUnhealthyServices = maxPercentDeltaUnhealthyServices; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServiceTypeHealthPolicy.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServiceTypeHealthPolicy.java new file mode 100644 index 0000000000000..97552a7e5a8c4 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/ServiceTypeHealthPolicy.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the health policy used to evaluate the health of services + * belonging to a service type. + */ +public class ServiceTypeHealthPolicy { + /** + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + */ + @JsonProperty(value = "maxPercentUnhealthyServices") + private Integer maxPercentUnhealthyServices; + + /** + * Get the maximum percentage of services allowed to be unhealthy before your application is considered in error. + * + * @return the maxPercentUnhealthyServices value + */ + public Integer maxPercentUnhealthyServices() { + return this.maxPercentUnhealthyServices; + } + + /** + * Set the maximum percentage of services allowed to be unhealthy before your application is considered in error. + * + * @param maxPercentUnhealthyServices the maxPercentUnhealthyServices value to set + * @return the ServiceTypeHealthPolicy object itself. + */ + public ServiceTypeHealthPolicy withMaxPercentUnhealthyServices(Integer maxPercentUnhealthyServices) { + this.maxPercentUnhealthyServices = maxPercentUnhealthyServices; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/SettingsParameterDescription.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/SettingsParameterDescription.java new file mode 100644 index 0000000000000..5bf74d2806702 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a parameter in fabric settings of the cluster. + */ +public class SettingsParameterDescription { + /** + * The parameter name of fabric setting. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The parameter value of fabric setting. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the parameter name of fabric setting. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the parameter name of fabric setting. + * + * @param name the name value to set + * @return the SettingsParameterDescription object itself. + */ + public SettingsParameterDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the parameter value of fabric setting. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the parameter value of fabric setting. + * + * @param value the value value to set + * @return the SettingsParameterDescription object itself. + */ + public SettingsParameterDescription withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/SettingsSectionDescription.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/SettingsSectionDescription.java new file mode 100644 index 0000000000000..072ce1134ea02 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/SettingsSectionDescription.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a section in the fabric settings of the cluster. + */ +public class SettingsSectionDescription { + /** + * The section name of the fabric settings. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The collection of parameters in the section. + */ + @JsonProperty(value = "parameters", required = true) + private List parameters; + + /** + * Get the section name of the fabric settings. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the section name of the fabric settings. + * + * @param name the name value to set + * @return the SettingsSectionDescription object itself. + */ + public SettingsSectionDescription withName(String name) { + this.name = name; + return this; + } + + /** + * Get the collection of parameters in the section. + * + * @return the parameters value + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the collection of parameters in the section. + * + * @param parameters the parameters value to set + * @return the SettingsSectionDescription object itself. + */ + public SettingsSectionDescription withParameters(List parameters) { + this.parameters = parameters; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterCodeVersionsListResultImpl.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterCodeVersionsListResultImpl.java new file mode 100644 index 0000000000000..bb7d12ce799f7 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterCodeVersionsListResultImpl.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.v2018_02_01.implementation; + +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterCodeVersionsListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterCodeVersionsResult; + +class ClusterCodeVersionsListResultImpl extends WrapperImpl implements ClusterCodeVersionsListResult { + private final ServiceFabricManager manager; + private String location; + private String clusterVersion; + + ClusterCodeVersionsListResultImpl(ClusterCodeVersionsListResultInner inner, ServiceFabricManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ServiceFabricManager manager() { + return this.manager; + } + + + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterCodeVersionsListResultInner.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterCodeVersionsListResultInner.java new file mode 100644 index 0000000000000..77da6ab244cd2 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterCodeVersionsListResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterCodeVersionsResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list results of the ServiceFabric runtime versions. + */ +public class ClusterCodeVersionsListResultInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ClusterCodeVersionsListResultInner object itself. + */ + public ClusterCodeVersionsListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the URL to use for getting the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set + * @return the ClusterCodeVersionsListResultInner object itself. + */ + public ClusterCodeVersionsListResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterImpl.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterImpl.java new file mode 100644 index 0000000000000..a8ebdaa820c6c --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterImpl.java @@ -0,0 +1,339 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_02_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.servicefabric.v2018_02_01.Cluster; +import rx.Observable; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterUpdateParameters; +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterVersionDetails; +import com.microsoft.azure.management.servicefabric.v2018_02_01.AzureActiveDirectory; +import com.microsoft.azure.management.servicefabric.v2018_02_01.CertificateDescription; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ServerCertificateCommonNames; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClientCertificateCommonName; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClientCertificateThumbprint; +import com.microsoft.azure.management.servicefabric.v2018_02_01.DiagnosticsStorageAccountConfig; +import com.microsoft.azure.management.servicefabric.v2018_02_01.SettingsSectionDescription; +import com.microsoft.azure.management.servicefabric.v2018_02_01.NodeTypeDescription; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ProvisioningState; +import com.microsoft.azure.management.servicefabric.v2018_02_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 addOnFeatures() { + return this.inner().addOnFeatures(); + } + + @Override + public List availableClusterVersions() { + return this.inner().availableClusterVersions(); + } + + @Override + public AzureActiveDirectory azureActiveDirectory() { + return this.inner().azureActiveDirectory(); + } + + @Override + public CertificateDescription certificate() { + return this.inner().certificate(); + } + + @Override + public ServerCertificateCommonNames certificateCommonNames() { + return this.inner().certificateCommonNames(); + } + + @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 ServerCertificateCommonNames reverseProxyCertificateCommonNames() { + return this.inner().reverseProxyCertificateCommonNames(); + } + + @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 withReverseProxyCertificateCommonNames(ServerCertificateCommonNames reverseProxyCertificateCommonNames) { + this.inner().withReverseProxyCertificateCommonNames(reverseProxyCertificateCommonNames); + 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 withAddOnFeatures(List addOnFeatures) { + if (isInCreateMode()) { + this.inner().withAddOnFeatures(addOnFeatures); + } else { + this.updateParameter.withAddOnFeatures(addOnFeatures); + } + return this; + } + + @Override + public ClusterImpl withCertificate(CertificateDescription certificate) { + if (isInCreateMode()) { + this.inner().withCertificate(certificate); + } else { + this.updateParameter.withCertificate(certificate); + } + return this; + } + + @Override + public ClusterImpl withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames) { + if (isInCreateMode()) { + this.inner().withCertificateCommonNames(certificateCommonNames); + } else { + this.updateParameter.withCertificateCommonNames(certificateCommonNames); + } + 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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterInner.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterInner.java new file mode 100644 index 0000000000000..a87f30ad90ae3 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterInner.java @@ -0,0 +1,644 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_02_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterVersionDetails; +import com.microsoft.azure.management.servicefabric.v2018_02_01.AzureActiveDirectory; +import com.microsoft.azure.management.servicefabric.v2018_02_01.CertificateDescription; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ServerCertificateCommonNames; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClientCertificateCommonName; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClientCertificateThumbprint; +import com.microsoft.azure.management.servicefabric.v2018_02_01.DiagnosticsStorageAccountConfig; +import com.microsoft.azure.management.servicefabric.v2018_02_01.SettingsSectionDescription; +import com.microsoft.azure.management.servicefabric.v2018_02_01.NodeTypeDescription; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ProvisioningState; +import com.microsoft.azure.management.servicefabric.v2018_02_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 list of add-on features to enable in the cluster. + */ + @JsonProperty(value = "properties.addOnFeatures") + private List addOnFeatures; + + /** + * The Service Fabric runtime versions available for this cluster. + */ + @JsonProperty(value = "properties.availableClusterVersions", access = JsonProperty.Access.WRITE_ONLY) + private List availableClusterVersions; + + /** + * The AAD authentication settings of the cluster. + */ + @JsonProperty(value = "properties.azureActiveDirectory") + private AzureActiveDirectory azureActiveDirectory; + + /** + * The certificate to use for securing the cluster. The certificate + * provided will be used for node to node security within the cluster, SSL + * certificate for cluster management endpoint and default admin client. + */ + @JsonProperty(value = "properties.certificate") + private CertificateDescription certificate; + + /** + * Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + */ + @JsonProperty(value = "properties.certificateCommonNames") + private ServerCertificateCommonNames certificateCommonNames; + + /** + * The list of client certificates referenced by common name that are + * allowed to manage the cluster. + */ + @JsonProperty(value = "properties.clientCertificateCommonNames") + private List clientCertificateCommonNames; + + /** + * The list of client certificates referenced by thumbprint that are + * allowed to manage the cluster. + */ + @JsonProperty(value = "properties.clientCertificateThumbprints") + private List clientCertificateThumbprints; + + /** + * The Service Fabric runtime version of the cluster. This property can + * only by set the user when **upgradeMode** is set to 'Manual'. To get + * list of available Service Fabric versions for new clusters use + * [ClusterVersion API](./ClusterVersion.md). To get the list of available + * version for existing clusters use **availableClusterVersions**. + */ + @JsonProperty(value = "properties.clusterCodeVersion") + private String clusterCodeVersion; + + /** + * The Azure Resource Provider endpoint. A system service in the cluster + * connects to this endpoint. + */ + @JsonProperty(value = "properties.clusterEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String clusterEndpoint; + + /** + * A service generated unique identifier for the cluster resource. + */ + @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /** + * The current state of the cluster. + * + * - WaitingForNodes - Indicates that the cluster resource is created and + * the resource provider is waiting for Service Fabric VM extension to boot + * up and report to it. + * - Deploying - Indicates that the Service Fabric runtime is being + * installed on the VMs. Cluster resource will be in this state until the + * cluster boots up and system services are up. + * - BaselineUpgrade - Indicates that the cluster is upgrading to + * establishes the cluster version. This upgrade is automatically initiated + * when the cluster boots up for the first time. + * - UpdatingUserConfiguration - Indicates that the cluster is being + * upgraded with the user provided configuration. + * - UpdatingUserCertificate - Indicates that the cluster is being upgraded + * with the user provided certificate. + * - UpdatingInfrastructure - Indicates that the cluster is being upgraded + * with the latest Service Fabric runtime version. This happens only when + * the **upgradeMode** is set to 'Automatic'. + * - EnforcingClusterVersion - Indicates that cluster is on a different + * version than expected and the cluster is being upgraded to the expected + * version. + * - UpgradeServiceUnreachable - Indicates that the system service in the + * cluster is no longer polling the Resource Provider. Clusters in this + * state cannot be managed by the Resource Provider. + * - AutoScale - Indicates that the ReliabilityLevel of the cluster is + * being adjusted. + * - Ready - Indicates that the cluster is in a stable state. + * . 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 storage account information for storing Service Fabric diagnostic + * logs. + */ + @JsonProperty(value = "properties.diagnosticsStorageAccountConfig") + private DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig; + + /** + * The list of custom fabric settings to configure the cluster. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /** + * The http management endpoint of the cluster. + */ + @JsonProperty(value = "properties.managementEndpoint", required = true) + private String managementEndpoint; + + /** + * The list of node types in the cluster. + */ + @JsonProperty(value = "properties.nodeTypes", required = true) + private List nodeTypes; + + /** + * The 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 reliability level sets the replica set size of system services. + * Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. + * This should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of + * 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', + * 'Platinum'. + */ + @JsonProperty(value = "properties.reliabilityLevel") + private String reliabilityLevel; + + /** + * The server certificate used by reverse proxy. + */ + @JsonProperty(value = "properties.reverseProxyCertificate") + private CertificateDescription reverseProxyCertificate; + + /** + * Describes a list of server certificates referenced by common name that + * are used to secure the cluster. + */ + @JsonProperty(value = "properties.reverseProxyCertificateCommonNames") + private ServerCertificateCommonNames reverseProxyCertificateCommonNames; + + /** + * The policy to use when upgrading the cluster. + */ + @JsonProperty(value = "properties.upgradeDescription") + private ClusterUpgradePolicy upgradeDescription; + + /** + * The upgrade mode of the cluster when new Service Fabric runtime version + * is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual'. + */ + @JsonProperty(value = "properties.upgradeMode") + private String upgradeMode; + + /** + * The VM image VMSS has been configured with. Generic names such as + * Windows or Linux can be used. + */ + @JsonProperty(value = "properties.vmImage") + private String vmImage; + + /** + * Get the list of add-on features to enable in the cluster. + * + * @return the addOnFeatures value + */ + public List addOnFeatures() { + return this.addOnFeatures; + } + + /** + * Set the list of add-on features to enable in the cluster. + * + * @param addOnFeatures the addOnFeatures value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withAddOnFeatures(List addOnFeatures) { + this.addOnFeatures = addOnFeatures; + return this; + } + + /** + * Get the Service Fabric runtime versions available for this cluster. + * + * @return the availableClusterVersions value + */ + public List availableClusterVersions() { + return this.availableClusterVersions; + } + + /** + * Get the AAD authentication settings of the cluster. + * + * @return the azureActiveDirectory value + */ + public AzureActiveDirectory azureActiveDirectory() { + return this.azureActiveDirectory; + } + + /** + * Set the AAD authentication settings of the cluster. + * + * @param azureActiveDirectory the azureActiveDirectory value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.azureActiveDirectory = azureActiveDirectory; + return this; + } + + /** + * Get the certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. + * + * @return the certificate value + */ + public CertificateDescription certificate() { + return this.certificate; + } + + /** + * Set the certificate to use for securing the cluster. The certificate provided will be used for node to node security within the cluster, SSL certificate for cluster management endpoint and default admin client. + * + * @param certificate the certificate value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withCertificate(CertificateDescription certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get describes a list of server certificates referenced by common name that are used to secure the cluster. + * + * @return the certificateCommonNames value + */ + public ServerCertificateCommonNames certificateCommonNames() { + return this.certificateCommonNames; + } + + /** + * Set describes a list of server certificates referenced by common name that are used to secure the cluster. + * + * @param certificateCommonNames the certificateCommonNames value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withCertificateCommonNames(ServerCertificateCommonNames certificateCommonNames) { + this.certificateCommonNames = certificateCommonNames; + return this; + } + + /** + * Get the list of client certificates referenced by common name that are allowed to manage the cluster. + * + * @return the clientCertificateCommonNames value + */ + public List clientCertificateCommonNames() { + return this.clientCertificateCommonNames; + } + + /** + * Set the list of client certificates referenced by common name that are allowed to manage the cluster. + * + * @param clientCertificateCommonNames the clientCertificateCommonNames value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClientCertificateCommonNames(List clientCertificateCommonNames) { + this.clientCertificateCommonNames = clientCertificateCommonNames; + return this; + } + + /** + * Get the list of client certificates referenced by thumbprint that are allowed to manage the cluster. + * + * @return the clientCertificateThumbprints value + */ + public List clientCertificateThumbprints() { + return this.clientCertificateThumbprints; + } + + /** + * Set the list of client certificates referenced by thumbprint that are allowed to manage the cluster. + * + * @param clientCertificateThumbprints the clientCertificateThumbprints value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClientCertificateThumbprints(List clientCertificateThumbprints) { + this.clientCertificateThumbprints = clientCertificateThumbprints; + return this; + } + + /** + * Get the Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. + * + * @return the clusterCodeVersion value + */ + public String clusterCodeVersion() { + return this.clusterCodeVersion; + } + + /** + * Set the Service Fabric runtime version of the cluster. This property can only by set the user when **upgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. + * + * @param clusterCodeVersion the clusterCodeVersion value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the Azure Resource Provider endpoint. A system service in the cluster connects to this endpoint. + * + * @return the clusterEndpoint value + */ + public String clusterEndpoint() { + return this.clusterEndpoint; + } + + /** + * Get a service generated unique identifier for the cluster resource. + * + * @return the clusterId value + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the current state of the cluster. + - WaitingForNodes - Indicates that the cluster resource is created and the resource provider is waiting for Service Fabric VM extension to boot up and report to it. + - Deploying - Indicates that the Service Fabric runtime is being installed on the VMs. Cluster resource will be in this state until the cluster boots up and system services are up. + - BaselineUpgrade - Indicates that the cluster is upgrading to establishes the cluster version. This upgrade is automatically initiated when the cluster boots up for the first time. + - UpdatingUserConfiguration - Indicates that the cluster is being upgraded with the user provided configuration. + - UpdatingUserCertificate - Indicates that the cluster is being upgraded with the user provided certificate. + - UpdatingInfrastructure - Indicates that the cluster is being upgraded with the latest Service Fabric runtime version. This happens only when the **upgradeMode** is set to 'Automatic'. + - EnforcingClusterVersion - Indicates that cluster is on a different version than expected and the cluster is being upgraded to the expected version. + - UpgradeServiceUnreachable - Indicates that the system service in the cluster is no longer polling the Resource Provider. Clusters in this state cannot be managed by the Resource Provider. + - AutoScale - Indicates that the ReliabilityLevel of the cluster is being adjusted. + - Ready - Indicates that the cluster is in a stable state. + . 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 storage account information for storing Service Fabric diagnostic logs. + * + * @return the diagnosticsStorageAccountConfig value + */ + public DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig() { + return this.diagnosticsStorageAccountConfig; + } + + /** + * Set the storage account information for storing Service Fabric diagnostic logs. + * + * @param diagnosticsStorageAccountConfig the diagnosticsStorageAccountConfig value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withDiagnosticsStorageAccountConfig(DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig) { + this.diagnosticsStorageAccountConfig = diagnosticsStorageAccountConfig; + return this; + } + + /** + * Get the list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the list of custom fabric settings to configure the cluster. + * + * @param fabricSettings the fabricSettings value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the http management endpoint of the cluster. + * + * @return the managementEndpoint value + */ + public String managementEndpoint() { + return this.managementEndpoint; + } + + /** + * Set the http management endpoint of the cluster. + * + * @param managementEndpoint the managementEndpoint value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withManagementEndpoint(String managementEndpoint) { + this.managementEndpoint = managementEndpoint; + return this; + } + + /** + * Get the list of node types in the cluster. + * + * @return the nodeTypes value + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the list of node types in the cluster. + * + * @param nodeTypes the nodeTypes value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the 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 reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + - None - Run the System services with a target replica set count of 1. This should only be used for test clusters. + - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters. + - Silver - Run the System services with a target replica set count of 5. + - Gold - Run the System services with a target replica set count of 7. + - Platinum - Run the System services with a target replica set count of 9. + . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum'. + * + * @return the reliabilityLevel value + */ + public String reliabilityLevel() { + return this.reliabilityLevel; + } + + /** + * Set the reliability level sets the replica set size of system services. Learn about [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + - None - Run the System services with a target replica set count of 1. This should only be used for test clusters. + - Bronze - Run the System services with a target replica set count of 3. This should only be used for test clusters. + - Silver - Run the System services with a target replica set count of 5. + - Gold - Run the System services with a target replica set count of 7. + - Platinum - Run the System services with a target replica set count of 9. + . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum'. + * + * @param reliabilityLevel the reliabilityLevel value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withReliabilityLevel(String reliabilityLevel) { + this.reliabilityLevel = reliabilityLevel; + return this; + } + + /** + * Get 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 describes a list of server certificates referenced by common name that are used to secure the cluster. + * + * @return the reverseProxyCertificateCommonNames value + */ + public ServerCertificateCommonNames reverseProxyCertificateCommonNames() { + return this.reverseProxyCertificateCommonNames; + } + + /** + * Set describes a list of server certificates referenced by common name that are used to secure the cluster. + * + * @param reverseProxyCertificateCommonNames the reverseProxyCertificateCommonNames value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withReverseProxyCertificateCommonNames(ServerCertificateCommonNames reverseProxyCertificateCommonNames) { + this.reverseProxyCertificateCommonNames = reverseProxyCertificateCommonNames; + return this; + } + + /** + * Get the policy to use when upgrading the cluster. + * + * @return the upgradeDescription value + */ + public ClusterUpgradePolicy upgradeDescription() { + return this.upgradeDescription; + } + + /** + * Set the policy to use when upgrading the cluster. + * + * @param upgradeDescription the upgradeDescription value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withUpgradeDescription(ClusterUpgradePolicy upgradeDescription) { + this.upgradeDescription = upgradeDescription; + return this; + } + + /** + * Get the upgrade mode of the cluster when new Service Fabric runtime version is available. + - Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon as it is available. + - Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource. + . Possible values include: 'Automatic', 'Manual'. + * + * @return the upgradeMode value + */ + public String upgradeMode() { + return this.upgradeMode; + } + + /** + * Set the upgrade mode of the cluster when new Service Fabric runtime version is available. + - Automatic - The cluster will be automatically upgraded to the latest Service Fabric runtime version as soon as it is available. + - Manual - The cluster will not be automatically upgraded to the latest Service Fabric runtime version. The cluster is upgraded by setting the **clusterCodeVersion** property in the cluster resource. + . 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 VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. + * + * @return the vmImage value + */ + public String vmImage() { + return this.vmImage; + } + + /** + * Set the VM image VMSS has been configured with. Generic names such as Windows or Linux can be used. + * + * @param vmImage the vmImage value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withVmImage(String vmImage) { + this.vmImage = vmImage; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterVersionsImpl.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterVersionsImpl.java new file mode 100644 index 0000000000000..5a4237eba858c --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterVersionsImpl.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterVersions; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterCodeVersionsListResult; + +class ClusterVersionsImpl extends WrapperImpl implements ClusterVersions { + private final ServiceFabricManager manager; + + ClusterVersionsImpl(ServiceFabricManager manager) { + super(manager.inner().clusterVersions()); + this.manager = manager; + } + + public ServiceFabricManager manager() { + return this.manager; + } + + private ClusterCodeVersionsListResultImpl wrapModel(ClusterCodeVersionsListResultInner inner) { + return new ClusterCodeVersionsListResultImpl(inner, manager()); + } + + @Override + public Observable getByEnvironmentAsync(String location, String environment, String clusterVersion) { + ClusterVersionsInner client = this.inner(); + return client.getByEnvironmentAsync(location, environment, clusterVersion) + .map(new Func1() { + @Override + public ClusterCodeVersionsListResult call(ClusterCodeVersionsListResultInner inner) { + return new ClusterCodeVersionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(String location) { + ClusterVersionsInner client = this.inner(); + return client.listAsync(location) + .map(new Func1() { + @Override + public ClusterCodeVersionsListResult call(ClusterCodeVersionsListResultInner inner) { + return new ClusterCodeVersionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByEnvironmentAsync(String location, String environment) { + ClusterVersionsInner client = this.inner(); + return client.listByEnvironmentAsync(location, environment) + .map(new Func1() { + @Override + public ClusterCodeVersionsListResult call(ClusterCodeVersionsListResultInner inner) { + return new ClusterCodeVersionsListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String location, String clusterVersion) { + ClusterVersionsInner client = this.inner(); + return client.getAsync(location, clusterVersion) + .map(new Func1() { + @Override + public ClusterCodeVersionsListResult call(ClusterCodeVersionsListResultInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterVersionsInner.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterVersionsInner.java new file mode 100644 index 0000000000000..2f920867bc853 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClusterVersionsInner.java @@ -0,0 +1,420 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_02_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ClusterVersions. + */ +public class ClusterVersionsInner { + /** The Retrofit service to perform REST calls. */ + private ClusterVersionsService service; + /** The service client containing this operation class. */ + private ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ClusterVersionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClusterVersionsInner(Retrofit retrofit, ServiceFabricManagementClientImpl client) { + this.service = retrofit.create(ClusterVersionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ClusterVersions to be + * used by Retrofit to perform actually REST calls. + */ + interface ClusterVersionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterVersions get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}") + Observable> get(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Path("clusterVersion") String clusterVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterVersions getByEnvironment" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}") + Observable> getByEnvironment(@Path("location") String location, @Path("environment") String environment, @Path("subscriptionId") String subscriptionId, @Path("clusterVersion") String clusterVersion, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabric.v2018_02_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.v2018_02_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); + + } + + /** + * Gets information about a Service Fabric cluster code version available in the specified location. + * Gets information about an available Service Fabric cluster code 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 ClusterCodeVersionsListResultInner object if successful. + */ + public ClusterCodeVersionsListResultInner get(String location, String clusterVersion) { + return getWithServiceResponseAsync(location, clusterVersion).toBlocking().single().body(); + } + + /** + * Gets information about a Service Fabric cluster code version available in the specified location. + * Gets information about an available Service Fabric cluster code 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 getAsync(String location, String clusterVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(location, clusterVersion), serviceCallback); + } + + /** + * Gets information about a Service Fabric cluster code version available in the specified location. + * Gets information about an available Service Fabric cluster code 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 ClusterCodeVersionsListResultInner object + */ + public Observable getAsync(String location, String clusterVersion) { + return getWithServiceResponseAsync(location, clusterVersion).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a Service Fabric cluster code version available in the specified location. + * Gets information about an available Service Fabric cluster code 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 ClusterCodeVersionsListResultInner object + */ + public Observable> getWithServiceResponseAsync(String location, 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."); + } + return service.get(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 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); + } + + /** + * Gets information about a Service Fabric cluster code version available for the specified environment. + * Gets information about an available Service Fabric cluster code version by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. 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 ClusterCodeVersionsListResultInner object if successful. + */ + public ClusterCodeVersionsListResultInner getByEnvironment(String location, String environment, String clusterVersion) { + return getByEnvironmentWithServiceResponseAsync(location, environment, clusterVersion).toBlocking().single().body(); + } + + /** + * Gets information about a Service Fabric cluster code version available for the specified environment. + * Gets information about an available Service Fabric cluster code version by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. 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 getByEnvironmentAsync(String location, String environment, String clusterVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByEnvironmentWithServiceResponseAsync(location, environment, clusterVersion), serviceCallback); + } + + /** + * Gets information about a Service Fabric cluster code version available for the specified environment. + * Gets information about an available Service Fabric cluster code version by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. 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 ClusterCodeVersionsListResultInner object + */ + public Observable getByEnvironmentAsync(String location, String environment, String clusterVersion) { + return getByEnvironmentWithServiceResponseAsync(location, environment, clusterVersion).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about a Service Fabric cluster code version available for the specified environment. + * Gets information about an available Service Fabric cluster code version by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. 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 ClusterCodeVersionsListResultInner object + */ + public Observable> getByEnvironmentWithServiceResponseAsync(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."); + } + return service.getByEnvironment(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 = getByEnvironmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByEnvironmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified location. + * Gets all available code versions for Service Fabric cluster resources 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 ClusterCodeVersionsListResultInner object if successful. + */ + public ClusterCodeVersionsListResultInner list(String location) { + return listWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified location. + * Gets all available code versions for Service Fabric cluster resources 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(String location, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified location. + * Gets all available code versions for Service Fabric cluster resources 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 ClusterCodeVersionsListResultInner object + */ + public Observable listAsync(String location) { + return listWithServiceResponseAsync(location).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified location. + * Gets all available code versions for Service Fabric cluster resources 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 ClusterCodeVersionsListResultInner object + */ + public Observable> listWithServiceResponseAsync(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."); + } + 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 clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified environment. + * Gets all available code versions for Service Fabric cluster resources by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. 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 ClusterCodeVersionsListResultInner object if successful. + */ + public ClusterCodeVersionsListResultInner listByEnvironment(String location, String environment) { + return listByEnvironmentWithServiceResponseAsync(location, environment).toBlocking().single().body(); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified environment. + * Gets all available code versions for Service Fabric cluster resources by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. 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(String location, String environment, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByEnvironmentWithServiceResponseAsync(location, environment), serviceCallback); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified environment. + * Gets all available code versions for Service Fabric cluster resources by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. The default means all. Possible values include: 'Windows', 'Linux' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable listByEnvironmentAsync(String location, String environment) { + return listByEnvironmentWithServiceResponseAsync(location, environment).map(new Func1, ClusterCodeVersionsListResultInner>() { + @Override + public ClusterCodeVersionsListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the list of Service Fabric cluster code versions available for the specified environment. + * Gets all available code versions for Service Fabric cluster resources by environment. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param environment The operating system of the cluster. The default means all. Possible values include: 'Windows', 'Linux' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterCodeVersionsListResultInner object + */ + public Observable> listByEnvironmentWithServiceResponseAsync(String location, 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."); + } + 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 clientResponse = listByEnvironmentDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByEnvironmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClustersImpl.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClustersImpl.java new file mode 100644 index 0000000000000..a576c7c3127f0 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.servicefabric.v2018_02_01.Clusters; +import com.microsoft.azure.management.servicefabric.v2018_02_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) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return 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() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return 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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClustersInner.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClustersInner.java new file mode 100644 index 0000000000000..e3982dc2ae260 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ClustersInner.java @@ -0,0 +1,793 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_02_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.management.servicefabric.v2018_02_01.ClusterUpdateParameters; +import com.microsoft.azure.management.servicefabric.v2018_02_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.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.v2018_02_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.v2018_02_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.v2018_02_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.v2018_02_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.v2018_02_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.v2018_02_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.v2018_02_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.v2018_02_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); + + } + + /** + * Gets a Service Fabric cluster resource. + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @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(); + } + + /** + * Gets a Service Fabric cluster resource. + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @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); + } + + /** + * Gets a Service Fabric cluster resource. + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @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(); + } + }); + } + + /** + * Gets a Service Fabric cluster resource. + * Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @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."); + } + 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); + } + + /** + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner create(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String clusterName, 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 (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()); + } + + /** + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginCreate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Service Fabric cluster resource. + * Create or update a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param parameters The cluster resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String clusterName, 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 (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); + } + + /** + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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(); + } + + /** + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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); + } + + /** + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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(); + } + }); + } + + /** + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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 (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()); + } + + /** + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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(); + } + + /** + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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); + } + + /** + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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(); + } + }); + } + + /** + * Updates the configuration of a Service Fabric cluster resource. + * Update the configuration of a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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 (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); + } + + /** + * Deletes a Service Fabric cluster resource. + * Delete a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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(); + } + + /** + * Deletes a Service Fabric cluster resource. + * Delete a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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); + } + + /** + * Deletes a Service Fabric cluster resource. + * Delete a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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(); + } + }); + } + + /** + * Deletes a Service Fabric cluster resource. + * Delete a Service Fabric cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @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."); + } + 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); + } + + /** + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<ClusterInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Gets the list of Service Fabric cluster resources created in the specified resource group. + * Gets all Service Fabric cluster resources created or in the process of being created in the resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<ClusterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(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."); + } + 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); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @return the observable to the List<ClusterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Gets the list of Service Fabric cluster resources created in the specified subscription. + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @return the observable to the List<ClusterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() 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); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/IdParsingUtils.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..03c3192bed17e --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/OperationResultImpl.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/OperationResultImpl.java new file mode 100644 index 0000000000000..ef6a1e72a856d --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01.implementation; + +import com.microsoft.azure.management.servicefabric.v2018_02_01.OperationResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2018_02_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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/OperationResultInner.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/OperationResultInner.java new file mode 100644 index 0000000000000..15f5aa0a5dac6 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01.implementation; + +import com.microsoft.azure.management.servicefabric.v2018_02_01.AvailableOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Available operation list result. + */ +public class OperationResultInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private AvailableOperationDisplay display; + + /** + * Origin result. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the operation. + * + * @param name the name value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public AvailableOperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withDisplay(AvailableOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin result. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin result. + * + * @param origin the origin value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the URL to use for getting the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/OperationsImpl.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..52a8777ca279b --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.servicefabric.v2018_02_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.servicefabric.v2018_02_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(final String apiVersion) { + OperationsInner client = this.inner(); + return client.listAsync(apiVersion) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationResult call(OperationResultInner inner) { + return new OperationResultImpl(inner, manager()); + } + }); + } + +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/OperationsInner.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..8795e4228767d --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/OperationsInner.java @@ -0,0 +1,298 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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.v2018_02_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.v2018_02_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.v2018_02_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.v2018_02_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. + * + * @param apiVersion The version of the Service Fabric resource provider API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationResultInner> object if successful. + */ + public PagedList list(final String apiVersion) { + ServiceResponse> response = listSinglePageAsync(apiVersion).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. + * + * @param apiVersion The version of the Service Fabric resource provider API + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String apiVersion, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(apiVersion), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. + * + * @param apiVersion The version of the Service Fabric resource provider API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> object + */ + public Observable> listAsync(final String apiVersion) { + return listWithServiceResponseAsync(apiVersion) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. + * + * @param apiVersion The version of the Service Fabric resource provider API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> object + */ + public Observable>> listWithServiceResponseAsync(final String apiVersion) { + return listSinglePageAsync(apiVersion) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider API operations. + * + ServiceResponse> * @param apiVersion The version of the Service Fabric resource provider API + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String apiVersion) { + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Lists all of the available Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider 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 Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider 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 Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider 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 Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider 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 Service Fabric resource provider API operations. + * Get the list of available Service Fabric resource provider 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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/PageImpl.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..36be7a70d0b98 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_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("") + 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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/PageImpl1.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/PageImpl1.java new file mode 100644 index 0000000000000..9e5abb2bf11db --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabric.v2018_02_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 PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ServiceFabricManagementClientImpl.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ServiceFabricManagementClientImpl.java new file mode 100644 index 0000000000000..78d69bf95796c --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_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 version of the Service Fabric resource provider API. This is a required parameter and it's value must be "2018-02-01" for this specification. */ + private String apiVersion; + + /** + * Gets The version of the Service Fabric resource provider API. This is a required parameter and it's value must be "2018-02-01" for this specification. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** 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 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 = "2018-02-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", "2018-02-01"); + } +} diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ServiceFabricManager.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/ServiceFabricManager.java new file mode 100644 index 0000000000000..8f0527aecae94 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_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.v2018_02_01.Clusters; +import com.microsoft.azure.management.servicefabric.v2018_02_01.ClusterVersions; +import com.microsoft.azure.management.servicefabric.v2018_02_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/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/package-info.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/implementation/package-info.java new file mode 100644 index 0000000000000..f98e8f91f9e70 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01.implementation; diff --git a/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/package-info.java b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_01/package-info.java new file mode 100644 index 0000000000000..68db9be8b98b3 --- /dev/null +++ b/servicefabric/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/servicefabric/v2018_02_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.v2018_02_01;