From bd75be4e03bbcccb5a9b828fa110259bebdc665b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 30 Jul 2021 06:26:57 +0000 Subject: [PATCH] CodeGen from PR 14749 in Azure/azure-rest-api-specs Merge 6a5f970e9f7e2ed91bf0c11289daa8743f28e131 into 682c9680fd6ac7746d701bcf0c69948a3199671a --- .../CHANGELOG.md | 3 +- .../README.md | 6 +- .../pom.xml | 141 +- .../servicefabric/ServiceFabricManager.java | 59 +- .../fluent/ManagedClusterVersionsClient.java | 44 + .../fluent/ManagedClustersClient.java | 271 ++ .../servicefabric/fluent/NodeTypesClient.java | 501 ++++ .../fluent/OperationsClient.java | 66 + .../fluent/ServiceFabricManagementClient.java | 28 +- .../models/ApplicationResourceInner.java | 66 + .../models/ApplicationTypeResourceInner.java | 2 + .../ApplicationTypeVersionResourceInner.java | 3 + .../fluent/models/ClusterInner.java | 31 + .../fluent/models/ManagedClusterInner.java | 479 ++++ .../ManagedClusterVersionDetailsInner.java | 103 + .../fluent/models/NodeTypeInner.java | 473 ++++ .../fluent/models/ServiceResourceInner.java | 31 + .../ApplicationResourceImpl.java | 39 +- .../ApplicationTypeVersionsClientImpl.java | 24 +- .../ApplicationTypesClientImpl.java | 24 +- .../ApplicationsClientImpl.java | 30 +- .../implementation/ClusterImpl.java | 16 + .../ClusterVersionsClientImpl.java | 30 +- .../implementation/ClustersClientImpl.java | 47 +- .../implementation/ManagedClusterImpl.java | 371 +++ .../ManagedClusterVersionDetailsImpl.java | 42 + .../ManagedClusterVersionsClientImpl.java | 225 ++ .../ManagedClusterVersionsImpl.java | 75 + .../ManagedClustersClientImpl.java | 1549 +++++++++++ .../implementation/ManagedClustersImpl.java | 175 ++ .../implementation/NodeTypeImpl.java | 366 +++ .../implementation/NodeTypesClientImpl.java | 2401 +++++++++++++++++ .../implementation/NodeTypesImpl.java | 237 ++ .../implementation/OperationsClientImpl.java | 388 ++- .../implementation/OperationsImpl.java | 30 + .../ServiceFabricManagementClientImpl.java | 55 +- .../implementation/ServiceResourceImpl.java | 18 +- .../implementation/ServicesClientImpl.java | 30 +- .../models/ApplicationDeltaHealthPolicy.java | 2 + .../models/ApplicationHealthPolicy.java | 2 + .../models/ApplicationResource.java | 67 +- .../models/ApplicationResourceProperties.java | 8 + .../models/ApplicationResourceUpdate.java | 35 + .../ApplicationResourceUpdateProperties.java | 35 + .../models/ApplicationTypeResource.java | 12 +- .../ApplicationTypeVersionResource.java | 12 +- .../ApplicationTypeVersionsCleanupPolicy.java | 50 + .../models/ApplicationUpgradePolicy.java | 29 + .../ApplicationUserAssignedIdentity.java | 88 + .../models/ArmApplicationHealthPolicy.java | 2 + .../models/ClientCertificate.java | 129 + .../servicefabric/models/Cluster.java | 35 +- .../models/ClusterHealthPolicy.java | 2 + .../servicefabric/models/ClusterOsType.java | 40 + .../models/ClusterUpdateParameters.java | 32 + .../ClusterUpgradeDeltaHealthPolicy.java | 2 + .../DiagnosticsStorageAccountConfig.java | 30 + .../models/LoadBalancingRule.java | 172 ++ .../servicefabric/models/ManagedCluster.java | 557 ++++ .../models/ManagedClusterAddOnFeature.java | 37 + .../models/ManagedClusterListResult.java | 81 + .../ManagedClusterUpdateParameters.java | 286 ++ .../models/ManagedClusterVersionDetails.java | 38 + .../models/ManagedClusterVersions.java | 38 + .../models/ManagedClusterVersionsOsType.java | 40 + .../servicefabric/models/ManagedClusters.java | 164 ++ .../servicefabric/models/ManagedIdentity.java | 130 + .../models/ManagedIdentityType.java | 53 + .../models/ManagedProxyResource.java | 54 + .../ManagedResourceProvisioningState.java | 58 + .../NamedPartitionSchemeDescription.java | 10 +- .../servicefabric/models/NodeType.java | 604 +++++ .../models/NodeTypeActionParameters.java | 82 + .../models/NodeTypeDescription.java | 3 + .../models/NodeTypeListResult.java | 81 + .../models/NodeTypeUpdateParameters.java | 269 ++ .../servicefabric/models/NodeTypes.java | 247 ++ .../servicefabric/models/Operations.java | 60 + .../servicefabric/models/ProbeProtocol.java | 37 + .../servicefabric/models/Protocol.java | 34 + .../models/RollingUpgradeMode.java | 40 + .../ServicePlacementPolicyDescription.java | 2 +- .../servicefabric/models/ServiceResource.java | 36 +- .../models/ServiceResourceProperties.java | 29 + .../models/ServiceResourceUpdate.java | 2 + .../ServiceResourceUpdateProperties.java | 4 +- .../servicefabric/models/Sku.java | 54 + .../servicefabric/models/SkuName.java | 34 + .../models/StatefulServiceProperties.java | 7 + .../models/StatelessServiceProperties.java | 50 + .../StatelessServiceUpdateProperties.java | 43 + ...mInt64RangePartitionSchemeDescription.java | 18 +- .../models/UserAssignedIdentity.java | 54 + .../models/VaultCertificate.java | 118 + .../models/VaultSecretGroup.java | 95 + .../servicefabric/models/VmssExtension.java | 315 +++ 96 files changed, 12882 insertions(+), 245 deletions(-) create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClusterVersionsClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClustersClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/NodeTypesClient.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterVersionDetailsInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/NodeTypeInner.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionDetailsImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypeImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesClientImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesImpl.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificate.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterOsType.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/LoadBalancingRule.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedCluster.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterAddOnFeature.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterListResult.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterUpdateParameters.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionDetails.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersions.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionsOsType.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusters.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedProxyResource.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedResourceProvisioningState.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeType.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeActionParameters.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeListResult.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeUpdateParameters.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypes.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProbeProtocol.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Protocol.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Sku.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SkuName.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultCertificate.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultSecretGroup.java create mode 100644 sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssExtension.java diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md b/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md index 115633479e375..a245795e1fb5d 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-07-30) +- Azure Resource Manager ServiceFabric client library for Java. This package contains Microsoft Azure SDK for ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2020-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-16) diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md b/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md index 9c5c97d93a703..6eae07dac625a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ServiceFabric client library for Java. -This package contains Microsoft Azure SDK for ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2019-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ServiceFabric Management SDK. Service Fabric Management Client. Package tag package-2020-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-servicefabric - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,8 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml b/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml index ff5c5e41f8a54..a7e711b021c84 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/pom.xml @@ -1,67 +1,86 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-servicefabric - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-servicefabric + 1.0.0-beta.2 + jar - Microsoft Azure SDK for ServiceFabric Management - This package contains Microsoft Azure SDK for ServiceFabric Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Service Fabric Management Client. Package tag package-2019-03. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for ServiceFabric Management + This package contains Microsoft Azure SDK for ServiceFabric Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Service Fabric Management Client. Package tag package-2020-03. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - - - - - com.azure - azure-core - 1.18.0 - - - com.azure - azure-core-management - 1.3.1 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - true - - - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.18.0 + + + com.azure + azure-core-management + 1.3.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java index 6962508867026..0583218497057 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/ServiceFabricManager.java @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +16,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -26,6 +26,9 @@ import com.azure.resourcemanager.servicefabric.implementation.ApplicationsImpl; import com.azure.resourcemanager.servicefabric.implementation.ClusterVersionsImpl; import com.azure.resourcemanager.servicefabric.implementation.ClustersImpl; +import com.azure.resourcemanager.servicefabric.implementation.ManagedClusterVersionsImpl; +import com.azure.resourcemanager.servicefabric.implementation.ManagedClustersImpl; +import com.azure.resourcemanager.servicefabric.implementation.NodeTypesImpl; import com.azure.resourcemanager.servicefabric.implementation.OperationsImpl; import com.azure.resourcemanager.servicefabric.implementation.ServiceFabricManagementClientBuilder; import com.azure.resourcemanager.servicefabric.implementation.ServicesImpl; @@ -34,6 +37,9 @@ import com.azure.resourcemanager.servicefabric.models.Applications; import com.azure.resourcemanager.servicefabric.models.ClusterVersions; import com.azure.resourcemanager.servicefabric.models.Clusters; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersions; +import com.azure.resourcemanager.servicefabric.models.ManagedClusters; +import com.azure.resourcemanager.servicefabric.models.NodeTypes; import com.azure.resourcemanager.servicefabric.models.Operations; import com.azure.resourcemanager.servicefabric.models.Services; import java.time.Duration; @@ -58,6 +64,12 @@ public final class ServiceFabricManager { private Services services; + private ManagedClusters managedClusters; + + private ManagedClusterVersions managedClusterVersions; + + private NodeTypes nodeTypes; + private final ServiceFabricManagementClient clientObject; private ServiceFabricManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -101,6 +113,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -140,6 +153,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -196,6 +220,9 @@ public ServiceFabricManager authenticate(TokenCredential credential, AzureProfil userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -205,10 +232,7 @@ public ServiceFabricManager authenticate(TokenCredential credential, AzureProfil HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); @@ -278,6 +302,31 @@ public Services services() { return services; } + /** @return Resource collection API of ManagedClusters. */ + public ManagedClusters managedClusters() { + if (this.managedClusters == null) { + this.managedClusters = new ManagedClustersImpl(clientObject.getManagedClusters(), this); + } + return managedClusters; + } + + /** @return Resource collection API of ManagedClusterVersions. */ + public ManagedClusterVersions managedClusterVersions() { + if (this.managedClusterVersions == null) { + this.managedClusterVersions = + new ManagedClusterVersionsImpl(clientObject.getManagedClusterVersions(), this); + } + return managedClusterVersions; + } + + /** @return Resource collection API of NodeTypes. */ + public NodeTypes nodeTypes() { + if (this.nodeTypes == null) { + this.nodeTypes = new NodeTypesImpl(clientObject.getNodeTypes(), this); + } + return nodeTypes; + } + /** * @return Wrapped service client ServiceFabricManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClusterVersionsClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClusterVersionsClient.java new file mode 100644 index 0000000000000..1f1699472cc8c --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClusterVersionsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionsOsType; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in ManagedClusterVersionsClient. */ +public interface ManagedClusterVersionsClient { + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available code versions for Service Fabric cluster resources by OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listByOS(String location, ManagedClusterVersionsOsType osType); + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available code versions for Service Fabric cluster resources by OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listByOSWithResponse( + String location, ManagedClusterVersionsOsType osType, Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClustersClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClustersClient.java new file mode 100644 index 0000000000000..cca6ea83ca25d --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ManagedClustersClient.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterUpdateParameters; + +/** An instance of this class provides access to all the operations defined in ManagedClustersClient. */ +public interface ManagedClustersClient { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Get a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Create or update a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters); + + /** + * Create or update a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context); + + /** + * Create or update a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner createOrUpdate(String resourceGroupName, String clusterName, ManagedClusterInner parameters); + + /** + * Create or update a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context); + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters); + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context); + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner update(String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters); + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner update( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context); + + /** + * Delete a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + + /** + * Delete a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName); + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/NodeTypesClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/NodeTypesClient.java new file mode 100644 index 0000000000000..46598e01097aa --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/NodeTypesClient.java @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import com.azure.resourcemanager.servicefabric.models.NodeTypeActionParameters; +import com.azure.resourcemanager.servicefabric.models.NodeTypeUpdateParameters; + +/** An instance of this class provides access to all the operations defined in NodeTypesClient. */ +public interface NodeTypesClient { + /** + * Gets all Node types of the specified managed cluster. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagedClusters(String resourceGroupName, String clusterName); + + /** + * Gets all Node types of the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagedClusters(String resourceGroupName, String clusterName, Context context); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginReimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void reimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDeleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodeTypeInner get(String resourceGroupName, String clusterName, String nodeTypeName); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String nodeTypeName, Context context); + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NodeTypeInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters); + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NodeTypeInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context); + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodeTypeInner createOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters); + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodeTypeInner createOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context); + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NodeTypeInner> beginUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters); + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, NodeTypeInner> beginUpdate( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context); + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodeTypeInner update( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters); + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NodeTypeInner update( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String nodeTypeName); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String nodeTypeName, Context context); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String nodeTypeName); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String nodeTypeName, Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java index 31dff4796b3c3..cbf375dc3b19a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/OperationsClient.java @@ -33,4 +33,70 @@ public interface OperationsClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java index 0d04c2e115076..5d0f115693ee2 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/ServiceFabricManagementClient.java @@ -23,13 +23,6 @@ public interface ServiceFabricManagementClient { */ String getEndpoint(); - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - /** * Gets The HTTP pipeline to send requests through. * @@ -92,4 +85,25 @@ public interface ServiceFabricManagementClient { * @return the ServicesClient object. */ ServicesClient getServices(); + + /** + * Gets the ManagedClustersClient object to access its operations. + * + * @return the ManagedClustersClient object. + */ + ManagedClustersClient getManagedClusters(); + + /** + * Gets the ManagedClusterVersionsClient object to access its operations. + * + * @return the ManagedClusterVersionsClient object. + */ + ManagedClusterVersionsClient getManagedClusterVersions(); + + /** + * Gets the NodeTypesClient object to access its operations. + * + * @return the NodeTypesClient object. + */ + NodeTypesClient getNodeTypes(); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java index 6a81ffc6e0636..4a2489e76d82b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationResourceInner.java @@ -10,7 +10,10 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.servicefabric.models.ApplicationMetricDescription; import com.azure.resourcemanager.servicefabric.models.ApplicationUpgradePolicy; +import com.azure.resourcemanager.servicefabric.models.ApplicationUserAssignedIdentity; +import com.azure.resourcemanager.servicefabric.models.ManagedIdentity; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -21,6 +24,12 @@ public class ApplicationResourceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationResourceInner.class); + /* + * Describes the managed identities for an Azure resource. + */ + @JsonProperty(value = "identity") + private ManagedIdentity identity; + /* * The version of the application type as defined in the application * manifest. @@ -33,6 +42,7 @@ public class ApplicationResourceInner extends ProxyResource { * values specified in the application manifest. */ @JsonProperty(value = "properties.parameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map parameters; /* @@ -73,6 +83,13 @@ public class ApplicationResourceInner extends ProxyResource { @JsonProperty(value = "properties.metrics") private List metrics; + /* + * List of user assigned identities for the application, each mapped to a + * friendly name. + */ + @JsonProperty(value = "properties.managedIdentities") + private List managedIdentities; + /* * The current deployment or provisioning state, which only appears in the * response @@ -97,6 +114,7 @@ public class ApplicationResourceInner extends ProxyResource { * Azure resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* @@ -105,6 +123,26 @@ public class ApplicationResourceInner extends ProxyResource { @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /** + * Get the identity property: Describes the managed identities for an Azure resource. + * + * @return the identity value. + */ + public ManagedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Describes the managed identities for an Azure resource. + * + * @param identity the identity value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withIdentity(ManagedIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the typeVersion property: The version of the application type as defined in the application manifest. * @@ -257,6 +295,28 @@ public ApplicationResourceInner withMetrics(List m return this; } + /** + * Get the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @return the managedIdentities value. + */ + public List managedIdentities() { + return this.managedIdentities; + } + + /** + * Set the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @param managedIdentities the managedIdentities value to set. + * @return the ApplicationResourceInner object itself. + */ + public ApplicationResourceInner withManagedIdentities(List managedIdentities) { + this.managedIdentities = managedIdentities; + return this; + } + /** * Get the provisioningState property: The current deployment or provisioning state, which only appears in the * response. @@ -342,11 +402,17 @@ public String etag() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } if (upgradePolicy() != null) { upgradePolicy().validate(); } if (metrics() != null) { metrics().forEach(e -> e.validate()); } + if (managedIdentities() != null) { + managedIdentities().forEach(e -> e.validate()); + } } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java index 3c30d436b29d9..1a9932ec3a8fa 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeResourceInner.java @@ -9,6 +9,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -36,6 +37,7 @@ public class ApplicationTypeResourceInner extends ProxyResource { * Azure resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java index 2e2e2844737ff..9c9bc8ff6f223 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ApplicationTypeVersionResourceInner.java @@ -9,6 +9,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -36,6 +37,7 @@ public class ApplicationTypeVersionResourceInner extends ProxyResource { * or updating the application. */ @JsonProperty(value = "properties.defaultParameterList", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map defaultParameterList; /* @@ -49,6 +51,7 @@ public class ApplicationTypeVersionResourceInner extends ProxyResource { * Azure resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java index c5af69e710398..adba667b960c6 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ClusterInner.java @@ -9,6 +9,7 @@ import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.servicefabric.models.AddOnFeatures; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionsCleanupPolicy; import com.azure.resourcemanager.servicefabric.models.AzureActiveDirectory; import com.azure.resourcemanager.servicefabric.models.CertificateDescription; import com.azure.resourcemanager.servicefabric.models.ClientCertificateCommonName; @@ -225,6 +226,12 @@ public class ClusterInner extends Resource { @JsonProperty(value = "properties.upgradeMode") private UpgradeMode upgradeMode; + /* + * The policy used to clean up unused versions. + */ + @JsonProperty(value = "properties.applicationTypeVersionsCleanupPolicy") + private ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy; + /* * The VM image VMSS has been configured with. Generic names such as * Windows or Linux can be used. @@ -686,6 +693,27 @@ public ClusterInner withUpgradeMode(UpgradeMode upgradeMode) { return this; } + /** + * Get the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused versions. + * + * @return the applicationTypeVersionsCleanupPolicy value. + */ + public ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy() { + return this.applicationTypeVersionsCleanupPolicy; + } + + /** + * Set the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused versions. + * + * @param applicationTypeVersionsCleanupPolicy the applicationTypeVersionsCleanupPolicy value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withApplicationTypeVersionsCleanupPolicy( + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy) { + this.applicationTypeVersionsCleanupPolicy = applicationTypeVersionsCleanupPolicy; + return this; + } + /** * Get the vmImage property: The VM image VMSS has been configured with. Generic names such as Windows or Linux can * be used. @@ -773,5 +801,8 @@ public void validate() { if (upgradeDescription() != null) { upgradeDescription().validate(); } + if (applicationTypeVersionsCleanupPolicy() != null) { + applicationTypeVersionsCleanupPolicy().validate(); + } } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterInner.java new file mode 100644 index 0000000000000..8dd5287c3bec2 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterInner.java @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.models.AzureActiveDirectory; +import com.azure.resourcemanager.servicefabric.models.ClientCertificate; +import com.azure.resourcemanager.servicefabric.models.ClusterState; +import com.azure.resourcemanager.servicefabric.models.LoadBalancingRule; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterAddOnFeature; +import com.azure.resourcemanager.servicefabric.models.ManagedResourceProvisioningState; +import com.azure.resourcemanager.servicefabric.models.SettingsSectionDescription; +import com.azure.resourcemanager.servicefabric.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The manged cluster resource. */ +@JsonFlatten +@Fluent +public class ManagedClusterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterInner.class); + + /* + * The sku of the managed cluster + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * The cluster dns name. + */ + @JsonProperty(value = "properties.dnsName") + private String dnsName; + + /* + * the cluster Fully qualified domain name. + */ + @JsonProperty(value = "properties.fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * 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. + */ + @JsonProperty(value = "properties.clusterState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterState clusterState; + + /* + * The cluster certificate thumbprint used node to node communication. + */ + @JsonProperty(value = "properties.clusterCertificateThumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String clusterCertificateThumbprint; + + /* + * The port used for client connections to the cluster. + */ + @JsonProperty(value = "properties.clientConnectionPort") + private Integer clientConnectionPort; + + /* + * The port used for http connections to the cluster. + */ + @JsonProperty(value = "properties.httpGatewayConnectionPort") + private Integer httpGatewayConnectionPort; + + /* + * vm admin user name. + */ + @JsonProperty(value = "properties.adminUserName") + private String adminUsername; + + /* + * vm admin user password. + */ + @JsonProperty(value = "properties.adminPassword") + private String adminPassword; + + /* + * Describes load balancing rules. + */ + @JsonProperty(value = "properties.loadBalancingRules") + private List loadBalancingRules; + + /* + * client certificates for the cluster. + */ + @JsonProperty(value = "properties.clients") + private List clients; + + /* + * Azure active directory. + */ + @JsonProperty(value = "properties.azureActiveDirectory") + private AzureActiveDirectory azureActiveDirectory; + + /* + * The list of custom fabric settings to configure the cluster. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /* + * The provisioning state of the managed cluster resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ManagedResourceProvisioningState provisioningState; + + /* + * 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; + + /* + * client certificates for the cluster. + */ + @JsonProperty(value = "properties.addonFeatures") + private List addonFeatures; + + /* + * Azure resource etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the sku property: The sku of the managed cluster. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The sku of the managed cluster. + * + * @param sku the sku value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the dnsName property: The cluster dns name. + * + * @return the dnsName value. + */ + public String dnsName() { + return this.dnsName; + } + + /** + * Set the dnsName property: The cluster dns name. + * + * @param dnsName the dnsName value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withDnsName(String dnsName) { + this.dnsName = dnsName; + return this; + } + + /** + * Get the fqdn property: the cluster Fully qualified domain name. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the clusterId property: A service generated unique identifier for the cluster resource. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the clusterState property: The current state of the cluster. + * + * @return the clusterState value. + */ + public ClusterState clusterState() { + return this.clusterState; + } + + /** + * Get the clusterCertificateThumbprint property: The cluster certificate thumbprint used node to node + * communication. + * + * @return the clusterCertificateThumbprint value. + */ + public String clusterCertificateThumbprint() { + return this.clusterCertificateThumbprint; + } + + /** + * Get the clientConnectionPort property: The port used for client connections to the cluster. + * + * @return the clientConnectionPort value. + */ + public Integer clientConnectionPort() { + return this.clientConnectionPort; + } + + /** + * Set the clientConnectionPort property: The port used for client connections to the cluster. + * + * @param clientConnectionPort the clientConnectionPort value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withClientConnectionPort(Integer clientConnectionPort) { + this.clientConnectionPort = clientConnectionPort; + return this; + } + + /** + * Get the httpGatewayConnectionPort property: The port used for http connections to the cluster. + * + * @return the httpGatewayConnectionPort value. + */ + public Integer httpGatewayConnectionPort() { + return this.httpGatewayConnectionPort; + } + + /** + * Set the httpGatewayConnectionPort property: The port used for http connections to the cluster. + * + * @param httpGatewayConnectionPort the httpGatewayConnectionPort value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withHttpGatewayConnectionPort(Integer httpGatewayConnectionPort) { + this.httpGatewayConnectionPort = httpGatewayConnectionPort; + return this; + } + + /** + * Get the adminUsername property: vm admin user name. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: vm admin user name. + * + * @param adminUsername the adminUsername value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: vm admin user password. + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: vm admin user password. + * + * @param adminPassword the adminPassword value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the loadBalancingRules property: Describes load balancing rules. + * + * @return the loadBalancingRules value. + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Set the loadBalancingRules property: Describes load balancing rules. + * + * @param loadBalancingRules the loadBalancingRules value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withLoadBalancingRules(List loadBalancingRules) { + this.loadBalancingRules = loadBalancingRules; + return this; + } + + /** + * Get the clients property: client certificates for the cluster. + * + * @return the clients value. + */ + public List clients() { + return this.clients; + } + + /** + * Set the clients property: client certificates for the cluster. + * + * @param clients the clients value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withClients(List clients) { + this.clients = clients; + return this; + } + + /** + * Get the azureActiveDirectory property: Azure active directory. + * + * @return the azureActiveDirectory value. + */ + public AzureActiveDirectory azureActiveDirectory() { + return this.azureActiveDirectory; + } + + /** + * Set the azureActiveDirectory property: Azure active directory. + * + * @param azureActiveDirectory the azureActiveDirectory value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.azureActiveDirectory = azureActiveDirectory; + return this; + } + + /** + * Get the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value. + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @param fabricSettings the fabricSettings value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the managed cluster resource. + * + * @return the provisioningState value. + */ + public ManagedResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the clusterCodeVersion property: 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 clusterCodeVersion property: 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 ManagedClusterInner object itself. + */ + public ManagedClusterInner withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the addonFeatures property: client certificates for the cluster. + * + * @return the addonFeatures value. + */ + public List addonFeatures() { + return this.addonFeatures; + } + + /** + * Set the addonFeatures property: client certificates for the cluster. + * + * @param addonFeatures the addonFeatures value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAddonFeatures(List addonFeatures) { + this.addonFeatures = addonFeatures; + return this; + } + + /** + * Get the etag property: Azure resource etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (loadBalancingRules() != null) { + loadBalancingRules().forEach(e -> e.validate()); + } + if (clients() != null) { + clients().forEach(e -> e.validate()); + } + if (azureActiveDirectory() != null) { + azureActiveDirectory().validate(); + } + if (fabricSettings() != null) { + fabricSettings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterVersionDetailsInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterVersionDetailsInner.java new file mode 100644 index 0000000000000..6d8c1241e9732 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ManagedClusterVersionDetailsInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.models.ClusterOsType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The detail of the Service Fabric runtime version. */ +@Fluent +public final class ManagedClusterVersionDetailsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterVersionDetailsInner.class); + + /* + * The Service Fabric runtime version of the cluster. + */ + @JsonProperty(value = "msiVersion") + private String msiVersion; + + /* + * The date of expiry of support of the version. + */ + @JsonProperty(value = "supportExpiryUtc") + private String supportExpiryUtc; + + /* + * Indicates the operating system of the cluster. + */ + @JsonProperty(value = "osType") + private ClusterOsType osType; + + /** + * Get the msiVersion property: The Service Fabric runtime version of the cluster. + * + * @return the msiVersion value. + */ + public String msiVersion() { + return this.msiVersion; + } + + /** + * Set the msiVersion property: The Service Fabric runtime version of the cluster. + * + * @param msiVersion the msiVersion value to set. + * @return the ManagedClusterVersionDetailsInner object itself. + */ + public ManagedClusterVersionDetailsInner withMsiVersion(String msiVersion) { + this.msiVersion = msiVersion; + return this; + } + + /** + * Get the supportExpiryUtc property: The date of expiry of support of the version. + * + * @return the supportExpiryUtc value. + */ + public String supportExpiryUtc() { + return this.supportExpiryUtc; + } + + /** + * Set the supportExpiryUtc property: The date of expiry of support of the version. + * + * @param supportExpiryUtc the supportExpiryUtc value to set. + * @return the ManagedClusterVersionDetailsInner object itself. + */ + public ManagedClusterVersionDetailsInner withSupportExpiryUtc(String supportExpiryUtc) { + this.supportExpiryUtc = supportExpiryUtc; + return this; + } + + /** + * Get the osType property: Indicates the operating system of the cluster. + * + * @return the osType value. + */ + public ClusterOsType osType() { + return this.osType; + } + + /** + * Set the osType property: Indicates the operating system of the cluster. + * + * @param osType the osType value to set. + * @return the ManagedClusterVersionDetailsInner object itself. + */ + public ManagedClusterVersionDetailsInner withOsType(ClusterOsType osType) { + this.osType = osType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/NodeTypeInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/NodeTypeInner.java new file mode 100644 index 0000000000000..67ff4c4333102 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/NodeTypeInner.java @@ -0,0 +1,473 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.models.EndpointRangeDescription; +import com.azure.resourcemanager.servicefabric.models.ManagedProxyResource; +import com.azure.resourcemanager.servicefabric.models.ManagedResourceProvisioningState; +import com.azure.resourcemanager.servicefabric.models.VaultSecretGroup; +import com.azure.resourcemanager.servicefabric.models.VmssExtension; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Describes a node type in the cluster, each node type represents sub set of nodes in the cluster. */ +@JsonFlatten +@Fluent +public class NodeTypeInner extends ManagedProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypeInner.class); + + /* + * 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 = "properties.isPrimary") + private Boolean isPrimary; + + /* + * The number of nodes in the node type. + */ + @JsonProperty(value = "properties.vmInstanceCount") + private Integer vmInstanceCount; + + /* + * Disk size for each vm in the node type in GBs. + */ + @JsonProperty(value = "properties.dataDiskSizeGB") + private Integer dataDiskSizeGB; + + /* + * The placement tags applied to nodes in the node type, which can be used + * to indicate where certain services (workload) should run. + */ + @JsonProperty(value = "properties.placementProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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 = "properties.capacities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map capacities; + + /* + * The range of ports from which cluster assigned port to Service Fabric + * applications. + */ + @JsonProperty(value = "properties.applicationPorts") + private EndpointRangeDescription applicationPorts; + + /* + * The range of ephemeral ports that nodes in this node type should be + * configured with. + */ + @JsonProperty(value = "properties.ephemeralPorts") + private EndpointRangeDescription ephemeralPorts; + + /* + * The size of virtual machines in the pool. All virtual machines in a pool + * are the same size. For example, Standard_D3. + */ + @JsonProperty(value = "properties.vmSize") + private String vmSize; + + /* + * The publisher of the Azure Virtual Machines Marketplace image. For + * example, Canonical or MicrosoftWindowsServer. + */ + @JsonProperty(value = "properties.vmImagePublisher") + private String vmImagePublisher; + + /* + * The offer type of the Azure Virtual Machines Marketplace image. For + * example, UbuntuServer or WindowsServer. + */ + @JsonProperty(value = "properties.vmImageOffer") + private String vmImageOffer; + + /* + * The SKU of the Azure Virtual Machines Marketplace image. For example, + * 14.04.0-LTS or 2012-R2-Datacenter. + */ + @JsonProperty(value = "properties.vmImageSku") + private String vmImageSku; + + /* + * The version of the Azure Virtual Machines Marketplace image. A value of + * 'latest' can be specified to select the latest version of an image. If + * omitted, the default is 'latest'. + */ + @JsonProperty(value = "properties.vmImageVersion") + private String vmImageVersion; + + /* + * virtual machine secretes. The secrets to install in the virtual + * machines. + */ + @JsonProperty(value = "properties.vmSecrets") + private List vmSecrets; + + /* + * virtual machine extensions. Set of extensions that should be installed + * onto the virtual machines. + */ + @JsonProperty(value = "properties.vmExtensions") + private List vmExtensions; + + /* + * The provisioning state of the managed cluster resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ManagedResourceProvisioningState provisioningState; + + /** + * Get the isPrimary property: 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 isPrimary property: 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 NodeTypeInner object itself. + */ + public NodeTypeInner withIsPrimary(Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get the vmInstanceCount property: The number of nodes in the node type. + * + * @return the vmInstanceCount value. + */ + public Integer vmInstanceCount() { + return this.vmInstanceCount; + } + + /** + * Set the vmInstanceCount property: The number of nodes in the node type. + * + * @param vmInstanceCount the vmInstanceCount value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmInstanceCount(Integer vmInstanceCount) { + this.vmInstanceCount = vmInstanceCount; + return this; + } + + /** + * Get the dataDiskSizeGB property: Disk size for each vm in the node type in GBs. + * + * @return the dataDiskSizeGB value. + */ + public Integer dataDiskSizeGB() { + return this.dataDiskSizeGB; + } + + /** + * Set the dataDiskSizeGB property: Disk size for each vm in the node type in GBs. + * + * @param dataDiskSizeGB the dataDiskSizeGB value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withDataDiskSizeGB(Integer dataDiskSizeGB) { + this.dataDiskSizeGB = dataDiskSizeGB; + return this; + } + + /** + * Get the placementProperties property: 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 placementProperties property: 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 NodeTypeInner object itself. + */ + public NodeTypeInner withPlacementProperties(Map placementProperties) { + this.placementProperties = placementProperties; + return this; + } + + /** + * Get the capacities property: 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 capacities property: 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 NodeTypeInner object itself. + */ + public NodeTypeInner withCapacities(Map capacities) { + this.capacities = capacities; + return this; + } + + /** + * Get the applicationPorts property: 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 applicationPorts property: The range of ports from which cluster assigned port to Service Fabric + * applications. + * + * @param applicationPorts the applicationPorts value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withApplicationPorts(EndpointRangeDescription applicationPorts) { + this.applicationPorts = applicationPorts; + return this; + } + + /** + * Get the ephemeralPorts property: 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 ephemeralPorts property: The range of ephemeral ports that nodes in this node type should be configured + * with. + * + * @param ephemeralPorts the ephemeralPorts value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withEphemeralPorts(EndpointRangeDescription ephemeralPorts) { + this.ephemeralPorts = ephemeralPorts; + return this; + } + + /** + * Get the vmSize property: The size of virtual machines in the pool. All virtual machines in a pool are the same + * size. For example, Standard_D3. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The size of virtual machines in the pool. All virtual machines in a pool are the same + * size. For example, Standard_D3. + * + * @param vmSize the vmSize value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the vmImagePublisher property: The publisher of the Azure Virtual Machines Marketplace image. For example, + * Canonical or MicrosoftWindowsServer. + * + * @return the vmImagePublisher value. + */ + public String vmImagePublisher() { + return this.vmImagePublisher; + } + + /** + * Set the vmImagePublisher property: The publisher of the Azure Virtual Machines Marketplace image. For example, + * Canonical or MicrosoftWindowsServer. + * + * @param vmImagePublisher the vmImagePublisher value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmImagePublisher(String vmImagePublisher) { + this.vmImagePublisher = vmImagePublisher; + return this; + } + + /** + * Get the vmImageOffer property: The offer type of the Azure Virtual Machines Marketplace image. For example, + * UbuntuServer or WindowsServer. + * + * @return the vmImageOffer value. + */ + public String vmImageOffer() { + return this.vmImageOffer; + } + + /** + * Set the vmImageOffer property: The offer type of the Azure Virtual Machines Marketplace image. For example, + * UbuntuServer or WindowsServer. + * + * @param vmImageOffer the vmImageOffer value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmImageOffer(String vmImageOffer) { + this.vmImageOffer = vmImageOffer; + return this; + } + + /** + * Get the vmImageSku property: The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or + * 2012-R2-Datacenter. + * + * @return the vmImageSku value. + */ + public String vmImageSku() { + return this.vmImageSku; + } + + /** + * Set the vmImageSku property: The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or + * 2012-R2-Datacenter. + * + * @param vmImageSku the vmImageSku value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmImageSku(String vmImageSku) { + this.vmImageSku = vmImageSku; + return this; + } + + /** + * Get the vmImageVersion property: The version of the Azure Virtual Machines Marketplace image. A value of 'latest' + * can be specified to select the latest version of an image. If omitted, the default is 'latest'. + * + * @return the vmImageVersion value. + */ + public String vmImageVersion() { + return this.vmImageVersion; + } + + /** + * Set the vmImageVersion property: The version of the Azure Virtual Machines Marketplace image. A value of 'latest' + * can be specified to select the latest version of an image. If omitted, the default is 'latest'. + * + * @param vmImageVersion the vmImageVersion value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmImageVersion(String vmImageVersion) { + this.vmImageVersion = vmImageVersion; + return this; + } + + /** + * Get the vmSecrets property: virtual machine secretes. The secrets to install in the virtual machines. + * + * @return the vmSecrets value. + */ + public List vmSecrets() { + return this.vmSecrets; + } + + /** + * Set the vmSecrets property: virtual machine secretes. The secrets to install in the virtual machines. + * + * @param vmSecrets the vmSecrets value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmSecrets(List vmSecrets) { + this.vmSecrets = vmSecrets; + return this; + } + + /** + * Get the vmExtensions property: virtual machine extensions. Set of extensions that should be installed onto the + * virtual machines. + * + * @return the vmExtensions value. + */ + public List vmExtensions() { + return this.vmExtensions; + } + + /** + * Set the vmExtensions property: virtual machine extensions. Set of extensions that should be installed onto the + * virtual machines. + * + * @param vmExtensions the vmExtensions value to set. + * @return the NodeTypeInner object itself. + */ + public NodeTypeInner withVmExtensions(List vmExtensions) { + this.vmExtensions = vmExtensions; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the managed cluster resource. + * + * @return the provisioningState value. + */ + public ManagedResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public NodeTypeInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (applicationPorts() != null) { + applicationPorts().validate(); + } + if (ephemeralPorts() != null) { + ephemeralPorts().validate(); + } + if (vmSecrets() != null) { + vmSecrets().forEach(e -> e.validate()); + } + if (vmExtensions() != null) { + vmExtensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceInner.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceInner.java index 6dc7ea0935b69..179694f0aece9 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceInner.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/fluent/models/ServiceResourceInner.java @@ -15,6 +15,7 @@ import com.azure.resourcemanager.servicefabric.models.ServiceLoadMetricDescription; import com.azure.resourcemanager.servicefabric.models.ServicePlacementPolicyDescription; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -87,6 +88,13 @@ public class ServiceResourceInner extends ProxyResource { @JsonProperty(value = "properties.servicePackageActivationMode") private ArmServicePackageActivationMode servicePackageActivationMode; + /* + * Dns name used for the service. If this is specified, then the service + * can be accessed via its DNS name instead of service name. + */ + @JsonProperty(value = "properties.serviceDnsName") + private String serviceDnsName; + /* * It will be deprecated in New API, resource location depends on the * parent resource. @@ -98,6 +106,7 @@ public class ServiceResourceInner extends ProxyResource { * Azure resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* @@ -288,6 +297,28 @@ public ServiceResourceInner withServicePackageActivationMode( return this; } + /** + * Get the serviceDnsName property: Dns name used for the service. If this is specified, then the service can be + * accessed via its DNS name instead of service name. + * + * @return the serviceDnsName value. + */ + public String serviceDnsName() { + return this.serviceDnsName; + } + + /** + * Set the serviceDnsName property: Dns name used for the service. If this is specified, then the service can be + * accessed via its DNS name instead of service name. + * + * @param serviceDnsName the serviceDnsName value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withServiceDnsName(String serviceDnsName) { + this.serviceDnsName = serviceDnsName; + return this; + } + /** * Get the location property: It will be deprecated in New API, resource location depends on the parent resource. * diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java index 72beea3d6ad11..f5f86fa9e45a6 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationResourceImpl.java @@ -11,6 +11,8 @@ import com.azure.resourcemanager.servicefabric.models.ApplicationResource; import com.azure.resourcemanager.servicefabric.models.ApplicationResourceUpdate; import com.azure.resourcemanager.servicefabric.models.ApplicationUpgradePolicy; +import com.azure.resourcemanager.servicefabric.models.ApplicationUserAssignedIdentity; +import com.azure.resourcemanager.servicefabric.models.ManagedIdentity; import java.util.Collections; import java.util.List; import java.util.Map; @@ -33,6 +35,10 @@ public String type() { return this.innerModel().type(); } + public ManagedIdentity identity() { + return this.innerModel().identity(); + } + public String typeVersion() { return this.innerModel().typeVersion(); } @@ -71,6 +77,15 @@ public List metrics() { } } + public List managedIdentities() { + List inner = this.innerModel().managedIdentities(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public String provisioningState() { return this.innerModel().provisioningState(); } @@ -214,13 +229,13 @@ public ApplicationResourceImpl withRegion(String location) { } public ApplicationResourceImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateParameters.withTags(tags); - return this; - } + this.innerModel().withTags(tags); + return this; + } + + public ApplicationResourceImpl withIdentity(ManagedIdentity identity) { + this.innerModel().withIdentity(identity); + return this; } public ApplicationResourceImpl withTypeVersion(String typeVersion) { @@ -293,6 +308,16 @@ public ApplicationResourceImpl withMetrics(List me } } + public ApplicationResourceImpl withManagedIdentities(List managedIdentities) { + if (isInCreateMode()) { + this.innerModel().withManagedIdentities(managedIdentities); + return this; + } else { + this.updateParameters.withManagedIdentities(managedIdentities); + return this; + } + } + public ApplicationResourceImpl withTypeName(String typeName) { this.innerModel().withTypeName(typeName); return this; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java index 4bd652d7fc180..b76f1d038cb85 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypeVersionsClientImpl.java @@ -176,6 +176,7 @@ private Mono> getWithResponseAsync if (version == null) { return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -188,7 +189,7 @@ private Mono> getWithResponseAsync clusterName, applicationTypeName, version, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -238,6 +239,7 @@ private Mono> getWithResponseAsync if (version == null) { return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -248,7 +250,7 @@ private Mono> getWithResponseAsync clusterName, applicationTypeName, version, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -373,6 +375,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -385,7 +388,7 @@ private Mono>> createOrUpdateWithResponseAsync( clusterName, applicationTypeName, version, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) @@ -445,6 +448,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -455,7 +459,7 @@ private Mono>> createOrUpdateWithResponseAsync( clusterName, applicationTypeName, version, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -727,6 +731,7 @@ private Mono>> deleteWithResponseAsync( if (version == null) { return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -739,7 +744,7 @@ private Mono>> deleteWithResponseAsync( clusterName, applicationTypeName, version, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -787,6 +792,7 @@ private Mono>> deleteWithResponseAsync( if (version == null) { return Mono.error(new IllegalArgumentException("Parameter version is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -797,7 +803,7 @@ private Mono>> deleteWithResponseAsync( clusterName, applicationTypeName, version, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -999,6 +1005,7 @@ private Mono> listWithResponse return Mono .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1010,7 +1017,7 @@ private Mono> listWithResponse resourceGroupName, clusterName, applicationTypeName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1056,6 +1063,7 @@ private Mono> listWithResponse return Mono .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1065,7 +1073,7 @@ private Mono> listWithResponse resourceGroupName, clusterName, applicationTypeName, - this.client.getApiVersion(), + apiVersion, accept, context); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java index ed4f75841b5d1..00b0802a381e6 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationTypesClientImpl.java @@ -167,6 +167,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -178,7 +179,7 @@ private Mono> getWithResponseAsync( resourceGroupName, clusterName, applicationTypeName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -224,6 +225,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -233,7 +235,7 @@ private Mono> getWithResponseAsync( resourceGroupName, clusterName, applicationTypeName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -349,6 +351,7 @@ private Mono> createOrUpdateWithResponseA } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -360,7 +363,7 @@ private Mono> createOrUpdateWithResponseA resourceGroupName, clusterName, applicationTypeName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) @@ -415,6 +418,7 @@ private Mono> createOrUpdateWithResponseA } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -424,7 +428,7 @@ private Mono> createOrUpdateWithResponseA resourceGroupName, clusterName, applicationTypeName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -541,6 +545,7 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -552,7 +557,7 @@ private Mono>> deleteWithResponseAsync( resourceGroupName, clusterName, applicationTypeName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -596,6 +601,7 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter applicationTypeName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -605,7 +611,7 @@ private Mono>> deleteWithResponseAsync( resourceGroupName, clusterName, applicationTypeName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -792,6 +798,7 @@ private Mono> listWithResponseAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -802,7 +809,7 @@ private Mono> listWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -843,6 +850,7 @@ private Mono> listWithResponseAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -851,7 +859,7 @@ private Mono> listWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, accept, context); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java index 75ac636303db7..1aa1c93167fdb 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ApplicationsClientImpl.java @@ -186,6 +186,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -197,7 +198,7 @@ private Mono> getWithResponseAsync( resourceGroupName, clusterName, applicationName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -243,6 +244,7 @@ private Mono> getWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -252,7 +254,7 @@ private Mono> getWithResponseAsync( resourceGroupName, clusterName, applicationName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -365,6 +367,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -376,7 +379,7 @@ private Mono>> createOrUpdateWithResponseAsync( resourceGroupName, clusterName, applicationName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) @@ -431,6 +434,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -440,7 +444,7 @@ private Mono>> createOrUpdateWithResponseAsync( resourceGroupName, clusterName, applicationName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -677,6 +681,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -688,7 +693,7 @@ private Mono>> updateWithResponseAsync( resourceGroupName, clusterName, applicationName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) @@ -743,6 +748,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -752,7 +758,7 @@ private Mono>> updateWithResponseAsync( resourceGroupName, clusterName, applicationName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -982,6 +988,7 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -993,7 +1000,7 @@ private Mono>> deleteWithResponseAsync( resourceGroupName, clusterName, applicationName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1037,6 +1044,7 @@ private Mono>> deleteWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1046,7 +1054,7 @@ private Mono>> deleteWithResponseAsync( resourceGroupName, clusterName, applicationName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1232,6 +1240,7 @@ private Mono> listWithResponseAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1242,7 +1251,7 @@ private Mono> listWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1282,6 +1291,7 @@ private Mono> listWithResponseAsync( if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1290,7 +1300,7 @@ private Mono> listWithResponseAsync( this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, accept, context); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java index bde35239511bd..94e8874ec62b5 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterImpl.java @@ -8,6 +8,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.servicefabric.fluent.models.ClusterInner; import com.azure.resourcemanager.servicefabric.models.AddOnFeatures; +import com.azure.resourcemanager.servicefabric.models.ApplicationTypeVersionsCleanupPolicy; import com.azure.resourcemanager.servicefabric.models.AzureActiveDirectory; import com.azure.resourcemanager.servicefabric.models.CertificateDescription; import com.azure.resourcemanager.servicefabric.models.ClientCertificateCommonName; @@ -176,6 +177,10 @@ public UpgradeMode upgradeMode() { return this.innerModel().upgradeMode(); } + public ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy() { + return this.innerModel().applicationTypeVersionsCleanupPolicy(); + } + public String vmImage() { return this.innerModel().vmImage(); } @@ -459,6 +464,17 @@ public ClusterImpl withUpgradeMode(UpgradeMode upgradeMode) { } } + public ClusterImpl withApplicationTypeVersionsCleanupPolicy( + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy) { + if (isInCreateMode()) { + this.innerModel().withApplicationTypeVersionsCleanupPolicy(applicationTypeVersionsCleanupPolicy); + return this; + } else { + this.updateParameters.withApplicationTypeVersionsCleanupPolicy(applicationTypeVersionsCleanupPolicy); + return this; + } + } + public ClusterImpl withVmImage(String vmImage) { this.innerModel().withVmImage(vmImage); return this; diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java index c116f5a671e97..04e7f724aca6f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClusterVersionsClientImpl.java @@ -145,6 +145,7 @@ private Mono> getWithResponseAsync( if (clusterVersion == null) { return Mono.error(new IllegalArgumentException("Parameter clusterVersion is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -153,7 +154,7 @@ private Mono> getWithResponseAsync( .get( this.client.getEndpoint(), location, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), clusterVersion, accept, @@ -193,13 +194,14 @@ private Mono> getWithResponseAsync( if (clusterVersion == null) { return Mono.error(new IllegalArgumentException("Parameter clusterVersion is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), location, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), clusterVersion, accept, @@ -296,6 +298,7 @@ private Mono> getByEnvironmentWithR if (clusterVersion == null) { return Mono.error(new IllegalArgumentException("Parameter clusterVersion is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -305,7 +308,7 @@ private Mono> getByEnvironmentWithR this.client.getEndpoint(), location, environment, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), clusterVersion, accept, @@ -349,6 +352,7 @@ private Mono> getByEnvironmentWithR if (clusterVersion == null) { return Mono.error(new IllegalArgumentException("Parameter clusterVersion is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -356,7 +360,7 @@ private Mono> getByEnvironmentWithR this.client.getEndpoint(), location, environment, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), clusterVersion, accept, @@ -449,6 +453,7 @@ private Mono> listWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -457,7 +462,7 @@ private Mono> listWithResponseAsync .list( this.client.getEndpoint(), location, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -491,16 +496,11 @@ private Mono> listWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), accept, context); } /** @@ -585,6 +585,7 @@ private Mono> listByEnvironmentWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -594,7 +595,7 @@ private Mono> listByEnvironmentWith this.client.getEndpoint(), location, environment, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -633,6 +634,7 @@ private Mono> listByEnvironmentWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -640,7 +642,7 @@ private Mono> listByEnvironmentWith this.client.getEndpoint(), location, environment, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java index aae99c10be1b4..a9ddf21cbd3c8 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ClustersClientImpl.java @@ -185,6 +185,7 @@ private Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -194,7 +195,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -235,6 +236,7 @@ private Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -242,7 +244,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -344,6 +346,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -353,7 +356,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -400,6 +403,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -407,7 +411,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -607,6 +611,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -616,7 +621,7 @@ private Mono>> updateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -664,6 +669,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -671,7 +677,7 @@ private Mono>> updateWithResponseAsync( this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), parameters, accept, @@ -870,6 +876,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -879,7 +886,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -919,6 +926,7 @@ private Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -926,7 +934,7 @@ private Mono> deleteWithResponseAsync( this.client.getEndpoint(), resourceGroupName, clusterName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -1004,6 +1012,7 @@ private Mono> listByResourceGroupWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1012,7 +1021,7 @@ private Mono> listByResourceGroupWithResponseAs .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context)) @@ -1048,13 +1057,14 @@ private Mono> listByResourceGroupWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), + apiVersion, this.client.getSubscriptionId(), accept, context); @@ -1132,17 +1142,13 @@ private Mono> listWithResponseAsync() { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1169,15 +1175,10 @@ private Mono> listWithResponseAsync(Context con new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); } /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterImpl.java new file mode 100644 index 0000000000000..c4518c802a0fb --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterImpl.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.servicefabric.models.AzureActiveDirectory; +import com.azure.resourcemanager.servicefabric.models.ClientCertificate; +import com.azure.resourcemanager.servicefabric.models.ClusterState; +import com.azure.resourcemanager.servicefabric.models.LoadBalancingRule; +import com.azure.resourcemanager.servicefabric.models.ManagedCluster; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterAddOnFeature; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterUpdateParameters; +import com.azure.resourcemanager.servicefabric.models.ManagedResourceProvisioningState; +import com.azure.resourcemanager.servicefabric.models.SettingsSectionDescription; +import com.azure.resourcemanager.servicefabric.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ManagedClusterImpl implements ManagedCluster, ManagedCluster.Definition, ManagedCluster.Update { + private ManagedClusterInner innerObject; + + private final com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public String dnsName() { + return this.innerModel().dnsName(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String clusterId() { + return this.innerModel().clusterId(); + } + + public ClusterState clusterState() { + return this.innerModel().clusterState(); + } + + public String clusterCertificateThumbprint() { + return this.innerModel().clusterCertificateThumbprint(); + } + + public Integer clientConnectionPort() { + return this.innerModel().clientConnectionPort(); + } + + public Integer httpGatewayConnectionPort() { + return this.innerModel().httpGatewayConnectionPort(); + } + + public String adminUsername() { + return this.innerModel().adminUsername(); + } + + public String adminPassword() { + return this.innerModel().adminPassword(); + } + + public List loadBalancingRules() { + List inner = this.innerModel().loadBalancingRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List clients() { + List inner = this.innerModel().clients(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AzureActiveDirectory azureActiveDirectory() { + return this.innerModel().azureActiveDirectory(); + } + + public List fabricSettings() { + List inner = this.innerModel().fabricSettings(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedResourceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String clusterCodeVersion() { + return this.innerModel().clusterCodeVersion(); + } + + public List addonFeatures() { + List inner = this.innerModel().addonFeatures(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ManagedClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabric.ServiceFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private ManagedClusterUpdateParameters updateParameters; + + public ManagedClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ManagedCluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedCluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .createOrUpdate(resourceGroupName, clusterName, this.innerModel(), context); + return this; + } + + ManagedClusterImpl(String name, com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager) { + this.innerObject = new ManagedClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ManagedClusterImpl update() { + this.updateParameters = new ManagedClusterUpdateParameters(); + return this; + } + + public ManagedCluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .update(resourceGroupName, clusterName, updateParameters, Context.NONE); + return this; + } + + public ManagedCluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .update(resourceGroupName, clusterName, updateParameters, context); + return this; + } + + ManagedClusterImpl( + ManagedClusterInner innerObject, com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "managedClusters"); + } + + public ManagedCluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public ManagedCluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) + .getValue(); + return this; + } + + public ManagedClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ManagedClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ManagedClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ManagedClusterImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ManagedClusterImpl withDnsName(String dnsName) { + this.innerModel().withDnsName(dnsName); + return this; + } + + public ManagedClusterImpl withClientConnectionPort(Integer clientConnectionPort) { + if (isInCreateMode()) { + this.innerModel().withClientConnectionPort(clientConnectionPort); + return this; + } else { + this.updateParameters.withClientConnectionPort(clientConnectionPort); + return this; + } + } + + public ManagedClusterImpl withHttpGatewayConnectionPort(Integer httpGatewayConnectionPort) { + if (isInCreateMode()) { + this.innerModel().withHttpGatewayConnectionPort(httpGatewayConnectionPort); + return this; + } else { + this.updateParameters.withHttpGatewayConnectionPort(httpGatewayConnectionPort); + return this; + } + } + + public ManagedClusterImpl withAdminUsername(String adminUsername) { + this.innerModel().withAdminUsername(adminUsername); + return this; + } + + public ManagedClusterImpl withAdminPassword(String adminPassword) { + this.innerModel().withAdminPassword(adminPassword); + return this; + } + + public ManagedClusterImpl withLoadBalancingRules(List loadBalancingRules) { + if (isInCreateMode()) { + this.innerModel().withLoadBalancingRules(loadBalancingRules); + return this; + } else { + this.updateParameters.withLoadBalancingRules(loadBalancingRules); + return this; + } + } + + public ManagedClusterImpl withClients(List clients) { + if (isInCreateMode()) { + this.innerModel().withClients(clients); + return this; + } else { + this.updateParameters.withClients(clients); + return this; + } + } + + public ManagedClusterImpl withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + if (isInCreateMode()) { + this.innerModel().withAzureActiveDirectory(azureActiveDirectory); + return this; + } else { + this.updateParameters.withAzureActiveDirectory(azureActiveDirectory); + return this; + } + } + + public ManagedClusterImpl withFabricSettings(List fabricSettings) { + if (isInCreateMode()) { + this.innerModel().withFabricSettings(fabricSettings); + return this; + } else { + this.updateParameters.withFabricSettings(fabricSettings); + return this; + } + } + + public ManagedClusterImpl withClusterCodeVersion(String clusterCodeVersion) { + if (isInCreateMode()) { + this.innerModel().withClusterCodeVersion(clusterCodeVersion); + return this; + } else { + this.updateParameters.withClusterCodeVersion(clusterCodeVersion); + return this; + } + } + + public ManagedClusterImpl withAddonFeatures(List addonFeatures) { + if (isInCreateMode()) { + this.innerModel().withAddonFeatures(addonFeatures); + return this; + } else { + this.updateParameters.withAddonFeatures(addonFeatures); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionDetailsImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionDetailsImpl.java new file mode 100644 index 0000000000000..3eabf0475ae65 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionDetailsImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner; +import com.azure.resourcemanager.servicefabric.models.ClusterOsType; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionDetails; + +public final class ManagedClusterVersionDetailsImpl implements ManagedClusterVersionDetails { + private ManagedClusterVersionDetailsInner innerObject; + + private final com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager; + + ManagedClusterVersionDetailsImpl( + ManagedClusterVersionDetailsInner innerObject, + com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String msiVersion() { + return this.innerModel().msiVersion(); + } + + public String supportExpiryUtc() { + return this.innerModel().supportExpiryUtc(); + } + + public ClusterOsType osType() { + return this.innerModel().osType(); + } + + public ManagedClusterVersionDetailsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabric.ServiceFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsClientImpl.java new file mode 100644 index 0000000000000..1c5c25ccc41d8 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsClientImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClusterVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionsOsType; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedClusterVersionsClient. */ +public final class ManagedClusterVersionsClientImpl implements ManagedClusterVersionsClient { + private final ClientLogger logger = new ClientLogger(ManagedClusterVersionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedClusterVersionsService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ManagedClusterVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedClusterVersionsClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy + .create(ManagedClusterVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientManagedClusterVersions to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private interface ManagedClusterVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedclusters/locations/{location}" + + "/osType/{osType}/clusterVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listByOS( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @PathParam("osType") ManagedClusterVersionsOsType osType, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available code versions for Service Fabric cluster resources by OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listByOSWithResponseAsync( + String location, ManagedClusterVersionsOsType osType) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (osType == null) { + return Mono.error(new IllegalArgumentException("Parameter osType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByOS( + this.client.getEndpoint(), + location, + osType, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available code versions for Service Fabric cluster resources by OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listByOSWithResponseAsync( + String location, ManagedClusterVersionsOsType osType, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (osType == null) { + return Mono.error(new IllegalArgumentException("Parameter osType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByOS( + this.client.getEndpoint(), + location, + osType, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available code versions for Service Fabric cluster resources by OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByOSAsync( + String location, ManagedClusterVersionsOsType osType) { + return listByOSWithResponseAsync(location, osType) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available code versions for Service Fabric cluster resources by OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listByOS(String location, ManagedClusterVersionsOsType osType) { + return listByOSAsync(location, osType).block(); + } + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available code versions for Service Fabric cluster resources by OS type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listByOSWithResponse( + String location, ManagedClusterVersionsOsType osType, Context context) { + return listByOSWithResponseAsync(location, osType, context).block(); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsImpl.java new file mode 100644 index 0000000000000..fbff96d374ba6 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClusterVersionsImpl.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClusterVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionDetails; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersions; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterVersionsOsType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ManagedClusterVersionsImpl implements ManagedClusterVersions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterVersionsImpl.class); + + private final ManagedClusterVersionsClient innerClient; + + private final com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager; + + public ManagedClusterVersionsImpl( + ManagedClusterVersionsClient innerClient, + com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public List listByOS(String location, ManagedClusterVersionsOsType osType) { + List inner = this.serviceClient().listByOS(location, osType); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ManagedClusterVersionDetailsImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listByOSWithResponse( + String location, ManagedClusterVersionsOsType osType, Context context) { + Response> inner = + this.serviceClient().listByOSWithResponse(location, osType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new ManagedClusterVersionDetailsImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + private ManagedClusterVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabric.ServiceFabricManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersClientImpl.java new file mode 100644 index 0000000000000..cbd38314b3288 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersClientImpl.java @@ -0,0 +1,1549 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClustersClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterListResult; +import com.azure.resourcemanager.servicefabric.models.ManagedClusterUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedClustersClient. */ +public final class ManagedClustersClientImpl implements ManagedClustersClient { + private final ClientLogger logger = new ClientLogger(ManagedClustersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedClustersService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of ManagedClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedClustersClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy.create(ManagedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientManagedClusters to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private interface ManagedClustersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ManagedClusterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ManagedClusterUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + } + + /** + * Get a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Create or update a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, ManagedClusterInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Create or update a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedClusterInner.class, + ManagedClusterInner.class, + Context.NONE); + } + + /** + * Create or update a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedClusterInner.class, ManagedClusterInner.class, context); + } + + /** + * Create or update a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Create or update a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Create or update a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Create or update a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner createOrUpdate( + String resourceGroupName, String clusterName, ManagedClusterInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedClusterInner.class, + ManagedClusterInner.class, + Context.NONE); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedClusterInner.class, ManagedClusterInner.class, context); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner update( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters) { + return updateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Update the configuration of a Service Fabric managed 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 to update the managed cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the manged cluster resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner update( + String resourceGroupName, String clusterName, ManagedClusterUpdateParameters parameters, Context context) { + return updateAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Delete a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + clusterName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Delete a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Delete a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Service Fabric managed 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Cluster list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Cluster list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Cluster list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Cluster list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersImpl.java new file mode 100644 index 0000000000000..d96191db8d947 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ManagedClustersImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClustersClient; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.servicefabric.models.ManagedCluster; +import com.azure.resourcemanager.servicefabric.models.ManagedClusters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagedClustersImpl implements ManagedClusters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClustersImpl.class); + + private final ManagedClustersClient innerClient; + + private final com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager; + + public ManagedClustersImpl( + ManagedClustersClient innerClient, + com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ManagedClusterImpl(inner1, this.manager())); + } + + public ManagedCluster getByResourceGroup(String resourceGroupName, String clusterName) { + ManagedClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ManagedClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public ManagedCluster getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + this.delete(resourceGroupName, clusterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + this.delete(resourceGroupName, clusterName, context); + } + + private ManagedClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabric.ServiceFabricManager manager() { + return this.serviceManager; + } + + public ManagedClusterImpl define(String name) { + return new ManagedClusterImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypeImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypeImpl.java new file mode 100644 index 0000000000000..5f511773d5237 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypeImpl.java @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import com.azure.resourcemanager.servicefabric.models.EndpointRangeDescription; +import com.azure.resourcemanager.servicefabric.models.ManagedResourceProvisioningState; +import com.azure.resourcemanager.servicefabric.models.NodeType; +import com.azure.resourcemanager.servicefabric.models.NodeTypeActionParameters; +import com.azure.resourcemanager.servicefabric.models.NodeTypeUpdateParameters; +import com.azure.resourcemanager.servicefabric.models.VaultSecretGroup; +import com.azure.resourcemanager.servicefabric.models.VmssExtension; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class NodeTypeImpl implements NodeType, NodeType.Definition, NodeType.Update { + private NodeTypeInner innerObject; + + private final com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Boolean isPrimary() { + return this.innerModel().isPrimary(); + } + + public Integer vmInstanceCount() { + return this.innerModel().vmInstanceCount(); + } + + public Integer dataDiskSizeGB() { + return this.innerModel().dataDiskSizeGB(); + } + + public Map placementProperties() { + Map inner = this.innerModel().placementProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map capacities() { + Map inner = this.innerModel().capacities(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public EndpointRangeDescription applicationPorts() { + return this.innerModel().applicationPorts(); + } + + public EndpointRangeDescription ephemeralPorts() { + return this.innerModel().ephemeralPorts(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public String vmImagePublisher() { + return this.innerModel().vmImagePublisher(); + } + + public String vmImageOffer() { + return this.innerModel().vmImageOffer(); + } + + public String vmImageSku() { + return this.innerModel().vmImageSku(); + } + + public String vmImageVersion() { + return this.innerModel().vmImageVersion(); + } + + public List vmSecrets() { + List inner = this.innerModel().vmSecrets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List vmExtensions() { + List inner = this.innerModel().vmExtensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedResourceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public NodeTypeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.servicefabric.ServiceFabricManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String nodeTypeName; + + private NodeTypeUpdateParameters updateParameters; + + public NodeTypeImpl withExistingManagedCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public NodeType create() { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .createOrUpdate(resourceGroupName, clusterName, nodeTypeName, this.innerModel(), Context.NONE); + return this; + } + + public NodeType create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .createOrUpdate(resourceGroupName, clusterName, nodeTypeName, this.innerModel(), context); + return this; + } + + NodeTypeImpl(String name, com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager) { + this.innerObject = new NodeTypeInner(); + this.serviceManager = serviceManager; + this.nodeTypeName = name; + } + + public NodeTypeImpl update() { + this.updateParameters = new NodeTypeUpdateParameters(); + return this; + } + + public NodeType apply() { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .update(resourceGroupName, clusterName, nodeTypeName, updateParameters, Context.NONE); + return this; + } + + public NodeType apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .update(resourceGroupName, clusterName, nodeTypeName, updateParameters, context); + return this; + } + + NodeTypeImpl( + NodeTypeInner innerObject, com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "managedClusters"); + this.nodeTypeName = Utils.getValueFromIdByName(innerObject.id(), "nodeTypes"); + } + + public NodeType refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .getWithResponse(resourceGroupName, clusterName, nodeTypeName, Context.NONE) + .getValue(); + return this; + } + + public NodeType refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getNodeTypes() + .getWithResponse(resourceGroupName, clusterName, nodeTypeName, context) + .getValue(); + return this; + } + + public void restart(NodeTypeActionParameters parameters) { + serviceManager.nodeTypes().restart(resourceGroupName, clusterName, nodeTypeName, parameters); + } + + public void restart(NodeTypeActionParameters parameters, Context context) { + serviceManager.nodeTypes().restart(resourceGroupName, clusterName, nodeTypeName, parameters, context); + } + + public void reimage(NodeTypeActionParameters parameters) { + serviceManager.nodeTypes().reimage(resourceGroupName, clusterName, nodeTypeName, parameters); + } + + public void reimage(NodeTypeActionParameters parameters, Context context) { + serviceManager.nodeTypes().reimage(resourceGroupName, clusterName, nodeTypeName, parameters, context); + } + + public void deleteNode(NodeTypeActionParameters parameters) { + serviceManager.nodeTypes().deleteNode(resourceGroupName, clusterName, nodeTypeName, parameters); + } + + public void deleteNode(NodeTypeActionParameters parameters, Context context) { + serviceManager.nodeTypes().deleteNode(resourceGroupName, clusterName, nodeTypeName, parameters, context); + } + + public NodeTypeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public NodeTypeImpl withIsPrimary(Boolean isPrimary) { + this.innerModel().withIsPrimary(isPrimary); + return this; + } + + public NodeTypeImpl withVmInstanceCount(Integer vmInstanceCount) { + if (isInCreateMode()) { + this.innerModel().withVmInstanceCount(vmInstanceCount); + return this; + } else { + this.updateParameters.withVmInstanceCount(vmInstanceCount); + return this; + } + } + + public NodeTypeImpl withDataDiskSizeGB(Integer dataDiskSizeGB) { + this.innerModel().withDataDiskSizeGB(dataDiskSizeGB); + return this; + } + + public NodeTypeImpl withPlacementProperties(Map placementProperties) { + if (isInCreateMode()) { + this.innerModel().withPlacementProperties(placementProperties); + return this; + } else { + this.updateParameters.withPlacementProperties(placementProperties); + return this; + } + } + + public NodeTypeImpl withCapacities(Map capacities) { + if (isInCreateMode()) { + this.innerModel().withCapacities(capacities); + return this; + } else { + this.updateParameters.withCapacities(capacities); + return this; + } + } + + public NodeTypeImpl withApplicationPorts(EndpointRangeDescription applicationPorts) { + if (isInCreateMode()) { + this.innerModel().withApplicationPorts(applicationPorts); + return this; + } else { + this.updateParameters.withApplicationPorts(applicationPorts); + return this; + } + } + + public NodeTypeImpl withEphemeralPorts(EndpointRangeDescription ephemeralPorts) { + if (isInCreateMode()) { + this.innerModel().withEphemeralPorts(ephemeralPorts); + return this; + } else { + this.updateParameters.withEphemeralPorts(ephemeralPorts); + return this; + } + } + + public NodeTypeImpl withVmSize(String vmSize) { + this.innerModel().withVmSize(vmSize); + return this; + } + + public NodeTypeImpl withVmImagePublisher(String vmImagePublisher) { + this.innerModel().withVmImagePublisher(vmImagePublisher); + return this; + } + + public NodeTypeImpl withVmImageOffer(String vmImageOffer) { + this.innerModel().withVmImageOffer(vmImageOffer); + return this; + } + + public NodeTypeImpl withVmImageSku(String vmImageSku) { + this.innerModel().withVmImageSku(vmImageSku); + return this; + } + + public NodeTypeImpl withVmImageVersion(String vmImageVersion) { + this.innerModel().withVmImageVersion(vmImageVersion); + return this; + } + + public NodeTypeImpl withVmSecrets(List vmSecrets) { + if (isInCreateMode()) { + this.innerModel().withVmSecrets(vmSecrets); + return this; + } else { + this.updateParameters.withVmSecrets(vmSecrets); + return this; + } + } + + public NodeTypeImpl withVmExtensions(List vmExtensions) { + if (isInCreateMode()) { + this.innerModel().withVmExtensions(vmExtensions); + return this; + } else { + this.updateParameters.withVmExtensions(vmExtensions); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesClientImpl.java new file mode 100644 index 0000000000000..26f3eb3324aa1 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesClientImpl.java @@ -0,0 +1,2401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.servicefabric.fluent.NodeTypesClient; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import com.azure.resourcemanager.servicefabric.models.NodeTypeActionParameters; +import com.azure.resourcemanager.servicefabric.models.NodeTypeListResult; +import com.azure.resourcemanager.servicefabric.models.NodeTypeUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NodeTypesClient. */ +public final class NodeTypesClientImpl implements NodeTypesClient { + private final ClientLogger logger = new ClientLogger(NodeTypesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final NodeTypesService service; + + /** The service client containing this operation class. */ + private final ServiceFabricManagementClientImpl client; + + /** + * Initializes an instance of NodeTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NodeTypesClientImpl(ServiceFabricManagementClientImpl client) { + this.service = + RestProxy.create(NodeTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ServiceFabricManagementClientNodeTypes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ServiceFabricManagem") + private interface NodeTypesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByManagedClusters( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NodeTypeActionParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/reimage") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reimage( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NodeTypeActionParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteNode( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NodeTypeActionParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NodeTypeInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NodeTypeUpdateParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric" + + "/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("nodeTypeName") String nodeTypeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByManagedClustersNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClustersSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByManagedClusters( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + clusterName, + apiVersion, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClustersSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByManagedClusters( + this.client.getEndpoint(), + resourceGroupName, + this.client.getSubscriptionId(), + clusterName, + apiVersion, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByManagedClustersAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByManagedClustersSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByManagedClustersNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByManagedClustersAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByManagedClustersSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByManagedClustersNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagedClusters(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByManagedClustersAsync(resourceGroupName, clusterName)); + } + + /** + * Gets all Node types of the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Node types of the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagedClusters( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByManagedClustersAsync(resourceGroupName, clusterName, context)); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginRestartAsync(resourceGroupName, clusterName, nodeTypeName, parameters).getSyncPoller(); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginRestartAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).getSyncPoller(); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginRestartAsync(resourceGroupName, clusterName, nodeTypeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginRestartAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + restartAsync(resourceGroupName, clusterName, nodeTypeName, parameters).block(); + } + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + restartAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).block(); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .reimage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> reimageWithResponseAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .reimage( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginReimageAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + reimageWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginReimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters).getSyncPoller(); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginReimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginReimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).getSyncPoller(); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginReimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono reimageAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginReimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + reimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters).block(); + } + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void reimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + reimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).block(); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteNodeWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteNode( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteNodeWithResponseAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteNode( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteNodeAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + Mono>> mono = + deleteNodeWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteNodeAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteNodeWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginDeleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters).getSyncPoller(); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDeleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginDeleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).getSyncPoller(); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteNodeAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + return beginDeleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteNodeAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + return beginDeleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + deleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters).block(); + } + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + deleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).block(); + } + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + accept, + context); + } + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String nodeTypeName) { + return getWithResponseAsync(resourceGroupName, clusterName, nodeTypeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodeTypeInner get(String resourceGroupName, String clusterName, String nodeTypeName) { + return getAsync(resourceGroupName, clusterName, nodeTypeName).block(); + } + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, context).block(); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NodeTypeInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NodeTypeInner.class, NodeTypeInner.class, Context.NONE); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NodeTypeInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NodeTypeInner.class, NodeTypeInner.class, context); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NodeTypeInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).getSyncPoller(); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NodeTypeInner> beginCreateOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodeTypeInner createOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters) { + return createOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).block(); + } + + /** + * Create or update a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The node type resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodeTypeInner createOrUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).block(); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + parameters, + accept, + context); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NodeTypeInner> beginUpdateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NodeTypeInner.class, NodeTypeInner.class, Context.NONE); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, NodeTypeInner> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), NodeTypeInner.class, NodeTypeInner.class, context); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NodeTypeInner> beginUpdate( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).getSyncPoller(); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, NodeTypeInner> beginUpdate( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).getSyncPoller(); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodeTypeInner update( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeUpdateParameters parameters) { + return updateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).block(); + } + + /** + * Update the configuration of a node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters The parameters to update the node type configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a node type in the cluster, each node type represents sub set of nodes in the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NodeTypeInner update( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeUpdateParameters parameters, + Context context) { + return updateAsync(resourceGroupName, clusterName, nodeTypeName, parameters, context).block(); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (nodeTypeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeTypeName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + nodeTypeName, + apiVersion, + accept, + context); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String nodeTypeName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, nodeTypeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, nodeTypeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String nodeTypeName) { + return beginDeleteAsync(resourceGroupName, clusterName, nodeTypeName).getSyncPoller(); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, nodeTypeName, context).getSyncPoller(); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String nodeTypeName) { + return beginDeleteAsync(resourceGroupName, clusterName, nodeTypeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, nodeTypeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String nodeTypeName) { + deleteAsync(resourceGroupName, clusterName, nodeTypeName).block(); + } + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + deleteAsync(resourceGroupName, clusterName, nodeTypeName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return node type list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClustersNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByManagedClustersNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return node type list results. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClustersNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByManagedClustersNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesImpl.java new file mode 100644 index 0000000000000..9bee0f142d72a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/NodeTypesImpl.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.NodeTypesClient; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import com.azure.resourcemanager.servicefabric.models.NodeType; +import com.azure.resourcemanager.servicefabric.models.NodeTypeActionParameters; +import com.azure.resourcemanager.servicefabric.models.NodeTypes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class NodeTypesImpl implements NodeTypes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypesImpl.class); + + private final NodeTypesClient innerClient; + + private final com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager; + + public NodeTypesImpl( + NodeTypesClient innerClient, com.azure.resourcemanager.servicefabric.ServiceFabricManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByManagedClusters(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByManagedClusters(resourceGroupName, clusterName); + return Utils.mapPage(inner, inner1 -> new NodeTypeImpl(inner1, this.manager())); + } + + public PagedIterable listByManagedClusters( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByManagedClusters(resourceGroupName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new NodeTypeImpl(inner1, this.manager())); + } + + public void restart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + this.serviceClient().restart(resourceGroupName, clusterName, nodeTypeName, parameters); + } + + public void restart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + this.serviceClient().restart(resourceGroupName, clusterName, nodeTypeName, parameters, context); + } + + public void reimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + this.serviceClient().reimage(resourceGroupName, clusterName, nodeTypeName, parameters); + } + + public void reimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + this.serviceClient().reimage(resourceGroupName, clusterName, nodeTypeName, parameters, context); + } + + public void deleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters) { + this.serviceClient().deleteNode(resourceGroupName, clusterName, nodeTypeName, parameters); + } + + public void deleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context) { + this.serviceClient().deleteNode(resourceGroupName, clusterName, nodeTypeName, parameters, context); + } + + public NodeType get(String resourceGroupName, String clusterName, String nodeTypeName) { + NodeTypeInner inner = this.serviceClient().get(resourceGroupName, clusterName, nodeTypeName); + if (inner != null) { + return new NodeTypeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, nodeTypeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NodeTypeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String nodeTypeName) { + this.serviceClient().delete(resourceGroupName, clusterName, nodeTypeName); + } + + public void delete(String resourceGroupName, String clusterName, String nodeTypeName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, nodeTypeName, context); + } + + public NodeType getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String nodeTypeName = Utils.getValueFromIdByName(id, "nodeTypes"); + if (nodeTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodeTypes'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, nodeTypeName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String nodeTypeName = Utils.getValueFromIdByName(id, "nodeTypes"); + if (nodeTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodeTypes'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, nodeTypeName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String nodeTypeName = Utils.getValueFromIdByName(id, "nodeTypes"); + if (nodeTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodeTypes'.", id))); + } + this.delete(resourceGroupName, clusterName, nodeTypeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "managedClusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String nodeTypeName = Utils.getValueFromIdByName(id, "nodeTypes"); + if (nodeTypeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nodeTypes'.", id))); + } + this.delete(resourceGroupName, clusterName, nodeTypeName, context); + } + + private NodeTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.servicefabric.ServiceFabricManager manager() { + return this.serviceManager; + } + + public NodeTypeImpl define(String name) { + return new NodeTypeImpl(name, this.manager()); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java index 6a77db5cd69c4..3f073dc355c81 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsClientImpl.java @@ -69,6 +69,36 @@ Mono> list( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ServiceFabric/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ServiceFabric/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ServiceFabric/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -95,10 +125,361 @@ private Mono> listSinglePageAsync() { new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2020-03-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2020-01-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) .>map( res -> new PagedResponseBase<>( @@ -128,10 +509,11 @@ private Mono> listSinglePageAsync(Context co new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + final String apiVersion = "2020-01-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .list(this.client.getEndpoint(), apiVersion, accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java index 8e6ec8b7e955a..87affc18c8934 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/OperationsImpl.java @@ -36,6 +36,36 @@ public PagedIterable list(Context context) { return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + } + private OperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java index 67ba2bb540f28..a1e74592806fc 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceFabricManagementClientImpl.java @@ -26,6 +26,9 @@ import com.azure.resourcemanager.servicefabric.fluent.ApplicationsClient; import com.azure.resourcemanager.servicefabric.fluent.ClusterVersionsClient; import com.azure.resourcemanager.servicefabric.fluent.ClustersClient; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClusterVersionsClient; +import com.azure.resourcemanager.servicefabric.fluent.ManagedClustersClient; +import com.azure.resourcemanager.servicefabric.fluent.NodeTypesClient; import com.azure.resourcemanager.servicefabric.fluent.OperationsClient; import com.azure.resourcemanager.servicefabric.fluent.ServiceFabricManagementClient; import com.azure.resourcemanager.servicefabric.fluent.ServicesClient; @@ -68,18 +71,6 @@ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** The HTTP pipeline to send requests through. */ private final HttpPipeline httpPipeline; @@ -200,6 +191,42 @@ public ServicesClient getServices() { return this.services; } + /** The ManagedClustersClient object to access its operations. */ + private final ManagedClustersClient managedClusters; + + /** + * Gets the ManagedClustersClient object to access its operations. + * + * @return the ManagedClustersClient object. + */ + public ManagedClustersClient getManagedClusters() { + return this.managedClusters; + } + + /** The ManagedClusterVersionsClient object to access its operations. */ + private final ManagedClusterVersionsClient managedClusterVersions; + + /** + * Gets the ManagedClusterVersionsClient object to access its operations. + * + * @return the ManagedClusterVersionsClient object. + */ + public ManagedClusterVersionsClient getManagedClusterVersions() { + return this.managedClusterVersions; + } + + /** The NodeTypesClient object to access its operations. */ + private final NodeTypesClient nodeTypes; + + /** + * Gets the NodeTypesClient object to access its operations. + * + * @return the NodeTypesClient object. + */ + public NodeTypesClient getNodeTypes() { + return this.nodeTypes; + } + /** * Initializes an instance of ServiceFabricManagementClient client. * @@ -222,7 +249,6 @@ public ServicesClient getServices() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2019-03-01"; this.clusters = new ClustersClientImpl(this); this.clusterVersions = new ClusterVersionsClientImpl(this); this.operations = new OperationsClientImpl(this); @@ -230,6 +256,9 @@ public ServicesClient getServices() { this.applicationTypeVersions = new ApplicationTypeVersionsClientImpl(this); this.applications = new ApplicationsClientImpl(this); this.services = new ServicesClientImpl(this); + this.managedClusters = new ManagedClustersClientImpl(this); + this.managedClusterVersions = new ManagedClusterVersionsClientImpl(this); + this.nodeTypes = new NodeTypesClientImpl(this); } /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java index d9b6ab0da5b4e..c4f79c7690529 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServiceResourceImpl.java @@ -87,6 +87,10 @@ public ArmServicePackageActivationMode servicePackageActivationMode() { return this.innerModel().servicePackageActivationMode(); } + public String serviceDnsName() { + return this.innerModel().serviceDnsName(); + } + public String location() { return this.innerModel().location(); } @@ -228,13 +232,8 @@ public ServiceResourceImpl withRegion(String location) { } public ServiceResourceImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateParameters.withTags(tags); - return this; - } + this.innerModel().withTags(tags); + return this; } public ServiceResourceImpl withPlacementConstraints(String placementConstraints) { @@ -304,6 +303,11 @@ public ServiceResourceImpl withServicePackageActivationMode( return this; } + public ServiceResourceImpl withServiceDnsName(String serviceDnsName) { + this.innerModel().withServiceDnsName(serviceDnsName); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java index 0969bee7b4c4c..c39029f48e9fa 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/implementation/ServicesClientImpl.java @@ -194,6 +194,7 @@ private Mono> getWithResponseAsync( if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -206,7 +207,7 @@ private Mono> getWithResponseAsync( clusterName, applicationName, serviceName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -256,6 +257,7 @@ private Mono> getWithResponseAsync( if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -266,7 +268,7 @@ private Mono> getWithResponseAsync( clusterName, applicationName, serviceName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -391,6 +393,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -403,7 +406,7 @@ private Mono>> createOrUpdateWithResponseAsync( clusterName, applicationName, serviceName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) @@ -463,6 +466,7 @@ private Mono>> createOrUpdateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -473,7 +477,7 @@ private Mono>> createOrUpdateWithResponseAsync( clusterName, applicationName, serviceName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -747,6 +751,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -759,7 +764,7 @@ private Mono>> updateWithResponseAsync( clusterName, applicationName, serviceName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context)) @@ -819,6 +824,7 @@ private Mono>> updateWithResponseAsync( } else { parameters.validate(); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -829,7 +835,7 @@ private Mono>> updateWithResponseAsync( clusterName, applicationName, serviceName, - this.client.getApiVersion(), + apiVersion, parameters, accept, context); @@ -1089,6 +1095,7 @@ private Mono>> deleteWithResponseAsync( if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1101,7 +1108,7 @@ private Mono>> deleteWithResponseAsync( clusterName, applicationName, serviceName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1149,6 +1156,7 @@ private Mono>> deleteWithResponseAsync( if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1159,7 +1167,7 @@ private Mono>> deleteWithResponseAsync( clusterName, applicationName, serviceName, - this.client.getApiVersion(), + apiVersion, accept, context); } @@ -1360,6 +1368,7 @@ private Mono> listWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; return FluxUtil .withContext( @@ -1371,7 +1380,7 @@ private Mono> listWithResponseAsync( resourceGroupName, clusterName, applicationName, - this.client.getApiVersion(), + apiVersion, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1416,6 +1425,7 @@ private Mono> listWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); } + final String apiVersion = "2020-03-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service @@ -1425,7 +1435,7 @@ private Mono> listWithResponseAsync( resourceGroupName, clusterName, applicationName, - this.client.getApiVersion(), + apiVersion, accept, context); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java index a98073826319e..c88fd92c9d103 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationDeltaHealthPolicy.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -30,6 +31,7 @@ public final class ApplicationDeltaHealthPolicy { * map is empty by default. */ @JsonProperty(value = "serviceTypeDeltaHealthPolicies") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map serviceTypeDeltaHealthPolicies; /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java index 939320b117220..0d03e8ffcd7f6 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationHealthPolicy.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -27,6 +28,7 @@ public final class ApplicationHealthPolicy { * is empty by default. */ @JsonProperty(value = "serviceTypeHealthPolicies") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map serviceTypeHealthPolicies; /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java index 109c1fe8e0d99..9cca5b366ee8f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResource.java @@ -33,6 +33,13 @@ public interface ApplicationResource { */ String type(); + /** + * Gets the identity property: Describes the managed identities for an Azure resource. + * + * @return the identity value. + */ + ManagedIdentity identity(); + /** * Gets the typeVersion property: The version of the application type as defined in the application manifest. * @@ -88,6 +95,14 @@ public interface ApplicationResource { */ List metrics(); + /** + * Gets the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @return the managedIdentities value. + */ + List managedIdentities(); + /** * Gets the provisioningState property: The current deployment or provisioning state, which only appears in the * response. @@ -172,6 +187,7 @@ interface WithParentResource { interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, + DefinitionStages.WithIdentity, DefinitionStages.WithTypeVersion, DefinitionStages.WithParameters, DefinitionStages.WithUpgradePolicy, @@ -179,6 +195,7 @@ interface WithCreate DefinitionStages.WithMaximumNodes, DefinitionStages.WithRemoveApplicationCapacity, DefinitionStages.WithMetrics, + DefinitionStages.WithManagedIdentities, DefinitionStages.WithTypeName { /** * Executes the create request. @@ -223,6 +240,16 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the ApplicationResource definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Describes the managed identities for an Azure resource.. + * + * @param identity Describes the managed identities for an Azure resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedIdentity identity); + } /** The stage of the ApplicationResource definition allowing to specify typeVersion. */ interface WithTypeVersion { /** @@ -308,6 +335,18 @@ interface WithMetrics { */ WithCreate withMetrics(List metrics); } + /** The stage of the ApplicationResource definition allowing to specify managedIdentities. */ + interface WithManagedIdentities { + /** + * Specifies the managedIdentities property: List of user assigned identities for the application, each + * mapped to a friendly name.. + * + * @param managedIdentities List of user assigned identities for the application, each mapped to a friendly + * name. + * @return the next definition stage. + */ + WithCreate withManagedIdentities(List managedIdentities); + } /** The stage of the ApplicationResource definition allowing to specify typeName. */ interface WithTypeName { /** @@ -328,14 +367,14 @@ interface WithTypeName { /** The template for ApplicationResource update. */ interface Update - extends UpdateStages.WithTags, - UpdateStages.WithTypeVersion, + extends UpdateStages.WithTypeVersion, UpdateStages.WithParameters, UpdateStages.WithUpgradePolicy, UpdateStages.WithMinimumNodes, UpdateStages.WithMaximumNodes, UpdateStages.WithRemoveApplicationCapacity, - UpdateStages.WithMetrics { + UpdateStages.WithMetrics, + UpdateStages.WithManagedIdentities { /** * Executes the update request. * @@ -353,16 +392,6 @@ interface Update } /** The ApplicationResource update stages. */ interface UpdateStages { - /** The stage of the ApplicationResource update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Azure resource tags.. - * - * @param tags Azure resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } /** The stage of the ApplicationResource update allowing to specify typeVersion. */ interface WithTypeVersion { /** @@ -448,6 +477,18 @@ interface WithMetrics { */ Update withMetrics(List metrics); } + /** The stage of the ApplicationResource update allowing to specify managedIdentities. */ + interface WithManagedIdentities { + /** + * Specifies the managedIdentities property: List of user assigned identities for the application, each + * mapped to a friendly name.. + * + * @param managedIdentities List of user assigned identities for the application, each mapped to a friendly + * name. + * @return the next definition stage. + */ + Update withManagedIdentities(List managedIdentities); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceProperties.java index 4c34a62e66fb0..55ead786f04b2 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceProperties.java @@ -108,6 +108,14 @@ public ApplicationResourceProperties withMetrics(List managedIdentities) { + super.withManagedIdentities(managedIdentities); + return this; + } + /** * Validates the instance. * diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java index 8e5df48d98580..942a5079846b1 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdate.java @@ -9,6 +9,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -31,6 +32,7 @@ public class ApplicationResourceUpdate extends ProxyResource { * values specified in the application manifest. */ @JsonProperty(value = "properties.parameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map parameters; /* @@ -71,6 +73,13 @@ public class ApplicationResourceUpdate extends ProxyResource { @JsonProperty(value = "properties.metrics") private List metrics; + /* + * List of user assigned identities for the application, each mapped to a + * friendly name. + */ + @JsonProperty(value = "properties.managedIdentities") + private List managedIdentities; + /* * It will be deprecated in New API, resource location depends on the * parent resource. @@ -82,6 +91,7 @@ public class ApplicationResourceUpdate extends ProxyResource { * Azure resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* @@ -242,6 +252,28 @@ public ApplicationResourceUpdate withMetrics(List return this; } + /** + * Get the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @return the managedIdentities value. + */ + public List managedIdentities() { + return this.managedIdentities; + } + + /** + * Set the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @param managedIdentities the managedIdentities value to set. + * @return the ApplicationResourceUpdate object itself. + */ + public ApplicationResourceUpdate withManagedIdentities(List managedIdentities) { + this.managedIdentities = managedIdentities; + return this; + } + /** * Get the location property: It will be deprecated in New API, resource location depends on the parent resource. * @@ -303,5 +335,8 @@ public void validate() { if (metrics() != null) { metrics().forEach(e -> e.validate()); } + if (managedIdentities() != null) { + managedIdentities().forEach(e -> e.validate()); + } } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdateProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdateProperties.java index f384e5873151f..c7f9335eca2ef 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdateProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationResourceUpdateProperties.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -28,6 +29,7 @@ public class ApplicationResourceUpdateProperties { * values specified in the application manifest. */ @JsonProperty(value = "parameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map parameters; /* @@ -68,6 +70,13 @@ public class ApplicationResourceUpdateProperties { @JsonProperty(value = "metrics") private List metrics; + /* + * List of user assigned identities for the application, each mapped to a + * friendly name. + */ + @JsonProperty(value = "managedIdentities") + private List managedIdentities; + /** * Get the typeVersion property: The version of the application type as defined in the application manifest. * @@ -220,6 +229,29 @@ public ApplicationResourceUpdateProperties withMetrics(List managedIdentities() { + return this.managedIdentities; + } + + /** + * Set the managedIdentities property: List of user assigned identities for the application, each mapped to a + * friendly name. + * + * @param managedIdentities the managedIdentities value to set. + * @return the ApplicationResourceUpdateProperties object itself. + */ + public ApplicationResourceUpdateProperties withManagedIdentities( + List managedIdentities) { + this.managedIdentities = managedIdentities; + return this; + } + /** * Validates the instance. * @@ -232,5 +264,8 @@ public void validate() { if (metrics() != null) { metrics().forEach(e -> e.validate()); } + if (managedIdentities() != null) { + managedIdentities().forEach(e -> e.validate()); + } } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java index 61f1c262448e3..e0ff19ef12caa 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeResource.java @@ -159,7 +159,7 @@ interface WithTags { ApplicationTypeResource.Update update(); /** The template for ApplicationTypeResource update. */ - interface Update extends UpdateStages.WithTags { + interface Update { /** * Executes the update request. * @@ -177,16 +177,6 @@ interface Update extends UpdateStages.WithTags { } /** The ApplicationTypeResource update stages. */ interface UpdateStages { - /** The stage of the ApplicationTypeResource update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Azure resource tags.. - * - * @param tags Azure resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java index fa0c73196a3e6..42943aa8cd3f8 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionResource.java @@ -187,7 +187,7 @@ interface WithAppPackageUrl { ApplicationTypeVersionResource.Update update(); /** The template for ApplicationTypeVersionResource update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithAppPackageUrl { + interface Update extends UpdateStages.WithAppPackageUrl { /** * Executes the update request. * @@ -205,16 +205,6 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithAppPackageUrl { } /** The ApplicationTypeVersionResource update stages. */ interface UpdateStages { - /** The stage of the ApplicationTypeVersionResource update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Azure resource tags.. - * - * @param tags Azure resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } /** The stage of the ApplicationTypeVersionResource update allowing to specify appPackageUrl. */ interface WithAppPackageUrl { /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java new file mode 100644 index 0000000000000..6ab9fc9eeb61a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationTypeVersionsCleanupPolicy.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ApplicationTypeVersionsCleanupPolicy model. */ +@Fluent +public final class ApplicationTypeVersionsCleanupPolicy { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationTypeVersionsCleanupPolicy.class); + + /* + * Number of unused versions per application type to keep. + */ + @JsonProperty(value = "maxUnusedVersionsToKeep", required = true) + private int maxUnusedVersionsToKeep; + + /** + * Get the maxUnusedVersionsToKeep property: Number of unused versions per application type to keep. + * + * @return the maxUnusedVersionsToKeep value. + */ + public int maxUnusedVersionsToKeep() { + return this.maxUnusedVersionsToKeep; + } + + /** + * Set the maxUnusedVersionsToKeep property: Number of unused versions per application type to keep. + * + * @param maxUnusedVersionsToKeep the maxUnusedVersionsToKeep value to set. + * @return the ApplicationTypeVersionsCleanupPolicy object itself. + */ + public ApplicationTypeVersionsCleanupPolicy withMaxUnusedVersionsToKeep(int maxUnusedVersionsToKeep) { + this.maxUnusedVersionsToKeep = maxUnusedVersionsToKeep; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java index 8a2df582cc1f7..c4bd4b28deb1b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUpgradePolicy.java @@ -47,6 +47,13 @@ public final class ApplicationUpgradePolicy { @JsonProperty(value = "applicationHealthPolicy") private ArmApplicationHealthPolicy applicationHealthPolicy; + /* + * The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. + */ + @JsonProperty(value = "upgradeMode") + private RollingUpgradeMode upgradeMode; + /** * Get the upgradeReplicaSetCheckTimeout property: 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 @@ -138,6 +145,28 @@ public ApplicationUpgradePolicy withApplicationHealthPolicy(ArmApplicationHealth return this; } + /** + * Get the upgradeMode property: The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. + * + * @return the upgradeMode value. + */ + public RollingUpgradeMode upgradeMode() { + return this.upgradeMode; + } + + /** + * Set the upgradeMode property: The mode used to monitor health during a rolling upgrade. The values are + * UnmonitoredAuto, UnmonitoredManual, and Monitored. + * + * @param upgradeMode the upgradeMode value to set. + * @return the ApplicationUpgradePolicy object itself. + */ + public ApplicationUpgradePolicy withUpgradeMode(RollingUpgradeMode upgradeMode) { + this.upgradeMode = upgradeMode; + return this; + } + /** * Validates the instance. * diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java new file mode 100644 index 0000000000000..fe7dddc496e02 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ApplicationUserAssignedIdentity.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ApplicationUserAssignedIdentity model. */ +@Fluent +public class ApplicationUserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationUserAssignedIdentity.class); + + /* + * The friendly name of user assigned identity. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", required = true) + private String principalId; + + /** + * Get the name property: The friendly name of user assigned identity. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The friendly name of user assigned identity. + * + * @param name the name value to set. + * @return the ApplicationUserAssignedIdentity object itself. + */ + public ApplicationUserAssignedIdentity withName(String name) { + this.name = name; + return this; + } + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal id of user assigned identity. + * + * @param principalId the principalId value to set. + * @return the ApplicationUserAssignedIdentity object itself. + */ + public ApplicationUserAssignedIdentity withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ApplicationUserAssignedIdentity")); + } + if (principalId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property principalId in model ApplicationUserAssignedIdentity")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java index b31b670bdb523..cb878690ef806 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -49,6 +50,7 @@ public final class ArmApplicationHealthPolicy { * is empty by default. */ @JsonProperty(value = "serviceTypeHealthPolicyMap") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map serviceTypeHealthPolicyMap; /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificate.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificate.java new file mode 100644 index 0000000000000..d212a654e2645 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClientCertificate.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Client Certificate definition. */ +@Fluent +public final class ClientCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientCertificate.class); + + /* + * Whether the certificate is admin or not. + */ + @JsonProperty(value = "isAdmin", required = true) + private boolean isAdmin; + + /* + * Certificate Thumbprint. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /* + * Certificate Common name. + */ + @JsonProperty(value = "commonName") + private String commonName; + + /* + * Issuer thumbprint for the certificate. Only used together with + * CommonName. + */ + @JsonProperty(value = "issuerThumbprint") + private String issuerThumbprint; + + /** + * Get the isAdmin property: Whether the certificate is admin or not. + * + * @return the isAdmin value. + */ + public boolean isAdmin() { + return this.isAdmin; + } + + /** + * Set the isAdmin property: Whether the certificate is admin or not. + * + * @param isAdmin the isAdmin value to set. + * @return the ClientCertificate object itself. + */ + public ClientCertificate withIsAdmin(boolean isAdmin) { + this.isAdmin = isAdmin; + return this; + } + + /** + * Get the thumbprint property: Certificate Thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: Certificate Thumbprint. + * + * @param thumbprint the thumbprint value to set. + * @return the ClientCertificate object itself. + */ + public ClientCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the commonName property: Certificate Common name. + * + * @return the commonName value. + */ + public String commonName() { + return this.commonName; + } + + /** + * Set the commonName property: Certificate Common name. + * + * @param commonName the commonName value to set. + * @return the ClientCertificate object itself. + */ + public ClientCertificate withCommonName(String commonName) { + this.commonName = commonName; + return this; + } + + /** + * Get the issuerThumbprint property: Issuer thumbprint for the certificate. Only used together with CommonName. + * + * @return the issuerThumbprint value. + */ + public String issuerThumbprint() { + return this.issuerThumbprint; + } + + /** + * Set the issuerThumbprint property: Issuer thumbprint for the certificate. Only used together with CommonName. + * + * @param issuerThumbprint the issuerThumbprint value to set. + * @return the ClientCertificate object itself. + */ + public ClientCertificate withIssuerThumbprint(String issuerThumbprint) { + this.issuerThumbprint = issuerThumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Cluster.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Cluster.java index 7907f04e57dd8..a3933c90d189f 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Cluster.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Cluster.java @@ -238,6 +238,13 @@ public interface Cluster { */ UpgradeMode upgradeMode(); + /** + * Gets the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused versions. + * + * @return the applicationTypeVersionsCleanupPolicy value. + */ + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy(); + /** * Gets the vmImage property: The VM image VMSS has been configured with. Generic names such as Windows or Linux can * be used. @@ -337,6 +344,7 @@ interface WithCreate DefinitionStages.WithReverseProxyCertificateCommonNames, DefinitionStages.WithUpgradeDescription, DefinitionStages.WithUpgradeMode, + DefinitionStages.WithApplicationTypeVersionsCleanupPolicy, DefinitionStages.WithVmImage { /** * Executes the create request. @@ -579,6 +587,18 @@ interface WithUpgradeMode { */ WithCreate withUpgradeMode(UpgradeMode upgradeMode); } + /** The stage of the Cluster definition allowing to specify applicationTypeVersionsCleanupPolicy. */ + interface WithApplicationTypeVersionsCleanupPolicy { + /** + * Specifies the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused + * versions.. + * + * @param applicationTypeVersionsCleanupPolicy The policy used to clean up unused versions. + * @return the next definition stage. + */ + WithCreate withApplicationTypeVersionsCleanupPolicy( + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy); + } /** The stage of the Cluster definition allowing to specify vmImage. */ interface WithVmImage { /** @@ -614,7 +634,8 @@ interface Update UpdateStages.WithReliabilityLevel, UpdateStages.WithReverseProxyCertificate, UpdateStages.WithUpgradeDescription, - UpdateStages.WithUpgradeMode { + UpdateStages.WithUpgradeMode, + UpdateStages.WithApplicationTypeVersionsCleanupPolicy { /** * Executes the update request. * @@ -815,6 +836,18 @@ interface WithUpgradeMode { */ Update withUpgradeMode(UpgradeMode upgradeMode); } + /** The stage of the Cluster update allowing to specify applicationTypeVersionsCleanupPolicy. */ + interface WithApplicationTypeVersionsCleanupPolicy { + /** + * Specifies the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused + * versions.. + * + * @param applicationTypeVersionsCleanupPolicy The policy used to clean up unused versions. + * @return the next definition stage. + */ + Update withApplicationTypeVersionsCleanupPolicy( + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java index 4e6bb3431f3c0..de18f2148c398 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterHealthPolicy.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -62,6 +63,7 @@ public final class ClusterHealthPolicy { * an application or one of its children entities. */ @JsonProperty(value = "applicationHealthPolicies") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map applicationHealthPolicies; /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterOsType.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterOsType.java new file mode 100644 index 0000000000000..cabeddc052587 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterOsType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ClusterOsType. */ +public final class ClusterOsType extends ExpandableStringEnum { + /** Static value Windows for ClusterOsType. */ + public static final ClusterOsType WINDOWS = fromString("Windows"); + + /** Static value Ubuntu for ClusterOsType. */ + public static final ClusterOsType UBUNTU = fromString("Ubuntu"); + + /** Static value RedHat for ClusterOsType. */ + public static final ClusterOsType RED_HAT = fromString("RedHat"); + + /** Static value Ubuntu18_04 for ClusterOsType. */ + public static final ClusterOsType UBUNTU18_04 = fromString("Ubuntu18_04"); + + /** + * Creates or finds a ClusterOsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterOsType. + */ + @JsonCreator + public static ClusterOsType fromString(String name) { + return fromString(name, ClusterOsType.class); + } + + /** @return known ClusterOsType values. */ + public static Collection values() { + return values(ClusterOsType.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java index 967954b43dd96..8a581ade70c73 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpdateParameters.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -22,6 +23,7 @@ public class ClusterUpdateParameters { * Cluster update parameters */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* @@ -133,6 +135,12 @@ public class ClusterUpdateParameters { @JsonProperty(value = "properties.upgradeMode") private UpgradeMode upgradeMode; + /* + * The policy used to clean up unused versions. + */ + @JsonProperty(value = "properties.applicationTypeVersionsCleanupPolicy") + private ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy; + /** * Get the tags property: Cluster update parameters. * @@ -457,6 +465,27 @@ public ClusterUpdateParameters withUpgradeMode(UpgradeMode upgradeMode) { return this; } + /** + * Get the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused versions. + * + * @return the applicationTypeVersionsCleanupPolicy value. + */ + public ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy() { + return this.applicationTypeVersionsCleanupPolicy; + } + + /** + * Set the applicationTypeVersionsCleanupPolicy property: The policy used to clean up unused versions. + * + * @param applicationTypeVersionsCleanupPolicy the applicationTypeVersionsCleanupPolicy value to set. + * @return the ClusterUpdateParameters object itself. + */ + public ClusterUpdateParameters withApplicationTypeVersionsCleanupPolicy( + ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy) { + this.applicationTypeVersionsCleanupPolicy = applicationTypeVersionsCleanupPolicy; + return this; + } + /** * Validates the instance. * @@ -487,5 +516,8 @@ public void validate() { if (upgradeDescription() != null) { upgradeDescription().validate(); } + if (applicationTypeVersionsCleanupPolicy() != null) { + applicationTypeVersionsCleanupPolicy().validate(); + } } } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java index d4ab491593215..1a6f5d9be7c49 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ClusterUpgradeDeltaHealthPolicy.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -61,6 +62,7 @@ public final class ClusterUpgradeDeltaHealthPolicy { * cluster. */ @JsonProperty(value = "applicationDeltaHealthPolicies") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map applicationDeltaHealthPolicies; /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java index bedf02bd66a13..74761b8526a01 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/DiagnosticsStorageAccountConfig.java @@ -26,6 +26,14 @@ public final class DiagnosticsStorageAccountConfig { @JsonProperty(value = "protectedAccountKeyName", required = true) private String protectedAccountKeyName; + /* + * The secondary protected diagnostics storage key name. If one of the + * storage account keys is rotated the cluster will fallback to using the + * other. + */ + @JsonProperty(value = "protectedAccountKeyName2") + private String protectedAccountKeyName2; + /* * The blob endpoint of the azure storage account. */ @@ -84,6 +92,28 @@ public DiagnosticsStorageAccountConfig withProtectedAccountKeyName(String protec return this; } + /** + * Get the protectedAccountKeyName2 property: The secondary protected diagnostics storage key name. If one of the + * storage account keys is rotated the cluster will fallback to using the other. + * + * @return the protectedAccountKeyName2 value. + */ + public String protectedAccountKeyName2() { + return this.protectedAccountKeyName2; + } + + /** + * Set the protectedAccountKeyName2 property: The secondary protected diagnostics storage key name. If one of the + * storage account keys is rotated the cluster will fallback to using the other. + * + * @param protectedAccountKeyName2 the protectedAccountKeyName2 value to set. + * @return the DiagnosticsStorageAccountConfig object itself. + */ + public DiagnosticsStorageAccountConfig withProtectedAccountKeyName2(String protectedAccountKeyName2) { + this.protectedAccountKeyName2 = protectedAccountKeyName2; + return this; + } + /** * Get the blobEndpoint property: The blob endpoint of the azure storage account. * diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/LoadBalancingRule.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/LoadBalancingRule.java new file mode 100644 index 0000000000000..1f16caf0828c4 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/LoadBalancingRule.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a load balancing rule. */ +@Fluent +public final class LoadBalancingRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadBalancingRule.class); + + /* + * The port for the external endpoint. Port numbers for each rule must be + * unique within the Load Balancer. Acceptable values are between 1 and + * 65534. + */ + @JsonProperty(value = "frontendPort", required = true) + private int frontendPort; + + /* + * The port used for internal connections on the endpoint. Acceptable + * values are between 1 and 65535. + */ + @JsonProperty(value = "backendPort", required = true) + private int backendPort; + + /* + * The reference to the transport protocol used by the load balancing rule. + */ + @JsonProperty(value = "protocol", required = true) + private Protocol protocol; + + /* + * the reference to the load balancer probe used by the load balancing + * rule. + */ + @JsonProperty(value = "probeProtocol", required = true) + private ProbeProtocol probeProtocol; + + /* + * The probe request path. Only supported for HTTP/HTTPS probes. + */ + @JsonProperty(value = "probeRequestPath") + private String probeRequestPath; + + /** + * Get the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values are between 1 and 65534. + * + * @return the frontendPort value. + */ + public int frontendPort() { + return this.frontendPort; + } + + /** + * Set the frontendPort property: The port for the external endpoint. Port numbers for each rule must be unique + * within the Load Balancer. Acceptable values are between 1 and 65534. + * + * @param frontendPort the frontendPort value to set. + * @return the LoadBalancingRule object itself. + */ + public LoadBalancingRule withFrontendPort(int frontendPort) { + this.frontendPort = frontendPort; + return this; + } + + /** + * Get the backendPort property: The port used for internal connections on the endpoint. Acceptable values are + * between 1 and 65535. + * + * @return the backendPort value. + */ + public int backendPort() { + return this.backendPort; + } + + /** + * Set the backendPort property: The port used for internal connections on the endpoint. Acceptable values are + * between 1 and 65535. + * + * @param backendPort the backendPort value to set. + * @return the LoadBalancingRule object itself. + */ + public LoadBalancingRule withBackendPort(int backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @return the protocol value. + */ + public Protocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The reference to the transport protocol used by the load balancing rule. + * + * @param protocol the protocol value to set. + * @return the LoadBalancingRule object itself. + */ + public LoadBalancingRule withProtocol(Protocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the probeProtocol property: the reference to the load balancer probe used by the load balancing rule. + * + * @return the probeProtocol value. + */ + public ProbeProtocol probeProtocol() { + return this.probeProtocol; + } + + /** + * Set the probeProtocol property: the reference to the load balancer probe used by the load balancing rule. + * + * @param probeProtocol the probeProtocol value to set. + * @return the LoadBalancingRule object itself. + */ + public LoadBalancingRule withProbeProtocol(ProbeProtocol probeProtocol) { + this.probeProtocol = probeProtocol; + return this; + } + + /** + * Get the probeRequestPath property: The probe request path. Only supported for HTTP/HTTPS probes. + * + * @return the probeRequestPath value. + */ + public String probeRequestPath() { + return this.probeRequestPath; + } + + /** + * Set the probeRequestPath property: The probe request path. Only supported for HTTP/HTTPS probes. + * + * @param probeRequestPath the probeRequestPath value to set. + * @return the LoadBalancingRule object itself. + */ + public LoadBalancingRule withProbeRequestPath(String probeRequestPath) { + this.probeRequestPath = probeRequestPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property protocol in model LoadBalancingRule")); + } + if (probeProtocol() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property probeProtocol in model LoadBalancingRule")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedCluster.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedCluster.java new file mode 100644 index 0000000000000..5e1d98bcfc0af --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedCluster.java @@ -0,0 +1,557 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ManagedCluster. */ +public interface ManagedCluster { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The sku of the managed cluster. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the dnsName property: The cluster dns name. + * + * @return the dnsName value. + */ + String dnsName(); + + /** + * Gets the fqdn property: the cluster Fully qualified domain name. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the clusterId property: A service generated unique identifier for the cluster resource. + * + * @return the clusterId value. + */ + String clusterId(); + + /** + * Gets the clusterState property: The current state of the cluster. + * + * @return the clusterState value. + */ + ClusterState clusterState(); + + /** + * Gets the clusterCertificateThumbprint property: The cluster certificate thumbprint used node to node + * communication. + * + * @return the clusterCertificateThumbprint value. + */ + String clusterCertificateThumbprint(); + + /** + * Gets the clientConnectionPort property: The port used for client connections to the cluster. + * + * @return the clientConnectionPort value. + */ + Integer clientConnectionPort(); + + /** + * Gets the httpGatewayConnectionPort property: The port used for http connections to the cluster. + * + * @return the httpGatewayConnectionPort value. + */ + Integer httpGatewayConnectionPort(); + + /** + * Gets the adminUsername property: vm admin user name. + * + * @return the adminUsername value. + */ + String adminUsername(); + + /** + * Gets the adminPassword property: vm admin user password. + * + * @return the adminPassword value. + */ + String adminPassword(); + + /** + * Gets the loadBalancingRules property: Describes load balancing rules. + * + * @return the loadBalancingRules value. + */ + List loadBalancingRules(); + + /** + * Gets the clients property: client certificates for the cluster. + * + * @return the clients value. + */ + List clients(); + + /** + * Gets the azureActiveDirectory property: Azure active directory. + * + * @return the azureActiveDirectory value. + */ + AzureActiveDirectory azureActiveDirectory(); + + /** + * Gets the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value. + */ + List fabricSettings(); + + /** + * Gets the provisioningState property: The provisioning state of the managed cluster resource. + * + * @return the provisioningState value. + */ + ManagedResourceProvisioningState provisioningState(); + + /** + * Gets the clusterCodeVersion property: 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. + */ + String clusterCodeVersion(); + + /** + * Gets the addonFeatures property: client certificates for the cluster. + * + * @return the addonFeatures value. + */ + List addonFeatures(); + + /** + * Gets the etag property: Azure resource etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner object. + * + * @return the inner object. + */ + ManagedClusterInner innerModel(); + + /** The entirety of the ManagedCluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ManagedCluster definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedCluster definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ManagedCluster definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ManagedCluster definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ManagedCluster definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithDnsName, + DefinitionStages.WithClientConnectionPort, + DefinitionStages.WithHttpGatewayConnectionPort, + DefinitionStages.WithAdminUsername, + DefinitionStages.WithAdminPassword, + DefinitionStages.WithLoadBalancingRules, + DefinitionStages.WithClients, + DefinitionStages.WithAzureActiveDirectory, + DefinitionStages.WithFabricSettings, + DefinitionStages.WithClusterCodeVersion, + DefinitionStages.WithAddonFeatures { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedCluster create(Context context); + } + /** The stage of the ManagedCluster definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the ManagedCluster definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The sku of the managed cluster. + * + * @param sku The sku of the managed cluster. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the ManagedCluster definition allowing to specify dnsName. */ + interface WithDnsName { + /** + * Specifies the dnsName property: The cluster dns name.. + * + * @param dnsName The cluster dns name. + * @return the next definition stage. + */ + WithCreate withDnsName(String dnsName); + } + /** The stage of the ManagedCluster definition allowing to specify clientConnectionPort. */ + interface WithClientConnectionPort { + /** + * Specifies the clientConnectionPort property: The port used for client connections to the cluster.. + * + * @param clientConnectionPort The port used for client connections to the cluster. + * @return the next definition stage. + */ + WithCreate withClientConnectionPort(Integer clientConnectionPort); + } + /** The stage of the ManagedCluster definition allowing to specify httpGatewayConnectionPort. */ + interface WithHttpGatewayConnectionPort { + /** + * Specifies the httpGatewayConnectionPort property: The port used for http connections to the cluster.. + * + * @param httpGatewayConnectionPort The port used for http connections to the cluster. + * @return the next definition stage. + */ + WithCreate withHttpGatewayConnectionPort(Integer httpGatewayConnectionPort); + } + /** The stage of the ManagedCluster definition allowing to specify adminUsername. */ + interface WithAdminUsername { + /** + * Specifies the adminUsername property: vm admin user name.. + * + * @param adminUsername vm admin user name. + * @return the next definition stage. + */ + WithCreate withAdminUsername(String adminUsername); + } + /** The stage of the ManagedCluster definition allowing to specify adminPassword. */ + interface WithAdminPassword { + /** + * Specifies the adminPassword property: vm admin user password.. + * + * @param adminPassword vm admin user password. + * @return the next definition stage. + */ + WithCreate withAdminPassword(String adminPassword); + } + /** The stage of the ManagedCluster definition allowing to specify loadBalancingRules. */ + interface WithLoadBalancingRules { + /** + * Specifies the loadBalancingRules property: Describes load balancing rules.. + * + * @param loadBalancingRules Describes load balancing rules. + * @return the next definition stage. + */ + WithCreate withLoadBalancingRules(List loadBalancingRules); + } + /** The stage of the ManagedCluster definition allowing to specify clients. */ + interface WithClients { + /** + * Specifies the clients property: client certificates for the cluster.. + * + * @param clients client certificates for the cluster. + * @return the next definition stage. + */ + WithCreate withClients(List clients); + } + /** The stage of the ManagedCluster definition allowing to specify azureActiveDirectory. */ + interface WithAzureActiveDirectory { + /** + * Specifies the azureActiveDirectory property: Azure active directory.. + * + * @param azureActiveDirectory Azure active directory. + * @return the next definition stage. + */ + WithCreate withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory); + } + /** The stage of the ManagedCluster definition allowing to specify fabricSettings. */ + interface WithFabricSettings { + /** + * Specifies the fabricSettings property: The list of custom fabric settings to configure the cluster.. + * + * @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 ManagedCluster definition allowing to specify clusterCodeVersion. */ + interface WithClusterCodeVersion { + /** + * Specifies the clusterCodeVersion property: 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 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 ManagedCluster definition allowing to specify addonFeatures. */ + interface WithAddonFeatures { + /** + * Specifies the addonFeatures property: client certificates for the cluster.. + * + * @param addonFeatures client certificates for the cluster. + * @return the next definition stage. + */ + WithCreate withAddonFeatures(List addonFeatures); + } + } + /** + * Begins update for the ManagedCluster resource. + * + * @return the stage of resource update. + */ + ManagedCluster.Update update(); + + /** The template for ManagedCluster update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithClientConnectionPort, + UpdateStages.WithHttpGatewayConnectionPort, + UpdateStages.WithLoadBalancingRules, + UpdateStages.WithClients, + UpdateStages.WithAzureActiveDirectory, + UpdateStages.WithFabricSettings, + UpdateStages.WithClusterCodeVersion, + UpdateStages.WithAddonFeatures { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedCluster apply(Context context); + } + /** The ManagedCluster update stages. */ + interface UpdateStages { + /** The stage of the ManagedCluster update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Managed cluster update parameters. + * + * @param tags Managed cluster update parameters. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ManagedCluster update allowing to specify clientConnectionPort. */ + interface WithClientConnectionPort { + /** + * Specifies the clientConnectionPort property: The port used for client connections to the cluster.. + * + * @param clientConnectionPort The port used for client connections to the cluster. + * @return the next definition stage. + */ + Update withClientConnectionPort(Integer clientConnectionPort); + } + /** The stage of the ManagedCluster update allowing to specify httpGatewayConnectionPort. */ + interface WithHttpGatewayConnectionPort { + /** + * Specifies the httpGatewayConnectionPort property: The port used for http connections to the cluster.. + * + * @param httpGatewayConnectionPort The port used for http connections to the cluster. + * @return the next definition stage. + */ + Update withHttpGatewayConnectionPort(Integer httpGatewayConnectionPort); + } + /** The stage of the ManagedCluster update allowing to specify loadBalancingRules. */ + interface WithLoadBalancingRules { + /** + * Specifies the loadBalancingRules property: Describes load balancing rules.. + * + * @param loadBalancingRules Describes load balancing rules. + * @return the next definition stage. + */ + Update withLoadBalancingRules(List loadBalancingRules); + } + /** The stage of the ManagedCluster update allowing to specify clients. */ + interface WithClients { + /** + * Specifies the clients property: client certificates for the cluster.. + * + * @param clients client certificates for the cluster. + * @return the next definition stage. + */ + Update withClients(List clients); + } + /** The stage of the ManagedCluster update allowing to specify azureActiveDirectory. */ + interface WithAzureActiveDirectory { + /** + * Specifies the azureActiveDirectory property: Azure active directory.. + * + * @param azureActiveDirectory Azure active directory. + * @return the next definition stage. + */ + Update withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory); + } + /** The stage of the ManagedCluster update allowing to specify fabricSettings. */ + interface WithFabricSettings { + /** + * Specifies the fabricSettings property: The list of custom fabric settings to configure the cluster.. + * + * @param fabricSettings The list of custom fabric settings to configure the cluster. + * @return the next definition stage. + */ + Update withFabricSettings(List fabricSettings); + } + /** The stage of the ManagedCluster update allowing to specify clusterCodeVersion. */ + interface WithClusterCodeVersion { + /** + * Specifies the clusterCodeVersion property: 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 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. + */ + Update withClusterCodeVersion(String clusterCodeVersion); + } + /** The stage of the ManagedCluster update allowing to specify addonFeatures. */ + interface WithAddonFeatures { + /** + * Specifies the addonFeatures property: client certificates for the cluster.. + * + * @param addonFeatures client certificates for the cluster. + * @return the next definition stage. + */ + Update withAddonFeatures(List addonFeatures); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedCluster refresh(Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterAddOnFeature.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterAddOnFeature.java new file mode 100644 index 0000000000000..b5cb17edd016d --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterAddOnFeature.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedClusterAddOnFeature. */ +public final class ManagedClusterAddOnFeature extends ExpandableStringEnum { + /** Static value DnsService for ManagedClusterAddOnFeature. */ + public static final ManagedClusterAddOnFeature DNS_SERVICE = fromString("DnsService"); + + /** Static value BackupRestoreService for ManagedClusterAddOnFeature. */ + public static final ManagedClusterAddOnFeature BACKUP_RESTORE_SERVICE = fromString("BackupRestoreService"); + + /** Static value ResourceMonitorService for ManagedClusterAddOnFeature. */ + public static final ManagedClusterAddOnFeature RESOURCE_MONITOR_SERVICE = fromString("ResourceMonitorService"); + + /** + * Creates or finds a ManagedClusterAddOnFeature from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedClusterAddOnFeature. + */ + @JsonCreator + public static ManagedClusterAddOnFeature fromString(String name) { + return fromString(name, ManagedClusterAddOnFeature.class); + } + + /** @return known ManagedClusterAddOnFeature values. */ + public static Collection values() { + return values(ManagedClusterAddOnFeature.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterListResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterListResult.java new file mode 100644 index 0000000000000..3ca08fc7734a3 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Managed Cluster list results. */ +@Fluent +public final class ManagedClusterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterListResult.class); + + /* + * 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 property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the ManagedClusterListResult object itself. + */ + public ManagedClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the ManagedClusterListResult object itself. + */ + public ManagedClusterListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterUpdateParameters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterUpdateParameters.java new file mode 100644 index 0000000000000..ce95d4003a95f --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterUpdateParameters.java @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Managed cluster update request. */ +@JsonFlatten +@Fluent +public class ManagedClusterUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterUpdateParameters.class); + + /* + * Managed cluster update parameters + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The port used for client connections to the cluster. + */ + @JsonProperty(value = "properties.clientConnectionPort") + private Integer clientConnectionPort; + + /* + * The port used for http connections to the cluster. + */ + @JsonProperty(value = "properties.httpGatewayConnectionPort") + private Integer httpGatewayConnectionPort; + + /* + * Describes load balancing rules. + */ + @JsonProperty(value = "properties.loadBalancingRules") + private List loadBalancingRules; + + /* + * client certificates for the cluster. + */ + @JsonProperty(value = "properties.clients") + private List clients; + + /* + * Azure active directory. + */ + @JsonProperty(value = "properties.azureActiveDirectory") + private AzureActiveDirectory azureActiveDirectory; + + /* + * The list of custom fabric settings to configure the cluster. + */ + @JsonProperty(value = "properties.fabricSettings") + private List fabricSettings; + + /* + * 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; + + /* + * client certificates for the cluster. + */ + @JsonProperty(value = "properties.addonFeatures") + private List addonFeatures; + + /** + * Get the tags property: Managed cluster update parameters. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Managed cluster update parameters. + * + * @param tags the tags value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the clientConnectionPort property: The port used for client connections to the cluster. + * + * @return the clientConnectionPort value. + */ + public Integer clientConnectionPort() { + return this.clientConnectionPort; + } + + /** + * Set the clientConnectionPort property: The port used for client connections to the cluster. + * + * @param clientConnectionPort the clientConnectionPort value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withClientConnectionPort(Integer clientConnectionPort) { + this.clientConnectionPort = clientConnectionPort; + return this; + } + + /** + * Get the httpGatewayConnectionPort property: The port used for http connections to the cluster. + * + * @return the httpGatewayConnectionPort value. + */ + public Integer httpGatewayConnectionPort() { + return this.httpGatewayConnectionPort; + } + + /** + * Set the httpGatewayConnectionPort property: The port used for http connections to the cluster. + * + * @param httpGatewayConnectionPort the httpGatewayConnectionPort value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withHttpGatewayConnectionPort(Integer httpGatewayConnectionPort) { + this.httpGatewayConnectionPort = httpGatewayConnectionPort; + return this; + } + + /** + * Get the loadBalancingRules property: Describes load balancing rules. + * + * @return the loadBalancingRules value. + */ + public List loadBalancingRules() { + return this.loadBalancingRules; + } + + /** + * Set the loadBalancingRules property: Describes load balancing rules. + * + * @param loadBalancingRules the loadBalancingRules value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withLoadBalancingRules(List loadBalancingRules) { + this.loadBalancingRules = loadBalancingRules; + return this; + } + + /** + * Get the clients property: client certificates for the cluster. + * + * @return the clients value. + */ + public List clients() { + return this.clients; + } + + /** + * Set the clients property: client certificates for the cluster. + * + * @param clients the clients value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withClients(List clients) { + this.clients = clients; + return this; + } + + /** + * Get the azureActiveDirectory property: Azure active directory. + * + * @return the azureActiveDirectory value. + */ + public AzureActiveDirectory azureActiveDirectory() { + return this.azureActiveDirectory; + } + + /** + * Set the azureActiveDirectory property: Azure active directory. + * + * @param azureActiveDirectory the azureActiveDirectory value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.azureActiveDirectory = azureActiveDirectory; + return this; + } + + /** + * Get the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @return the fabricSettings value. + */ + public List fabricSettings() { + return this.fabricSettings; + } + + /** + * Set the fabricSettings property: The list of custom fabric settings to configure the cluster. + * + * @param fabricSettings the fabricSettings value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withFabricSettings(List fabricSettings) { + this.fabricSettings = fabricSettings; + return this; + } + + /** + * Get the clusterCodeVersion property: 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 clusterCodeVersion property: 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 ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withClusterCodeVersion(String clusterCodeVersion) { + this.clusterCodeVersion = clusterCodeVersion; + return this; + } + + /** + * Get the addonFeatures property: client certificates for the cluster. + * + * @return the addonFeatures value. + */ + public List addonFeatures() { + return this.addonFeatures; + } + + /** + * Set the addonFeatures property: client certificates for the cluster. + * + * @param addonFeatures the addonFeatures value to set. + * @return the ManagedClusterUpdateParameters object itself. + */ + public ManagedClusterUpdateParameters withAddonFeatures(List addonFeatures) { + this.addonFeatures = addonFeatures; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancingRules() != null) { + loadBalancingRules().forEach(e -> e.validate()); + } + if (clients() != null) { + clients().forEach(e -> e.validate()); + } + if (azureActiveDirectory() != null) { + azureActiveDirectory().validate(); + } + if (fabricSettings() != null) { + fabricSettings().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionDetails.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionDetails.java new file mode 100644 index 0000000000000..e880ed68be192 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionDetails.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner; + +/** An immutable client-side representation of ManagedClusterVersionDetails. */ +public interface ManagedClusterVersionDetails { + /** + * Gets the msiVersion property: The Service Fabric runtime version of the cluster. + * + * @return the msiVersion value. + */ + String msiVersion(); + + /** + * Gets the supportExpiryUtc property: The date of expiry of support of the version. + * + * @return the supportExpiryUtc value. + */ + String supportExpiryUtc(); + + /** + * Gets the osType property: Indicates the operating system of the cluster. + * + * @return the osType value. + */ + ClusterOsType osType(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.ManagedClusterVersionDetailsInner object. + * + * @return the inner object. + */ + ManagedClusterVersionDetailsInner innerModel(); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersions.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersions.java new file mode 100644 index 0000000000000..a3cc5a0dfcd2b --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersions.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of ManagedClusterVersions. */ +public interface ManagedClusterVersions { + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available code versions for Service Fabric cluster resources by OS type. + */ + List listByOS(String location, ManagedClusterVersionsOsType osType); + + /** + * Gets all available code versions for Service Fabric cluster resources by OS type. + * + * @param location The location for the cluster code versions. This is different from cluster location. + * @param osType The operating system of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available code versions for Service Fabric cluster resources by OS type. + */ + Response> listByOSWithResponse( + String location, ManagedClusterVersionsOsType osType, Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionsOsType.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionsOsType.java new file mode 100644 index 0000000000000..fbc604f64c754 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusterVersionsOsType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedClusterVersionsOsType. */ +public final class ManagedClusterVersionsOsType extends ExpandableStringEnum { + /** Static value Windows for ManagedClusterVersionsOsType. */ + public static final ManagedClusterVersionsOsType WINDOWS = fromString("Windows"); + + /** Static value Ubuntu for ManagedClusterVersionsOsType. */ + public static final ManagedClusterVersionsOsType UBUNTU = fromString("Ubuntu"); + + /** Static value RedHat for ManagedClusterVersionsOsType. */ + public static final ManagedClusterVersionsOsType RED_HAT = fromString("RedHat"); + + /** Static value Ubuntu18_04 for ManagedClusterVersionsOsType. */ + public static final ManagedClusterVersionsOsType UBUNTU18_04 = fromString("Ubuntu18_04"); + + /** + * Creates or finds a ManagedClusterVersionsOsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedClusterVersionsOsType. + */ + @JsonCreator + public static ManagedClusterVersionsOsType fromString(String name) { + return fromString(name, ManagedClusterVersionsOsType.class); + } + + /** @return known ManagedClusterVersionsOsType values. */ + public static Collection values() { + return values(ManagedClusterVersionsOsType.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusters.java new file mode 100644 index 0000000000000..3613ccee9ce2a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedClusters.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ManagedClusters. */ +public interface ManagedClusters { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + PagedIterable list(); + + /** + * Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Service Fabric cluster resources created or in the process of being created in the subscription. + */ + PagedIterable list(Context context); + + /** + * Get a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + ManagedCluster getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Get a Service Fabric managed 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Delete a Service Fabric managed 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Get a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + ManagedCluster getById(String id); + + /** + * Get a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric managed cluster resource created or in the process of being created in the specified + * resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Service Fabric managed cluster resource with the specified name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagedCluster resource. + * + * @param name resource name. + * @return the first stage of the new ManagedCluster definition. + */ + ManagedCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java new file mode 100644 index 0000000000000..679a0eb806557 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentity.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes the managed identities for an Azure resource. */ +@Fluent +public class ManagedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentity.class); + + /* + * The principal id of the managed identity. This property will only be + * provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id of the managed identity. This property will only be + * provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of managed identity for the resource. + */ + @JsonProperty(value = "type") + private ManagedIdentityType type; + + /* + * The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal id of the managed identity. This property will only be provided for a + * system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id of the managed identity. This property will only be provided for a + * system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity for the resource. + * + * @return the type value. + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity for the resource. + * + * @param type the type value to set. + * @return the ManagedIdentity object itself. + */ + public ManagedIdentity withType(ManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedIdentity object itself. + */ + public ManagedIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java new file mode 100644 index 0000000000000..4e259f7a33df5 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedIdentityType.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ManagedIdentityType. */ +public enum ManagedIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ManagedIdentityType instance. */ + private final String value; + + ManagedIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ManagedIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ManagedIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ManagedIdentityType fromString(String value) { + ManagedIdentityType[] items = ManagedIdentityType.values(); + for (ManagedIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedProxyResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedProxyResource.java new file mode 100644 index 0000000000000..0b1940ccaac84 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedProxyResource.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The resource model definition for proxy-only resource. */ +@Fluent +public class ManagedProxyResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedProxyResource.class); + + /* + * Azure resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Azure resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Azure resource tags. + * + * @param tags the tags value to set. + * @return the ManagedProxyResource object itself. + */ + public ManagedProxyResource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedResourceProvisioningState.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedResourceProvisioningState.java new file mode 100644 index 0000000000000..bf134aaffab57 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ManagedResourceProvisioningState.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedResourceProvisioningState. */ +public final class ManagedResourceProvisioningState extends ExpandableStringEnum { + /** Static value None for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState NONE = fromString("None"); + + /** Static value Creating for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Created for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState CREATED = fromString("Created"); + + /** Static value Updating for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleting for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deleted for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState DELETED = fromString("Deleted"); + + /** Static value Other for ManagedResourceProvisioningState. */ + public static final ManagedResourceProvisioningState OTHER = fromString("Other"); + + /** + * Creates or finds a ManagedResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedResourceProvisioningState. + */ + @JsonCreator + public static ManagedResourceProvisioningState fromString(String name) { + return fromString(name, ManagedResourceProvisioningState.class); + } + + /** @return known ManagedResourceProvisioningState values. */ + public static Collection values() { + return values(ManagedResourceProvisioningState.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java index b3bd2311c65e0..e714831b55d7a 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NamedPartitionSchemeDescription.java @@ -22,14 +22,14 @@ public final class NamedPartitionSchemeDescription extends PartitionSchemeDescri /* * The number of partitions. */ - @JsonProperty(value = "Count", required = true) + @JsonProperty(value = "count", required = true) private int count; /* - * Array of size specified by the ‘Count’ parameter, for the names of the + * Array of size specified by the ‘count’ parameter, for the names of the * partitions. */ - @JsonProperty(value = "Names", required = true) + @JsonProperty(value = "names", required = true) private List names; /** @@ -53,7 +53,7 @@ public NamedPartitionSchemeDescription withCount(int count) { } /** - * Get the names property: Array of size specified by the ‘Count’ parameter, for the names of the partitions. + * Get the names property: Array of size specified by the ‘count’ parameter, for the names of the partitions. * * @return the names value. */ @@ -62,7 +62,7 @@ public List names() { } /** - * Set the names property: Array of size specified by the ‘Count’ parameter, for the names of the partitions. + * Set the names property: Array of size specified by the ‘count’ parameter, for the names of the partitions. * * @param names the names value to set. * @return the NamedPartitionSchemeDescription object itself. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeType.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeType.java new file mode 100644 index 0000000000000..bbe320a22ca04 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeType.java @@ -0,0 +1,604 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of NodeType. */ +public interface NodeType { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the tags property: Azure resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the isPrimary property: 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. + */ + Boolean isPrimary(); + + /** + * Gets the vmInstanceCount property: The number of nodes in the node type. + * + * @return the vmInstanceCount value. + */ + Integer vmInstanceCount(); + + /** + * Gets the dataDiskSizeGB property: Disk size for each vm in the node type in GBs. + * + * @return the dataDiskSizeGB value. + */ + Integer dataDiskSizeGB(); + + /** + * Gets the placementProperties property: 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. + */ + Map placementProperties(); + + /** + * Gets the capacities property: 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. + */ + Map capacities(); + + /** + * Gets the applicationPorts property: The range of ports from which cluster assigned port to Service Fabric + * applications. + * + * @return the applicationPorts value. + */ + EndpointRangeDescription applicationPorts(); + + /** + * Gets the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should be configured + * with. + * + * @return the ephemeralPorts value. + */ + EndpointRangeDescription ephemeralPorts(); + + /** + * Gets the vmSize property: The size of virtual machines in the pool. All virtual machines in a pool are the same + * size. For example, Standard_D3. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the vmImagePublisher property: The publisher of the Azure Virtual Machines Marketplace image. For example, + * Canonical or MicrosoftWindowsServer. + * + * @return the vmImagePublisher value. + */ + String vmImagePublisher(); + + /** + * Gets the vmImageOffer property: The offer type of the Azure Virtual Machines Marketplace image. For example, + * UbuntuServer or WindowsServer. + * + * @return the vmImageOffer value. + */ + String vmImageOffer(); + + /** + * Gets the vmImageSku property: The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS + * or 2012-R2-Datacenter. + * + * @return the vmImageSku value. + */ + String vmImageSku(); + + /** + * Gets the vmImageVersion property: The version of the Azure Virtual Machines Marketplace image. A value of + * 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. + * + * @return the vmImageVersion value. + */ + String vmImageVersion(); + + /** + * Gets the vmSecrets property: virtual machine secretes. The secrets to install in the virtual machines. + * + * @return the vmSecrets value. + */ + List vmSecrets(); + + /** + * Gets the vmExtensions property: virtual machine extensions. Set of extensions that should be installed onto the + * virtual machines. + * + * @return the vmExtensions value. + */ + List vmExtensions(); + + /** + * Gets the provisioningState property: The provisioning state of the managed cluster resource. + * + * @return the provisioningState value. + */ + ManagedResourceProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner object. + * + * @return the inner object. + */ + NodeTypeInner innerModel(); + + /** The entirety of the NodeType definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The NodeType definition stages. */ + interface DefinitionStages { + /** The first stage of the NodeType definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the NodeType definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @return the next definition stage. + */ + WithCreate withExistingManagedCluster(String resourceGroupName, String clusterName); + } + /** + * The stage of the NodeType definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIsPrimary, + DefinitionStages.WithVmInstanceCount, + DefinitionStages.WithDataDiskSizeGB, + DefinitionStages.WithPlacementProperties, + DefinitionStages.WithCapacities, + DefinitionStages.WithApplicationPorts, + DefinitionStages.WithEphemeralPorts, + DefinitionStages.WithVmSize, + DefinitionStages.WithVmImagePublisher, + DefinitionStages.WithVmImageOffer, + DefinitionStages.WithVmImageSku, + DefinitionStages.WithVmImageVersion, + DefinitionStages.WithVmSecrets, + DefinitionStages.WithVmExtensions { + /** + * Executes the create request. + * + * @return the created resource. + */ + NodeType create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NodeType create(Context context); + } + /** The stage of the NodeType definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Azure resource tags.. + * + * @param tags Azure resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the NodeType definition allowing to specify isPrimary. */ + interface WithIsPrimary { + /** + * Specifies the isPrimary property: 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 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 next definition stage. + */ + WithCreate withIsPrimary(Boolean isPrimary); + } + /** The stage of the NodeType definition allowing to specify vmInstanceCount. */ + interface WithVmInstanceCount { + /** + * Specifies the vmInstanceCount property: The number of nodes in the node type.. + * + * @param vmInstanceCount The number of nodes in the node type. + * @return the next definition stage. + */ + WithCreate withVmInstanceCount(Integer vmInstanceCount); + } + /** The stage of the NodeType definition allowing to specify dataDiskSizeGB. */ + interface WithDataDiskSizeGB { + /** + * Specifies the dataDiskSizeGB property: Disk size for each vm in the node type in GBs.. + * + * @param dataDiskSizeGB Disk size for each vm in the node type in GBs. + * @return the next definition stage. + */ + WithCreate withDataDiskSizeGB(Integer dataDiskSizeGB); + } + /** The stage of the NodeType definition allowing to specify placementProperties. */ + interface WithPlacementProperties { + /** + * Specifies the placementProperties property: 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 placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * @return the next definition stage. + */ + WithCreate withPlacementProperties(Map placementProperties); + } + /** The stage of the NodeType definition allowing to specify capacities. */ + interface WithCapacities { + /** + * Specifies the capacities property: 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 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 next definition stage. + */ + WithCreate withCapacities(Map capacities); + } + /** The stage of the NodeType definition allowing to specify applicationPorts. */ + interface WithApplicationPorts { + /** + * Specifies the applicationPorts property: The range of ports from which cluster assigned port to Service + * Fabric applications.. + * + * @param applicationPorts The range of ports from which cluster assigned port to Service Fabric + * applications. + * @return the next definition stage. + */ + WithCreate withApplicationPorts(EndpointRangeDescription applicationPorts); + } + /** The stage of the NodeType definition allowing to specify ephemeralPorts. */ + interface WithEphemeralPorts { + /** + * Specifies the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should + * be configured with.. + * + * @param ephemeralPorts The range of ephemeral ports that nodes in this node type should be configured + * with. + * @return the next definition stage. + */ + WithCreate withEphemeralPorts(EndpointRangeDescription ephemeralPorts); + } + /** The stage of the NodeType definition allowing to specify vmSize. */ + interface WithVmSize { + /** + * Specifies the vmSize property: The size of virtual machines in the pool. All virtual machines in a pool + * are the same size. For example, Standard_D3.. + * + * @param vmSize The size of virtual machines in the pool. All virtual machines in a pool are the same size. + * For example, Standard_D3. + * @return the next definition stage. + */ + WithCreate withVmSize(String vmSize); + } + /** The stage of the NodeType definition allowing to specify vmImagePublisher. */ + interface WithVmImagePublisher { + /** + * Specifies the vmImagePublisher property: The publisher of the Azure Virtual Machines Marketplace image. + * For example, Canonical or MicrosoftWindowsServer.. + * + * @param vmImagePublisher The publisher of the Azure Virtual Machines Marketplace image. For example, + * Canonical or MicrosoftWindowsServer. + * @return the next definition stage. + */ + WithCreate withVmImagePublisher(String vmImagePublisher); + } + /** The stage of the NodeType definition allowing to specify vmImageOffer. */ + interface WithVmImageOffer { + /** + * Specifies the vmImageOffer property: The offer type of the Azure Virtual Machines Marketplace image. For + * example, UbuntuServer or WindowsServer.. + * + * @param vmImageOffer The offer type of the Azure Virtual Machines Marketplace image. For example, + * UbuntuServer or WindowsServer. + * @return the next definition stage. + */ + WithCreate withVmImageOffer(String vmImageOffer); + } + /** The stage of the NodeType definition allowing to specify vmImageSku. */ + interface WithVmImageSku { + /** + * Specifies the vmImageSku property: The SKU of the Azure Virtual Machines Marketplace image. For example, + * 14.04.0-LTS or 2012-R2-Datacenter.. + * + * @param vmImageSku The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or + * 2012-R2-Datacenter. + * @return the next definition stage. + */ + WithCreate withVmImageSku(String vmImageSku); + } + /** The stage of the NodeType definition allowing to specify vmImageVersion. */ + interface WithVmImageVersion { + /** + * Specifies the vmImageVersion property: The version of the Azure Virtual Machines Marketplace image. A + * value of 'latest' can be specified to select the latest version of an image. If omitted, the default is + * 'latest'.. + * + * @param vmImageVersion The version of the Azure Virtual Machines Marketplace image. A value of 'latest' + * can be specified to select the latest version of an image. If omitted, the default is 'latest'. + * @return the next definition stage. + */ + WithCreate withVmImageVersion(String vmImageVersion); + } + /** The stage of the NodeType definition allowing to specify vmSecrets. */ + interface WithVmSecrets { + /** + * Specifies the vmSecrets property: virtual machine secretes. The secrets to install in the virtual + * machines.. + * + * @param vmSecrets virtual machine secretes. The secrets to install in the virtual machines. + * @return the next definition stage. + */ + WithCreate withVmSecrets(List vmSecrets); + } + /** The stage of the NodeType definition allowing to specify vmExtensions. */ + interface WithVmExtensions { + /** + * Specifies the vmExtensions property: virtual machine extensions. Set of extensions that should be + * installed onto the virtual machines.. + * + * @param vmExtensions virtual machine extensions. Set of extensions that should be installed onto the + * virtual machines. + * @return the next definition stage. + */ + WithCreate withVmExtensions(List vmExtensions); + } + } + /** + * Begins update for the NodeType resource. + * + * @return the stage of resource update. + */ + NodeType.Update update(); + + /** The template for NodeType update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithVmInstanceCount, + UpdateStages.WithPlacementProperties, + UpdateStages.WithCapacities, + UpdateStages.WithApplicationPorts, + UpdateStages.WithEphemeralPorts, + UpdateStages.WithVmSecrets, + UpdateStages.WithVmExtensions { + /** + * Executes the update request. + * + * @return the updated resource. + */ + NodeType apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + NodeType apply(Context context); + } + /** The NodeType update stages. */ + interface UpdateStages { + /** The stage of the NodeType update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Node type update parameters. + * + * @param tags Node type update parameters. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the NodeType update allowing to specify vmInstanceCount. */ + interface WithVmInstanceCount { + /** + * Specifies the vmInstanceCount property: The number of nodes in the node type.. + * + * @param vmInstanceCount The number of nodes in the node type. + * @return the next definition stage. + */ + Update withVmInstanceCount(Integer vmInstanceCount); + } + /** The stage of the NodeType update allowing to specify placementProperties. */ + interface WithPlacementProperties { + /** + * Specifies the placementProperties property: 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 placement tags applied to nodes in the node type, which can be used to + * indicate where certain services (workload) should run. + * @return the next definition stage. + */ + Update withPlacementProperties(Map placementProperties); + } + /** The stage of the NodeType update allowing to specify capacities. */ + interface WithCapacities { + /** + * Specifies the capacities property: 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 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 next definition stage. + */ + Update withCapacities(Map capacities); + } + /** The stage of the NodeType update allowing to specify applicationPorts. */ + interface WithApplicationPorts { + /** + * Specifies the applicationPorts property: The range of ports from which cluster assigned port to Service + * Fabric applications.. + * + * @param applicationPorts The range of ports from which cluster assigned port to Service Fabric + * applications. + * @return the next definition stage. + */ + Update withApplicationPorts(EndpointRangeDescription applicationPorts); + } + /** The stage of the NodeType update allowing to specify ephemeralPorts. */ + interface WithEphemeralPorts { + /** + * Specifies the ephemeralPorts property: The range of ephemeral ports that nodes in this node type should + * be configured with.. + * + * @param ephemeralPorts The range of ephemeral ports that nodes in this node type should be configured + * with. + * @return the next definition stage. + */ + Update withEphemeralPorts(EndpointRangeDescription ephemeralPorts); + } + /** The stage of the NodeType update allowing to specify vmSecrets. */ + interface WithVmSecrets { + /** + * Specifies the vmSecrets property: virtual machine secretes. The secrets to install in the virtual + * machines.. + * + * @param vmSecrets virtual machine secretes. The secrets to install in the virtual machines. + * @return the next definition stage. + */ + Update withVmSecrets(List vmSecrets); + } + /** The stage of the NodeType update allowing to specify vmExtensions. */ + interface WithVmExtensions { + /** + * Specifies the vmExtensions property: virtual machine extensions. Set of extensions that should be + * installed onto the virtual machines.. + * + * @param vmExtensions virtual machine extensions. Set of extensions that should be installed onto the + * virtual machines. + * @return the next definition stage. + */ + Update withVmExtensions(List vmExtensions); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NodeType refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NodeType refresh(Context context); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(NodeTypeActionParameters parameters); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(NodeTypeActionParameters parameters, Context context); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(NodeTypeActionParameters parameters); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage(NodeTypeActionParameters parameters, Context context); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteNode(NodeTypeActionParameters parameters); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteNode(NodeTypeActionParameters parameters, Context context); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeActionParameters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeActionParameters.java new file mode 100644 index 0000000000000..301b56a60afb1 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeActionParameters.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for Node type action. */ +@Fluent +public final class NodeTypeActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypeActionParameters.class); + + /* + * List of node names from the node type. + */ + @JsonProperty(value = "nodes", required = true) + private List nodes; + + /* + * Force the action to go through. + */ + @JsonProperty(value = "force") + private Boolean force; + + /** + * Get the nodes property: List of node names from the node type. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Set the nodes property: List of node names from the node type. + * + * @param nodes the nodes value to set. + * @return the NodeTypeActionParameters object itself. + */ + public NodeTypeActionParameters withNodes(List nodes) { + this.nodes = nodes; + return this; + } + + /** + * Get the force property: Force the action to go through. + * + * @return the force value. + */ + public Boolean force() { + return this.force; + } + + /** + * Set the force property: Force the action to go through. + * + * @param force the force value to set. + * @return the NodeTypeActionParameters object itself. + */ + public NodeTypeActionParameters withForce(Boolean force) { + this.force = force; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodes() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property nodes in model NodeTypeActionParameters")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java index fe112aaedd4f5..5fcfecf10f4e0 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeDescription.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -26,6 +27,7 @@ public final class NodeTypeDescription { * to indicate where certain services (workload) should run. */ @JsonProperty(value = "placementProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map placementProperties; /* @@ -34,6 +36,7 @@ public final class NodeTypeDescription { * has. */ @JsonProperty(value = "capacities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map capacities; /* diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeListResult.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeListResult.java new file mode 100644 index 0000000000000..1bc6a33c03e90 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.servicefabric.fluent.models.NodeTypeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Node type list results. */ +@Fluent +public final class NodeTypeListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypeListResult.class); + + /* + * node type list value. The list of node types. + */ + @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 property: node type list value. The list of node types. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: node type list value. The list of node types. + * + * @param value the value value to set. + * @return the NodeTypeListResult object itself. + */ + public NodeTypeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set. + * @return the NodeTypeListResult object itself. + */ + public NodeTypeListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeUpdateParameters.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeUpdateParameters.java new file mode 100644 index 0000000000000..7a7f54af92487 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypeUpdateParameters.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Node type update request. */ +@JsonFlatten +@Fluent +public class NodeTypeUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NodeTypeUpdateParameters.class); + + /* + * Node type update parameters + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The number of nodes in the node type. + */ + @JsonProperty(value = "properties.vmInstanceCount") + private Integer vmInstanceCount; + + /* + * The placement tags applied to nodes in the node type, which can be used + * to indicate where certain services (workload) should run. + */ + @JsonProperty(value = "properties.placementProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + 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 = "properties.capacities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map capacities; + + /* + * The range of ports from which cluster assigned port to Service Fabric + * applications. + */ + @JsonProperty(value = "properties.applicationPorts") + private EndpointRangeDescription applicationPorts; + + /* + * The range of ephemeral ports that nodes in this node type should be + * configured with. + */ + @JsonProperty(value = "properties.ephemeralPorts") + private EndpointRangeDescription ephemeralPorts; + + /* + * virtual machine secretes. The secrets to install in the virtual + * machines. + */ + @JsonProperty(value = "properties.vmSecrets") + private List vmSecrets; + + /* + * virtual machine extensions. Set of extensions that should be installed + * onto the virtual machines. + */ + @JsonProperty(value = "properties.vmExtensions") + private List vmExtensions; + + /** + * Get the tags property: Node type update parameters. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Node type update parameters. + * + * @param tags the tags value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the vmInstanceCount property: The number of nodes in the node type. + * + * @return the vmInstanceCount value. + */ + public Integer vmInstanceCount() { + return this.vmInstanceCount; + } + + /** + * Set the vmInstanceCount property: The number of nodes in the node type. + * + * @param vmInstanceCount the vmInstanceCount value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withVmInstanceCount(Integer vmInstanceCount) { + this.vmInstanceCount = vmInstanceCount; + return this; + } + + /** + * Get the placementProperties property: 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 placementProperties property: 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 NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withPlacementProperties(Map placementProperties) { + this.placementProperties = placementProperties; + return this; + } + + /** + * Get the capacities property: 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 capacities property: 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 NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withCapacities(Map capacities) { + this.capacities = capacities; + return this; + } + + /** + * Get the applicationPorts property: 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 applicationPorts property: The range of ports from which cluster assigned port to Service Fabric + * applications. + * + * @param applicationPorts the applicationPorts value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withApplicationPorts(EndpointRangeDescription applicationPorts) { + this.applicationPorts = applicationPorts; + return this; + } + + /** + * Get the ephemeralPorts property: 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 ephemeralPorts property: The range of ephemeral ports that nodes in this node type should be configured + * with. + * + * @param ephemeralPorts the ephemeralPorts value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withEphemeralPorts(EndpointRangeDescription ephemeralPorts) { + this.ephemeralPorts = ephemeralPorts; + return this; + } + + /** + * Get the vmSecrets property: virtual machine secretes. The secrets to install in the virtual machines. + * + * @return the vmSecrets value. + */ + public List vmSecrets() { + return this.vmSecrets; + } + + /** + * Set the vmSecrets property: virtual machine secretes. The secrets to install in the virtual machines. + * + * @param vmSecrets the vmSecrets value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withVmSecrets(List vmSecrets) { + this.vmSecrets = vmSecrets; + return this; + } + + /** + * Get the vmExtensions property: virtual machine extensions. Set of extensions that should be installed onto the + * virtual machines. + * + * @return the vmExtensions value. + */ + public List vmExtensions() { + return this.vmExtensions; + } + + /** + * Set the vmExtensions property: virtual machine extensions. Set of extensions that should be installed onto the + * virtual machines. + * + * @param vmExtensions the vmExtensions value to set. + * @return the NodeTypeUpdateParameters object itself. + */ + public NodeTypeUpdateParameters withVmExtensions(List vmExtensions) { + this.vmExtensions = vmExtensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationPorts() != null) { + applicationPorts().validate(); + } + if (ephemeralPorts() != null) { + ephemeralPorts().validate(); + } + if (vmSecrets() != null) { + vmSecrets().forEach(e -> e.validate()); + } + if (vmExtensions() != null) { + vmExtensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypes.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypes.java new file mode 100644 index 0000000000000..19d80440dd38a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/NodeTypes.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NodeTypes. */ +public interface NodeTypes { + /** + * Gets all Node types of the specified managed cluster. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Node types of the specified managed cluster. + */ + PagedIterable listByManagedClusters(String resourceGroupName, String clusterName); + + /** + * Gets all Node types of the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Node types of the specified managed cluster. + */ + PagedIterable listByManagedClusters(String resourceGroupName, String clusterName, Context context); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for restart action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and + * activate the nodes back again. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for reimage action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void reimage( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteNode( + String resourceGroupName, String clusterName, String nodeTypeName, NodeTypeActionParameters parameters); + + /** + * Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and + * removes the state from the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param parameters parameters for delete action. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteNode( + String resourceGroupName, + String clusterName, + String nodeTypeName, + NodeTypeActionParameters parameters, + Context context); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + NodeType get(String resourceGroupName, String clusterName, String nodeTypeName); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String nodeTypeName, Context context); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String nodeTypeName); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster resource. + * @param nodeTypeName The name of the node type. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String nodeTypeName, Context context); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + NodeType getById(String id); + + /** + * Get a Service Fabric node type of a given managed cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service Fabric node type of a given managed cluster. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Service Fabric node type of a given managed cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NodeType resource. + * + * @param name resource name. + * @return the first stage of the new NodeType definition. + */ + NodeType.DefinitionStages.Blank define(String name); +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java index 4dce7b8aed470..4843bec806e58 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Operations.java @@ -28,4 +28,64 @@ public interface Operations { * @return the list of available Service Fabric resource provider API operations. */ PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + PagedIterable list(); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + PagedIterable list(); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + PagedIterable list(Context context); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + PagedIterable list(); + + /** + * Get the list of available Service Fabric resource provider API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of available Service Fabric resource provider API operations. + */ + PagedIterable list(Context context); } diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProbeProtocol.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProbeProtocol.java new file mode 100644 index 0000000000000..df7d054c7f025 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ProbeProtocol.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProbeProtocol. */ +public final class ProbeProtocol extends ExpandableStringEnum { + /** Static value tcp for ProbeProtocol. */ + public static final ProbeProtocol TCP = fromString("tcp"); + + /** Static value http for ProbeProtocol. */ + public static final ProbeProtocol HTTP = fromString("http"); + + /** Static value https for ProbeProtocol. */ + public static final ProbeProtocol HTTPS = fromString("https"); + + /** + * Creates or finds a ProbeProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProbeProtocol. + */ + @JsonCreator + public static ProbeProtocol fromString(String name) { + return fromString(name, ProbeProtocol.class); + } + + /** @return known ProbeProtocol values. */ + public static Collection values() { + return values(ProbeProtocol.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Protocol.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Protocol.java new file mode 100644 index 0000000000000..58c639b5c3b16 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Protocol.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Protocol. */ +public final class Protocol extends ExpandableStringEnum { + /** Static value tcp for Protocol. */ + public static final Protocol TCP = fromString("tcp"); + + /** Static value udp for Protocol. */ + public static final Protocol UDP = fromString("udp"); + + /** + * Creates or finds a Protocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding Protocol. + */ + @JsonCreator + public static Protocol fromString(String name) { + return fromString(name, Protocol.class); + } + + /** @return known Protocol values. */ + public static Collection values() { + return values(Protocol.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java new file mode 100644 index 0000000000000..c45522f90277a --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/RollingUpgradeMode.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RollingUpgradeMode. */ +public final class RollingUpgradeMode extends ExpandableStringEnum { + /** Static value Invalid for RollingUpgradeMode. */ + public static final RollingUpgradeMode INVALID = fromString("Invalid"); + + /** Static value UnmonitoredAuto for RollingUpgradeMode. */ + public static final RollingUpgradeMode UNMONITORED_AUTO = fromString("UnmonitoredAuto"); + + /** Static value UnmonitoredManual for RollingUpgradeMode. */ + public static final RollingUpgradeMode UNMONITORED_MANUAL = fromString("UnmonitoredManual"); + + /** Static value Monitored for RollingUpgradeMode. */ + public static final RollingUpgradeMode MONITORED = fromString("Monitored"); + + /** + * Creates or finds a RollingUpgradeMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding RollingUpgradeMode. + */ + @JsonCreator + public static RollingUpgradeMode fromString(String name) { + return fromString(name, RollingUpgradeMode.class); + } + + /** @return known RollingUpgradeMode values. */ + public static Collection values() { + return values(RollingUpgradeMode.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java index c6651df24b07f..fa522f32f55e0 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServicePlacementPolicyDescription.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; /** Describes the policy to be used for placement of a Service Fabric service. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonTypeName("ServicePlacementPolicyDescription") @Immutable public final class ServicePlacementPolicyDescription { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java index 733bfd4957b1b..046ecff93c3a9 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResource.java @@ -102,6 +102,14 @@ public interface ServiceResource { */ ArmServicePackageActivationMode servicePackageActivationMode(); + /** + * Gets the serviceDnsName property: Dns name used for the service. If this is specified, then the service can be + * accessed via its DNS name instead of service name. + * + * @return the serviceDnsName value. + */ + String serviceDnsName(); + /** * Gets the location property: It will be deprecated in New API, resource location depends on the parent resource. * @@ -179,7 +187,8 @@ interface WithCreate DefinitionStages.WithDefaultMoveCost, DefinitionStages.WithServiceTypeName, DefinitionStages.WithPartitionDescription, - DefinitionStages.WithServicePackageActivationMode { + DefinitionStages.WithServicePackageActivationMode, + DefinitionStages.WithServiceDnsName { /** * Executes the create request. * @@ -313,6 +322,18 @@ interface WithServicePackageActivationMode { */ WithCreate withServicePackageActivationMode(ArmServicePackageActivationMode servicePackageActivationMode); } + /** The stage of the ServiceResource definition allowing to specify serviceDnsName. */ + interface WithServiceDnsName { + /** + * Specifies the serviceDnsName property: Dns name used for the service. If this is specified, then the + * service can be accessed via its DNS name instead of service name.. + * + * @param serviceDnsName Dns name used for the service. If this is specified, then the service can be + * accessed via its DNS name instead of service name. + * @return the next definition stage. + */ + WithCreate withServiceDnsName(String serviceDnsName); + } } /** * Begins update for the ServiceResource resource. @@ -323,8 +344,7 @@ interface WithServicePackageActivationMode { /** The template for ServiceResource update. */ interface Update - extends UpdateStages.WithTags, - UpdateStages.WithPlacementConstraints, + extends UpdateStages.WithPlacementConstraints, UpdateStages.WithCorrelationScheme, UpdateStages.WithServiceLoadMetrics, UpdateStages.WithServicePlacementPolicies, @@ -346,16 +366,6 @@ interface Update } /** The ServiceResource update stages. */ interface UpdateStages { - /** The stage of the ServiceResource update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Azure resource tags.. - * - * @param tags Azure resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } /** The stage of the ServiceResource update allowing to specify placementConstraints. */ interface WithPlacementConstraints { /** diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java index a7a9c8cec8111..d08555971434b 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceProperties.java @@ -53,6 +53,13 @@ public class ServiceResourceProperties extends ServiceResourcePropertiesBase { @JsonProperty(value = "servicePackageActivationMode") private ArmServicePackageActivationMode servicePackageActivationMode; + /* + * Dns name used for the service. If this is specified, then the service + * can be accessed via its DNS name instead of service name. + */ + @JsonProperty(value = "serviceDnsName") + private String serviceDnsName; + /** * Get the provisioningState property: The current deployment or provisioning state, which only appears in the * response. @@ -124,6 +131,28 @@ public ServiceResourceProperties withServicePackageActivationMode( return this; } + /** + * Get the serviceDnsName property: Dns name used for the service. If this is specified, then the service can be + * accessed via its DNS name instead of service name. + * + * @return the serviceDnsName value. + */ + public String serviceDnsName() { + return this.serviceDnsName; + } + + /** + * Set the serviceDnsName property: Dns name used for the service. If this is specified, then the service can be + * accessed via its DNS name instead of service name. + * + * @param serviceDnsName the serviceDnsName value to set. + * @return the ServiceResourceProperties object itself. + */ + public ServiceResourceProperties withServiceDnsName(String serviceDnsName) { + this.serviceDnsName = serviceDnsName; + return this; + } + /** {@inheritDoc} */ @Override public ServiceResourceProperties withPlacementConstraints(String placementConstraints) { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java index c42f44325d625..808fa4ea48170 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdate.java @@ -9,6 +9,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -67,6 +68,7 @@ public class ServiceResourceUpdate extends ProxyResource { * Azure resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java index b26fee8e0d8a1..87740c4f61de8 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ServiceResourceUpdateProperties.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.servicefabric.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -23,7 +23,7 @@ @JsonSubTypes.Type(name = "Stateful", value = StatefulServiceUpdateProperties.class), @JsonSubTypes.Type(name = "Stateless", value = StatelessServiceUpdateProperties.class) }) -@Immutable +@Fluent public class ServiceResourceUpdateProperties extends ServiceResourcePropertiesBase { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceUpdateProperties.class); diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Sku.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Sku.java new file mode 100644 index 0000000000000..379d965549aed --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/Sku.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sku definition. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * Sku Name. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * Get the name property: Sku Name. + * + * @return the name value. + */ + public SkuName name() { + return this.name; + } + + /** + * Set the name property: Sku Name. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SkuName.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SkuName.java new file mode 100644 index 0000000000000..25c7be15cee6e --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/SkuName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuName. */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuName. + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** @return known SkuName values. */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java index f4ec6a1f89baa..49485be3f6ce8 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatefulServiceProperties.java @@ -211,6 +211,13 @@ public StatefulServiceProperties withServicePackageActivationMode( return this; } + /** {@inheritDoc} */ + @Override + public StatefulServiceProperties withServiceDnsName(String serviceDnsName) { + super.withServiceDnsName(serviceDnsName); + return this; + } + /** {@inheritDoc} */ @Override public StatefulServiceProperties withPlacementConstraints(String placementConstraints) { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java index c8a5d39e40067..d77b9c1e9a2cf 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceProperties.java @@ -25,6 +25,19 @@ public final class StatelessServiceProperties extends ServiceResourceProperties @JsonProperty(value = "instanceCount") private Integer instanceCount; + /* + * Delay duration for RequestDrain feature to ensures that the endpoint + * advertised by the stateless instance is removed before the delay starts + * prior to closing the instance. This delay enables existing requests to + * drain gracefully before the instance actually goes down + * (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). + * It is first interpreted as a string representing an ISO 8601 duration. + * If that fails, then it is interpreted as a number representing the total + * number of milliseconds. + */ + @JsonProperty(value = "instanceCloseDelayDuration") + private String instanceCloseDelayDuration; + /** * Get the instanceCount property: The instance count. * @@ -45,6 +58,36 @@ public StatelessServiceProperties withInstanceCount(Integer instanceCount) { return this; } + /** + * Get the instanceCloseDelayDuration property: Delay duration for RequestDrain feature to ensures that the endpoint + * advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay + * enables existing requests to drain gracefully before the instance actually goes down + * (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). + * It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a + * number representing the total number of milliseconds. + * + * @return the instanceCloseDelayDuration value. + */ + public String instanceCloseDelayDuration() { + return this.instanceCloseDelayDuration; + } + + /** + * Set the instanceCloseDelayDuration property: Delay duration for RequestDrain feature to ensures that the endpoint + * advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay + * enables existing requests to drain gracefully before the instance actually goes down + * (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). + * It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a + * number representing the total number of milliseconds. + * + * @param instanceCloseDelayDuration the instanceCloseDelayDuration value to set. + * @return the StatelessServiceProperties object itself. + */ + public StatelessServiceProperties withInstanceCloseDelayDuration(String instanceCloseDelayDuration) { + this.instanceCloseDelayDuration = instanceCloseDelayDuration; + return this; + } + /** {@inheritDoc} */ @Override public StatelessServiceProperties withServiceTypeName(String serviceTypeName) { @@ -67,6 +110,13 @@ public StatelessServiceProperties withServicePackageActivationMode( return this; } + /** {@inheritDoc} */ + @Override + public StatelessServiceProperties withServiceDnsName(String serviceDnsName) { + super.withServiceDnsName(serviceDnsName); + return this; + } + /** {@inheritDoc} */ @Override public StatelessServiceProperties withPlacementConstraints(String placementConstraints) { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java index c54d04c4b9e82..9fb2274308d00 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/StatelessServiceUpdateProperties.java @@ -25,6 +25,19 @@ public final class StatelessServiceUpdateProperties extends ServiceResourceUpdat @JsonProperty(value = "instanceCount") private Integer instanceCount; + /* + * Delay duration for RequestDrain feature to ensures that the endpoint + * advertised by the stateless instance is removed before the delay starts + * prior to closing the instance. This delay enables existing requests to + * drain gracefully before the instance actually goes down + * (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). + * It is first interpreted as a string representing an ISO 8601 duration. + * If that fails, then it is interpreted as a number representing the total + * number of milliseconds. + */ + @JsonProperty(value = "instanceCloseDelayDuration") + private String instanceCloseDelayDuration; + /** * Get the instanceCount property: The instance count. * @@ -45,6 +58,36 @@ public StatelessServiceUpdateProperties withInstanceCount(Integer instanceCount) return this; } + /** + * Get the instanceCloseDelayDuration property: Delay duration for RequestDrain feature to ensures that the endpoint + * advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay + * enables existing requests to drain gracefully before the instance actually goes down + * (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). + * It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a + * number representing the total number of milliseconds. + * + * @return the instanceCloseDelayDuration value. + */ + public String instanceCloseDelayDuration() { + return this.instanceCloseDelayDuration; + } + + /** + * Set the instanceCloseDelayDuration property: Delay duration for RequestDrain feature to ensures that the endpoint + * advertised by the stateless instance is removed before the delay starts prior to closing the instance. This delay + * enables existing requests to drain gracefully before the instance actually goes down + * (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). + * It is first interpreted as a string representing an ISO 8601 duration. If that fails, then it is interpreted as a + * number representing the total number of milliseconds. + * + * @param instanceCloseDelayDuration the instanceCloseDelayDuration value to set. + * @return the StatelessServiceUpdateProperties object itself. + */ + public StatelessServiceUpdateProperties withInstanceCloseDelayDuration(String instanceCloseDelayDuration) { + this.instanceCloseDelayDuration = instanceCloseDelayDuration; + return this; + } + /** {@inheritDoc} */ @Override public StatelessServiceUpdateProperties withPlacementConstraints(String placementConstraints) { diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java index ed5d185f68421..2ac85fc5ae8f3 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UniformInt64RangePartitionSchemeDescription.java @@ -21,23 +21,23 @@ public final class UniformInt64RangePartitionSchemeDescription extends Partition /* * The number of partitions. */ - @JsonProperty(value = "Count", required = true) + @JsonProperty(value = "count", required = true) private int count; /* * String indicating the lower bound of the partition key range that - * should be split between the partition ‘Count’ + * should be split between the partition ‘count’ * */ - @JsonProperty(value = "LowKey", required = true) + @JsonProperty(value = "lowKey", required = true) private String lowKey; /* * String indicating the upper bound of the partition key range that - * should be split between the partition ‘Count’ + * should be split between the partition ‘count’ * */ - @JsonProperty(value = "HighKey", required = true) + @JsonProperty(value = "highKey", required = true) private String highKey; /** @@ -62,7 +62,7 @@ public UniformInt64RangePartitionSchemeDescription withCount(int count) { /** * Get the lowKey property: String indicating the lower bound of the partition key range that should be split - * between the partition ‘Count’. + * between the partition ‘count’. * * @return the lowKey value. */ @@ -72,7 +72,7 @@ public String lowKey() { /** * Set the lowKey property: String indicating the lower bound of the partition key range that should be split - * between the partition ‘Count’. + * between the partition ‘count’. * * @param lowKey the lowKey value to set. * @return the UniformInt64RangePartitionSchemeDescription object itself. @@ -84,7 +84,7 @@ public UniformInt64RangePartitionSchemeDescription withLowKey(String lowKey) { /** * Get the highKey property: String indicating the upper bound of the partition key range that should be split - * between the partition ‘Count’. + * between the partition ‘count’. * * @return the highKey value. */ @@ -94,7 +94,7 @@ public String highKey() { /** * Set the highKey property: String indicating the upper bound of the partition key range that should be split - * between the partition ‘Count’. + * between the partition ‘count’. * * @param highKey the highKey value to set. * @return the UniformInt64RangePartitionSchemeDescription object itself. diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..9495684bf4108 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/UserAssignedIdentity.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The UserAssignedIdentity model. */ +@Immutable +public class UserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultCertificate.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultCertificate.java new file mode 100644 index 0000000000000..7e38633fd47d4 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultCertificate.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. */ +@Fluent +public final class VaultCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultCertificate.class); + + /* + * This is the URL of a certificate that has been uploaded to Key Vault as + * a secret. For adding a secret to the Key Vault, see [Add a key or secret + * to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + * In this case, your certificate needs to be It is the Base64 encoding of + * the following JSON Object which is encoded in UTF-8:

{
+ * "data":"",
"dataType":"pfx",
+ * "password":""
} + */ + @JsonProperty(value = "certificateUrl", required = true) + private String certificateUrl; + + /* + * For Windows VMs, specifies the certificate store on the Virtual Machine + * to which the certificate should be added. The specified certificate + * store is implicitly in the LocalMachine account.

For Linux VMs, + * the certificate file is placed under the /var/lib/waagent directory, + * with the file name .crt for the X509 certificate + * file and .prv for private key. Both of these files + * are .pem formatted. + */ + @JsonProperty(value = "certificateStore", required = true) + private String certificateStore; + + /** + * Get the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: + * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> + * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. + * + * @return the certificateUrl value. + */ + public String certificateUrl() { + return this.certificateUrl; + } + + /** + * Set the certificateUrl property: This is the URL of a certificate that has been uploaded to Key Vault as a + * secret. For adding a secret to the Key Vault, see [Add a key or secret to the key + * vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate + * needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8: + * <br><br> {<br> "data":"<Base64-encoded-certificate>",<br> + * "dataType":"pfx",<br> "password":"<pfx-file-password>"<br>}. + * + * @param certificateUrl the certificateUrl value to set. + * @return the VaultCertificate object itself. + */ + public VaultCertificate withCertificateUrl(String certificateUrl) { + this.certificateUrl = certificateUrl; + return this; + } + + /** + * Get the certificateStore property: For Windows VMs, specifies the certificate store on the Virtual Machine to + * which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. + * <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the + * file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for + * private key. Both of these files are .pem formatted. + * + * @return the certificateStore value. + */ + public String certificateStore() { + return this.certificateStore; + } + + /** + * Set the certificateStore property: For Windows VMs, specifies the certificate store on the Virtual Machine to + * which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. + * <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the + * file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for + * private key. Both of these files are .pem formatted. + * + * @param certificateStore the certificateStore value to set. + * @return the VaultCertificate object itself. + */ + public VaultCertificate withCertificateStore(String certificateStore) { + this.certificateStore = certificateStore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (certificateUrl() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property certificateUrl in model VaultCertificate")); + } + if (certificateStore() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property certificateStore in model VaultCertificate")); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultSecretGroup.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultSecretGroup.java new file mode 100644 index 0000000000000..268ddc303b2b4 --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VaultSecretGroup.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies set of certificates that should be installed onto the virtual machines. */ +@Fluent +public final class VaultSecretGroup { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VaultSecretGroup.class); + + /* + * The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + */ + @JsonProperty(value = "sourceVault", required = true) + private SubResource sourceVault; + + /* + * The list of key vault references in SourceVault which contain + * certificates. + */ + @JsonProperty(value = "vaultCertificates", required = true) + private List vaultCertificates; + + /** + * Get the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @return the sourceVault value. + */ + public SubResource sourceVault() { + return this.sourceVault; + } + + /** + * Set the sourceVault property: The relative URL of the Key Vault containing all of the certificates in + * VaultCertificates. + * + * @param sourceVault the sourceVault value to set. + * @return the VaultSecretGroup object itself. + */ + public VaultSecretGroup withSourceVault(SubResource sourceVault) { + this.sourceVault = sourceVault; + return this; + } + + /** + * Get the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @return the vaultCertificates value. + */ + public List vaultCertificates() { + return this.vaultCertificates; + } + + /** + * Set the vaultCertificates property: The list of key vault references in SourceVault which contain certificates. + * + * @param vaultCertificates the vaultCertificates value to set. + * @return the VaultSecretGroup object itself. + */ + public VaultSecretGroup withVaultCertificates(List vaultCertificates) { + this.vaultCertificates = vaultCertificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceVault() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property sourceVault in model VaultSecretGroup")); + } + if (vaultCertificates() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vaultCertificates in model VaultSecretGroup")); + } else { + vaultCertificates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssExtension.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssExtension.java new file mode 100644 index 0000000000000..c7fd05c9ae41b --- /dev/null +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/VmssExtension.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.servicefabric.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifies set of extensions that should be installed onto the virtual machines. */ +@JsonFlatten +@Fluent +public class VmssExtension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmssExtension.class); + + /* + * The name of the extension. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The name of the extension handler publisher. + */ + @JsonProperty(value = "properties.publisher", required = true) + private String publisher; + + /* + * Specifies the type of the extension; an example is + * "CustomScriptExtension". + */ + @JsonProperty(value = "properties.type", required = true) + private String type; + + /* + * Specifies the version of the script handler. + */ + @JsonProperty(value = "properties.typeHandlerVersion", required = true) + private String typeHandlerVersion; + + /* + * Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension + * will not upgrade minor versions unless redeployed, even with this + * property set to true. + */ + @JsonProperty(value = "properties.autoUpgradeMinorVersion") + private Boolean autoUpgradeMinorVersion; + + /* + * Json formatted public settings for the extension. + */ + @JsonProperty(value = "properties.settings") + private Object settings; + + /* + * The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + */ + @JsonProperty(value = "properties.protectedSettings") + private Object protectedSettings; + + /* + * If a value is provided and is different from the previous value, the + * extension handler will be forced to update even if the extension + * configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /* + * Collection of extension names after which this extension needs to be + * provisioned. + */ + @JsonProperty(value = "properties.provisionAfterExtensions") + private List provisionAfterExtensions; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the name property: The name of the extension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extension. + * + * @param name the name value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withType(String type) { + this.type = type; + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.typeHandlerVersion; + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withTypeHandlerVersion(String typeHandlerVersion) { + this.typeHandlerVersion = typeHandlerVersion; + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.autoUpgradeMinorVersion; + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + this.autoUpgradeMinorVersion = autoUpgradeMinorVersion; + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Object settings() { + return this.settings; + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withSettings(Object settings) { + this.settings = settings; + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Object protectedSettings() { + return this.protectedSettings; + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withProtectedSettings(Object protectedSettings) { + this.protectedSettings = protectedSettings; + return this; + } + + /** + * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * handler will be forced to update even if the extension configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @return the provisionAfterExtensions value. + */ + public List provisionAfterExtensions() { + return this.provisionAfterExtensions; + } + + /** + * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * provisioned. + * + * @param provisionAfterExtensions the provisionAfterExtensions value to set. + * @return the VmssExtension object itself. + */ + public VmssExtension withProvisionAfterExtensions(List provisionAfterExtensions) { + this.provisionAfterExtensions = provisionAfterExtensions; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model VmssExtension")); + } + if (publisher() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property publisher in model VmssExtension")); + } + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model VmssExtension")); + } + if (typeHandlerVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property typeHandlerVersion in model VmssExtension")); + } + } +}