diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 0537949b182b9..6bc95efbec5ad 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -310,6 +310,7 @@ com.azure.resourcemanager:azure-resourcemanager-elastic;1.0.0-beta.1;1.0.0-beta. com.azure.resourcemanager:azure-resourcemanager-webpubsub;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-security;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-azurearcdata;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-containerservice-generated;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/pom.xml b/pom.xml index d11e9f2843cef..1e73a5ddd7600 100644 --- a/pom.xml +++ b/pom.xml @@ -732,6 +732,7 @@ sdk/confluent sdk/consumption sdk/containerregistry + sdk/containerservice sdk/core sdk/cosmos sdk/costmanagement diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/CHANGELOG.md b/sdk/containerservice/azure-resourcemanager-containerservice-generated/CHANGELOG.md new file mode 100644 index 0000000000000..28bdf258fb6e0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-08-12) + +- Azure Resource Manager ContainerService client library for Java. This package contains Microsoft Azure SDK for ContainerService Management SDK. Container Service Client. Package tag package-2021-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/README.md b/sdk/containerservice/azure-resourcemanager-containerservice-generated/README.md new file mode 100644 index 0000000000000..dae81abf96b95 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/README.md @@ -0,0 +1,101 @@ +# Azure Resource Manager ContainerService client library for Java + +Azure Resource Manager ContainerService client library for Java. + +This package contains Microsoft Azure SDK for ContainerService Management SDK. Container Service Client. Package tag package-2021-08. 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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-containerservice-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-containerservice-generated + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ContainerServiceManager manager = ContainerServiceManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/pom.xml b/sdk/containerservice/azure-resourcemanager-containerservice-generated/pom.xml new file mode 100644 index 0000000000000..0f79082d4a3e3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-containerservice-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ContainerService Management + This package contains Microsoft Azure SDK for ContainerService Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Container Service Client. Package tag package-2021-08. + https://github.com/Azure/azure-sdk-for-java + + + + 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.19.0 + + + com.azure + azure-core-management + 1.4.0 + + + + + + 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/ContainerServiceManager.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/ContainerServiceManager.java new file mode 100644 index 0000000000000..1c052fe38cc40 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/ContainerServiceManager.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +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.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +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; +import com.azure.resourcemanager.containerservice.generated.fluent.ContainerServiceManagementClient; +import com.azure.resourcemanager.containerservice.generated.implementation.AgentPoolsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.ContainerServiceManagementClientBuilder; +import com.azure.resourcemanager.containerservice.generated.implementation.ContainerServicesImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.MaintenanceConfigurationsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.ManagedClustersImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.OpenShiftManagedClustersImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.ResolvePrivateLinkServiceIdsImpl; +import com.azure.resourcemanager.containerservice.generated.implementation.SnapshotsImpl; +import com.azure.resourcemanager.containerservice.generated.models.AgentPools; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServices; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfigurations; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusters; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusters; +import com.azure.resourcemanager.containerservice.generated.models.Operations; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnections; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.containerservice.generated.models.ResolvePrivateLinkServiceIds; +import com.azure.resourcemanager.containerservice.generated.models.Snapshots; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to ContainerServiceManager. Container Service Client. */ +public final class ContainerServiceManager { + private OpenShiftManagedClusters openShiftManagedClusters; + + private ContainerServices containerServices; + + private Operations operations; + + private ManagedClusters managedClusters; + + private MaintenanceConfigurations maintenanceConfigurations; + + private AgentPools agentPools; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + + private ResolvePrivateLinkServiceIds resolvePrivateLinkServiceIds; + + private Snapshots snapshots; + + private final ContainerServiceManagementClient clientObject; + + private ContainerServiceManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ContainerServiceManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ContainerService service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerService service API instance. + */ + public static ContainerServiceManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create ContainerServiceManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ContainerServiceManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + 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. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ContainerService service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerService service API instance. + */ + public ContainerServiceManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.containerservice.generated") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ContainerServiceManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of OpenShiftManagedClusters. */ + public OpenShiftManagedClusters openShiftManagedClusters() { + if (this.openShiftManagedClusters == null) { + this.openShiftManagedClusters = + new OpenShiftManagedClustersImpl(clientObject.getOpenShiftManagedClusters(), this); + } + return openShiftManagedClusters; + } + + /** @return Resource collection API of ContainerServices. */ + public ContainerServices containerServices() { + if (this.containerServices == null) { + this.containerServices = new ContainerServicesImpl(clientObject.getContainerServices(), this); + } + return containerServices; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @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 MaintenanceConfigurations. */ + public MaintenanceConfigurations maintenanceConfigurations() { + if (this.maintenanceConfigurations == null) { + this.maintenanceConfigurations = + new MaintenanceConfigurationsImpl(clientObject.getMaintenanceConfigurations(), this); + } + return maintenanceConfigurations; + } + + /** @return Resource collection API of AgentPools. */ + public AgentPools agentPools() { + if (this.agentPools == null) { + this.agentPools = new AgentPoolsImpl(clientObject.getAgentPools(), this); + } + return agentPools; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of ResolvePrivateLinkServiceIds. */ + public ResolvePrivateLinkServiceIds resolvePrivateLinkServiceIds() { + if (this.resolvePrivateLinkServiceIds == null) { + this.resolvePrivateLinkServiceIds = + new ResolvePrivateLinkServiceIdsImpl(clientObject.getResolvePrivateLinkServiceIds(), this); + } + return resolvePrivateLinkServiceIds; + } + + /** @return Resource collection API of Snapshots. */ + public Snapshots snapshots() { + if (this.snapshots == null) { + this.snapshots = new SnapshotsImpl(clientObject.getSnapshots(), this); + } + return snapshots; + } + + /** + * @return Wrapped service client ContainerServiceManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public ContainerServiceManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/AgentPoolsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/AgentPoolsClient.java new file mode 100644 index 0000000000000..0599eb2f1f935 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/AgentPoolsClient.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; + +/** An instance of this class provides access to all the operations defined in AgentPoolsClient. */ +public interface AgentPoolsClient { + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of agent pools in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of agent pools in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 specified managed cluster agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner get(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 specified managed cluster agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String resourceName, String agentPoolName, Context context); + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AgentPoolInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters); + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AgentPoolInner> beginCreateOrUpdate( + String resourceGroupName, + String resourceName, + String agentPoolName, + AgentPoolInner parameters, + Context context); + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner createOrUpdate( + String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters); + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner createOrUpdate( + String resourceGroupName, + String resourceName, + String agentPoolName, + AgentPoolInner parameters, + Context context); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName, Context context); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName, Context context); + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 upgrade profile for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 upgrade profile for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getUpgradeProfileWithResponse( + String resourceGroupName, String resourceName, String agentPoolName, Context context); + + /** + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of available versions for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolAvailableVersionsInner getAvailableAgentPoolVersions(String resourceGroupName, String resourceName); + + /** + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of available versions for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAvailableAgentPoolVersionsWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AgentPoolInner> beginUpgradeNodeImageVersion( + String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, AgentPoolInner> beginUpgradeNodeImageVersion( + String resourceGroupName, String resourceName, String agentPoolName, Context context); + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentPoolInner upgradeNodeImageVersion( + String resourceGroupName, String resourceName, String agentPoolName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServiceManagementClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServiceManagementClient.java new file mode 100644 index 0000000000000..bb646eea8a5ff --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServiceManagementClient.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ContainerServiceManagementClient class. */ +public interface ContainerServiceManagementClient { + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OpenShiftManagedClustersClient object to access its operations. + * + * @return the OpenShiftManagedClustersClient object. + */ + OpenShiftManagedClustersClient getOpenShiftManagedClusters(); + + /** + * Gets the ContainerServicesClient object to access its operations. + * + * @return the ContainerServicesClient object. + */ + ContainerServicesClient getContainerServices(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the ManagedClustersClient object to access its operations. + * + * @return the ManagedClustersClient object. + */ + ManagedClustersClient getManagedClusters(); + + /** + * Gets the MaintenanceConfigurationsClient object to access its operations. + * + * @return the MaintenanceConfigurationsClient object. + */ + MaintenanceConfigurationsClient getMaintenanceConfigurations(); + + /** + * Gets the AgentPoolsClient object to access its operations. + * + * @return the AgentPoolsClient object. + */ + AgentPoolsClient getAgentPools(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the ResolvePrivateLinkServiceIdsClient object to access its operations. + * + * @return the ResolvePrivateLinkServiceIdsClient object. + */ + ResolvePrivateLinkServiceIdsClient getResolvePrivateLinkServiceIds(); + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + SnapshotsClient getSnapshots(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServicesClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServicesClient.java new file mode 100644 index 0000000000000..088837879dbad --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServicesClient.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.models.ContainerServiceInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OrchestratorVersionProfileListResultInner; + +/** An instance of this class provides access to all the operations defined in ContainerServicesClient. */ +public interface ContainerServicesClient { + /** + * Gets a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 list of container services in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 list of container services in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ContainerServiceInner> beginCreateOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters); + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ContainerServiceInner> beginCreateOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context); + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerServiceInner createOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters); + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerServiceInner createOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context); + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the properties of the specified container service in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerServiceInner getByResourceGroup(String resourceGroupName, String containerServiceName); + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the properties of the specified container service in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String containerServiceName, Context context); + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String containerServiceName); + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String containerServiceName, Context context); + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String containerServiceName); + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String containerServiceName, Context context); + + /** + * Gets a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 a list of container services in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 a list of container services in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each + * orchestrator including version, available upgrades and whether that version or upgrades are in preview. + * + * @param location The name of a supported Azure region. + * @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 list of supported orchestrators in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrchestratorVersionProfileListResultInner listOrchestrators(String location); + + /** + * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each + * orchestrator including version, available upgrades and whether that version or upgrades are in preview. + * + * @param location The name of a supported Azure region. + * @param resourceType resource type for which the list of orchestrators needs to be returned. + * @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 list of supported orchestrators in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listOrchestratorsWithResponse( + String location, String resourceType, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MaintenanceConfigurationsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MaintenanceConfigurationsClient.java new file mode 100644 index 0000000000000..08bb84baea736 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MaintenanceConfigurationsClient.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; + +/** An instance of this class provides access to all the operations defined in MaintenanceConfigurationsClient. */ +public interface MaintenanceConfigurationsClient { + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of maintenance configurations in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagedCluster(String resourceGroupName, String resourceName); + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of maintenance configurations in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByManagedCluster( + String resourceGroupName, String resourceName, Context context); + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 specified maintenance configuration of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceConfigurationInner get(String resourceGroupName, String resourceName, String configName); + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 specified maintenance configuration of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String resourceName, String configName, Context context); + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. + * @param parameters The maintenance configuration to create or update. + * @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 see [planned maintenance](https://docs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceConfigurationInner createOrUpdate( + String resourceGroupName, String resourceName, String configName, MaintenanceConfigurationInner parameters); + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. + * @param parameters The maintenance configuration to create or update. + * @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 see [planned maintenance](https://docs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String resourceName, + String configName, + MaintenanceConfigurationInner parameters, + Context context); + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String configName); + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String resourceName, String configName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClustersClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClustersClient.java new file mode 100644 index 0000000000000..ca91f31c9afae --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClustersClient.java @@ -0,0 +1,885 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OSOptionProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAadProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ManagedClustersClient. */ +public interface ManagedClustersClient { + /** + * Gets supported OS options in the specified subscription. + * + * @param location The name of a supported Azure region. + * @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 supported OS options in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OSOptionProfileInner getOSOptions(String location); + + /** + * Gets supported OS options in the specified subscription. + * + * @param location The name of a supported Azure region. + * @param resourceType The resource type for which the OS options needs to be returned. + * @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 supported OS options in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getOSOptionsWithResponse(String location, String resourceType, Context context); + + /** + * Gets a list of managed clusters in the specified 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 a list of managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of managed clusters in the specified 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 a list of managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists managed clusters in the specified subscription and 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 the response from the List Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists managed clusters in the specified subscription and 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 the response from the List Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 upgrade profile of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName); + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 upgrade profile of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getUpgradeProfileWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * **WARNING**: This API will be deprecated. Instead use + * [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + * or + * [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + * . + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile 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 managed cluster Access Profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterAccessProfileInner getAccessProfile(String resourceGroupName, String resourceName, String roleName); + + /** + * **WARNING**: This API will be deprecated. Instead use + * [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + * or + * [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + * . + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile 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 managed cluster Access Profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAccessProfileWithResponse( + String resourceGroupName, String resourceName, String roleName, Context context); + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialResultsInner listClusterAdminCredentials(String resourceGroupName, String resourceName); + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterAdminCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context); + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialResultsInner listClusterUserCredentials(String resourceGroupName, String resourceName); + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialResultsInner listClusterMonitoringUserCredentials(String resourceGroupName, String resourceName); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterMonitoringUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context); + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterInner parameters); + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context); + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner createOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters); + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner createOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context); + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags 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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginUpdateTags( + String resourceGroupName, String resourceName, TagsObject parameters); + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedClusterInner> beginUpdateTags( + String resourceGroupName, String resourceName, TagsObject parameters, Context context); + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags 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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters); + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterInner updateTags( + String resourceGroupName, String resourceName, TagsObject parameters, Context context); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName, Context context); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName, Context context); + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginResetServicePrincipalProfile( + String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters); + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginResetServicePrincipalProfile( + String resourceGroupName, + String resourceName, + ManagedClusterServicePrincipalProfile parameters, + Context context); + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetServicePrincipalProfile( + String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters); + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetServicePrincipalProfile( + String resourceGroupName, + String resourceName, + ManagedClusterServicePrincipalProfile parameters, + Context context); + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginResetAadProfile( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters); + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginResetAadProfile( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context); + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetAadProfile(String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters); + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void resetAadProfile( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context); + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginRotateClusterCertificates(String resourceGroupName, String resourceName); + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginRotateClusterCertificates( + String resourceGroupName, String resourceName, Context context); + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 rotateClusterCertificates(String resourceGroupName, String resourceName); + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 rotateClusterCertificates(String resourceGroupName, String resourceName, Context context); + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStop(String resourceGroupName, String resourceName); + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStop(String resourceGroupName, String resourceName, Context context); + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 stop(String resourceGroupName, String resourceName); + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 stop(String resourceGroupName, String resourceName, Context context); + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStart(String resourceGroupName, String resourceName); + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStart(String resourceGroupName, String resourceName, Context context); + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 start(String resourceGroupName, String resourceName); + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 start(String resourceGroupName, String resourceName, Context context); + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload); + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload, Context context); + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandResultInner runCommand(String resourceGroupName, String resourceName, RunCommandRequest requestPayload); + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandResultInner runCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload, Context context); + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @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 results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunCommandResultInner getCommandResult(String resourceGroupName, String resourceName, String commandId); + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @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 results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCommandResultWithResponse( + String resourceGroupName, String resourceName, String commandId, Context context); + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. The operation returns properties of each egress endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String resourceName); + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. The operation returns properties of each egress endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OpenShiftManagedClustersClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OpenShiftManagedClustersClient.java new file mode 100644 index 0000000000000..ebe940775f103 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OpenShiftManagedClustersClient.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.models.OpenShiftManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in OpenShiftManagedClustersClient. */ +public interface OpenShiftManagedClustersClient { + /** + * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each + * OpenShift managed cluster. + * + * @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 list of OpenShift managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each + * OpenShift managed 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 a list of OpenShift managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns + * properties of each OpenShift managed cluster. + * + * @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 the response from the List OpenShift Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns + * properties of each OpenShift managed cluster. + * + * @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 the response from the List OpenShift Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 details of the managed OpenShift cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenShiftManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 details of the managed OpenShift cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OpenShiftManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters); + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OpenShiftManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context); + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenShiftManagedClusterInner createOrUpdate( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters); + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenShiftManagedClusterInner createOrUpdate( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context); + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OpenShiftManagedClusterInner> beginUpdateTags( + String resourceGroupName, String resourceName, TagsObject parameters); + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OpenShiftManagedClusterInner> beginUpdateTags( + String resourceGroupName, String resourceName, TagsObject parameters, Context context); + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenShiftManagedClusterInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters); + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OpenShiftManagedClusterInner updateTags( + String resourceGroupName, String resourceName, TagsObject parameters, Context context); + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName); + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName, Context context); + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName); + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OperationsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..909dca7291b40 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Gets a list of 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 a list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of 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 a list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateEndpointConnectionsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..da7cd723108b1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionListResultInner list(String resourceGroupName, String resourceName); + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner update( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateLinkResourcesClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..6e018ab2b8d3f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/PrivateLinkResourcesClient.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.containerservice.generated.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.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourcesListResultInner list(String resourceGroupName, String resourceName); + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ResolvePrivateLinkServiceIdsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ResolvePrivateLinkServiceIdsClient.java new file mode 100644 index 0000000000000..c2b5c66998577 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ResolvePrivateLinkServiceIdsClient.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.containerservice.generated.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.containerservice.generated.fluent.models.PrivateLinkResourceInner; + +/** An instance of this class provides access to all the operations defined in ResolvePrivateLinkServiceIdsClient. */ +public interface ResolvePrivateLinkServiceIdsClient { + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service 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 the private link service ID for the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner post(String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters); + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service 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 the private link service ID for the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response postWithResponse( + String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/SnapshotsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/SnapshotsClient.java new file mode 100644 index 0000000000000..5e4a14e997d5c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/SnapshotsClient.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in SnapshotsClient. */ +public interface SnapshotsClient { + /** + * Gets a list of snapshots in the specified 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 a list of snapshots in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of snapshots in the specified 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 a list of snapshots in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists snapshots in the specified subscription and 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 the response from the List Snapshots operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists snapshots in the specified subscription and 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 the response from the List Snapshots operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner createOrUpdate(String resourceGroupName, String resourceName, SnapshotInner parameters); + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String resourceName, SnapshotInner parameters, Context context); + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags 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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters); + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags operation. + * @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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String resourceName, TagsObject parameters, Context context); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsInner.java new file mode 100644 index 0000000000000..4a1fe85623984 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsInner.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.containerservice.generated.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.containerservice.generated.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of available versions for an agent pool. */ +@JsonFlatten +@Fluent +public class AgentPoolAvailableVersionsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolAvailableVersionsInner.class); + + /* + * The ID of the agent pool version list. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The name of the agent pool version list. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Type of the agent pool version list. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * List of versions available for agent pool. + */ + @JsonProperty(value = "properties.agentPoolVersions") + private List agentPoolVersions; + + /** + * Get the id property: The ID of the agent pool version list. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the agent pool version list. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Type of the agent pool version list. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the agentPoolVersions property: List of versions available for agent pool. + * + * @return the agentPoolVersions value. + */ + public List agentPoolVersions() { + return this.agentPoolVersions; + } + + /** + * Set the agentPoolVersions property: List of versions available for agent pool. + * + * @param agentPoolVersions the agentPoolVersions value to set. + * @return the AgentPoolAvailableVersionsInner object itself. + */ + public AgentPoolAvailableVersionsInner withAgentPoolVersions( + List agentPoolVersions) { + this.agentPoolVersions = agentPoolVersions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (agentPoolVersions() != null) { + agentPoolVersions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolInner.java new file mode 100644 index 0000000000000..88a39969b8532 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolInner.java @@ -0,0 +1,1205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.GpuInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.KubeletConfig; +import com.azure.resourcemanager.containerservice.generated.models.KubeletDiskType; +import com.azure.resourcemanager.containerservice.generated.models.LinuxOSConfig; +import com.azure.resourcemanager.containerservice.generated.models.OSDiskType; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.Ossku; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.ScaleDownMode; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetEvictionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetPriority; +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; + +/** Agent Pool. */ +@JsonFlatten +@Fluent +public class AgentPoolInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolInner.class); + + /* + * Number of agents (VMs) to host docker containers. Allowed values must be + * in the range of 0 to 1000 (inclusive) for user pools and in the range of + * 1 to 1000 (inclusive) for system pools. The default value is 1. + */ + @JsonProperty(value = "properties.count") + private Integer count; + + /* + * The size of the agent pool VMs. VM size availability varies by region. + * If a node contains insufficient compute resources (memory, cpu, etc) + * pods might fail to run correctly. For more details on restricted VM + * sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + */ + @JsonProperty(value = "properties.vmSize") + private String vmSize; + + /* + * OS Disk Size in GB to be used to specify the disk size for every machine + * in the master/agent pool. If you specify 0, it will apply the default + * osDisk size according to the vmSize specified. + */ + @JsonProperty(value = "properties.osDiskSizeGB") + private Integer osDiskSizeGB; + + /* + * The OS disk type to be used for machines in the agent pool. The default + * is 'Ephemeral' if the VM supports it and has a cache disk larger than + * the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be + * changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + */ + @JsonProperty(value = "properties.osDiskType") + private OSDiskType osDiskType; + + /* + * Determines the placement of emptyDir volumes, container runtime data + * root, and Kubelet ephemeral storage. + */ + @JsonProperty(value = "properties.kubeletDiskType") + private KubeletDiskType kubeletDiskType; + + /* + * The ID of the subnet which agent pool nodes and optionally pods will + * join on startup. If this is not specified, a VNET and subnet will be + * generated and used. If no podSubnetID is specified, this applies to + * nodes and pods, otherwise it applies to just nodes. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + */ + @JsonProperty(value = "properties.vnetSubnetID") + private String vnetSubnetId; + + /* + * The ID of the subnet which pods will join when launched. If omitted, pod + * IPs are statically assigned on the node subnet (see vnetSubnetID for + * more details). This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + */ + @JsonProperty(value = "properties.podSubnetID") + private String podSubnetId; + + /* + * The maximum number of pods that can run on a node. + */ + @JsonProperty(value = "properties.maxPods") + private Integer maxPods; + + /* + * OsType to be used to specify os type. Choose from Linux and Windows. + * Default to Linux. + */ + @JsonProperty(value = "properties.osType") + private OSType osType; + + /* + * Specifies an OS SKU. This value must not be specified if OSType is + * Windows. + */ + @JsonProperty(value = "properties.osSKU") + private Ossku osSku; + + /* + * The maximum number of nodes for auto-scaling + */ + @JsonProperty(value = "properties.maxCount") + private Integer maxCount; + + /* + * The minimum number of nodes for auto-scaling + */ + @JsonProperty(value = "properties.minCount") + private Integer minCount; + + /* + * Whether to enable auto-scaler + */ + @JsonProperty(value = "properties.enableAutoScaling") + private Boolean enableAutoScaling; + + /* + * This also effects the cluster autoscaler behavior. If not specified, it + * defaults to Delete. + */ + @JsonProperty(value = "properties.scaleDownMode") + private ScaleDownMode scaleDownMode; + + /* + * The type of Agent Pool. + */ + @JsonProperty(value = "properties.type") + private AgentPoolType typePropertiesType; + + /* + * The mode of an agent pool. A cluster must have at least one 'System' + * Agent Pool at all times. For additional information on agent pool + * restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools + */ + @JsonProperty(value = "properties.mode") + private AgentPoolMode mode; + + /* + * The version of Kubernetes running on the Agent Pool. As a best practice, + * you should upgrade all node pools in an AKS cluster to the same + * Kubernetes version. The node pool version must have the same major + * version as the control plane. The node pool minor version must be within + * two minor versions of the control plane version. The node pool version + * cannot be greater than the control plane version. For more information + * see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + */ + @JsonProperty(value = "properties.orchestratorVersion") + private String orchestratorVersion; + + /* + * The version of node image + */ + @JsonProperty(value = "properties.nodeImageVersion", access = JsonProperty.Access.WRITE_ONLY) + private String nodeImageVersion; + + /* + * Settings for upgrading the agentpool + */ + @JsonProperty(value = "properties.upgradeSettings") + private AgentPoolUpgradeSettings upgradeSettings; + + /* + * The current deployment or provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Describes whether the Agent Pool is Running or Stopped + */ + @JsonProperty(value = "properties.powerState", access = JsonProperty.Access.WRITE_ONLY) + private PowerState powerState; + + /* + * The list of Availability zones to use for nodes. This can only be + * specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + */ + @JsonProperty(value = "properties.availabilityZones") + private List availabilityZones; + + /* + * Whether each node is allocated its own public IP. Some scenarios may + * require nodes in a node pool to receive their own dedicated public IP + * addresses. A common scenario is for gaming workloads, where a console + * needs to make a direct connection to a cloud virtual machine to minimize + * hops. For more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false. + */ + @JsonProperty(value = "properties.enableNodePublicIP") + private Boolean enableNodePublicIp; + + /* + * The public IP prefix ID which VM nodes should use IPs from. This is of + * the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + */ + @JsonProperty(value = "properties.nodePublicIPPrefixID") + private String nodePublicIpPrefixId; + + /* + * The Virtual Machine Scale Set priority. If not specified, the default is + * 'Regular'. + */ + @JsonProperty(value = "properties.scaleSetPriority") + private ScaleSetPriority scaleSetPriority; + + /* + * The Virtual Machine Scale Set eviction policy. This cannot be specified + * unless the scaleSetPriority is 'Spot'. If not specified, the default is + * 'Delete'. + */ + @JsonProperty(value = "properties.scaleSetEvictionPolicy") + private ScaleSetEvictionPolicy scaleSetEvictionPolicy; + + /* + * The max price (in US Dollars) you are willing to pay for spot instances. + * Possible values are any decimal value greater than zero or -1 which + * indicates default price to be up-to on-demand. Possible values are any + * decimal value greater than zero or -1 which indicates the willingness to + * pay any on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + */ + @JsonProperty(value = "properties.spotMaxPrice") + private Float spotMaxPrice; + + /* + * The tags to be persisted on the agent pool virtual machine scale set. + */ + @JsonProperty(value = "properties.tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The node labels to be persisted across all nodes in agent pool. + */ + @JsonProperty(value = "properties.nodeLabels") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map nodeLabels; + + /* + * The taints added to new nodes during node pool create and scale. For + * example, key=value:NoSchedule. + */ + @JsonProperty(value = "properties.nodeTaints") + private List nodeTaints; + + /* + * The ID for Proximity Placement Group. + */ + @JsonProperty(value = "properties.proximityPlacementGroupID") + private String proximityPlacementGroupId; + + /* + * Kubelet configurations of agent nodes. The Kubelet configuration on the + * agent pool nodes. + */ + @JsonProperty(value = "properties.kubeletConfig") + private KubeletConfig kubeletConfig; + + /* + * OS configurations of Linux agent nodes. The OS configuration of Linux + * agent nodes. + */ + @JsonProperty(value = "properties.linuxOSConfig") + private LinuxOSConfig linuxOSConfig; + + /* + * Whether to enable host based OS and data drive encryption. This is only + * supported on certain VM sizes and in certain Azure regions. For more + * information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption + */ + @JsonProperty(value = "properties.enableEncryptionAtHost") + private Boolean enableEncryptionAtHost; + + /* + * Whether to enable UltraSSD + */ + @JsonProperty(value = "properties.enableUltraSSD") + private Boolean enableUltraSsd; + + /* + * Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + * for more details. + */ + @JsonProperty(value = "properties.enableFIPS") + private Boolean enableFips; + + /* + * GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + */ + @JsonProperty(value = "properties.gpuInstanceProfile") + private GpuInstanceProfile gpuInstanceProfile; + + /* + * CreationData to be used to specify the source Snapshot ID if the node + * pool will be created/upgraded using a snapshot. + */ + @JsonProperty(value = "properties.creationData") + private CreationData creationData; + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of + * 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default + * value is 1. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of + * 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default + * value is 1. + * + * @param count the count value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the vmSize property: The size of the agent pool VMs. VM size availability varies by region. If a node + * contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + * restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The size of the agent pool VMs. VM size availability varies by region. If a node + * contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + * restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + * + * @param vmSize the vmSize value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in the + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + * + * @return the osDiskSizeGB value. + */ + public Integer osDiskSizeGB() { + return this.osDiskSizeGB; + } + + /** + * Set the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in the + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + * + * @param osDiskSizeGB the osDiskSizeGB value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOsDiskSizeGB(Integer osDiskSizeGB) { + this.osDiskSizeGB = osDiskSizeGB; + return this; + } + + /** + * Get the osDiskType property: The OS disk type to be used for machines in the agent pool. The default is + * 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + * defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + * + * @return the osDiskType value. + */ + public OSDiskType osDiskType() { + return this.osDiskType; + } + + /** + * Set the osDiskType property: The OS disk type to be used for machines in the agent pool. The default is + * 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + * defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + * + * @param osDiskType the osDiskType value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOsDiskType(OSDiskType osDiskType) { + this.osDiskType = osDiskType; + return this; + } + + /** + * Get the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * + * @return the kubeletDiskType value. + */ + public KubeletDiskType kubeletDiskType() { + return this.kubeletDiskType; + } + + /** + * Set the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * + * @param kubeletDiskType the kubeletDiskType value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withKubeletDiskType(KubeletDiskType kubeletDiskType) { + this.kubeletDiskType = kubeletDiskType; + return this; + } + + /** + * Get the vnetSubnetId property: The ID of the subnet which agent pool nodes and optionally pods will join on + * startup. If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, + * this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @return the vnetSubnetId value. + */ + public String vnetSubnetId() { + return this.vnetSubnetId; + } + + /** + * Set the vnetSubnetId property: The ID of the subnet which agent pool nodes and optionally pods will join on + * startup. If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, + * this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @param vnetSubnetId the vnetSubnetId value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withVnetSubnetId(String vnetSubnetId) { + this.vnetSubnetId = vnetSubnetId; + return this; + } + + /** + * Get the podSubnetId property: The ID of the subnet which pods will join when launched. If omitted, pod IPs are + * statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @return the podSubnetId value. + */ + public String podSubnetId() { + return this.podSubnetId; + } + + /** + * Set the podSubnetId property: The ID of the subnet which pods will join when launched. If omitted, pod IPs are + * statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @param podSubnetId the podSubnetId value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withPodSubnetId(String podSubnetId) { + this.podSubnetId = podSubnetId; + return this; + } + + /** + * Get the maxPods property: The maximum number of pods that can run on a node. + * + * @return the maxPods value. + */ + public Integer maxPods() { + return this.maxPods; + } + + /** + * Set the maxPods property: The maximum number of pods that can run on a node. + * + * @param maxPods the maxPods value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withMaxPods(Integer maxPods) { + this.maxPods = maxPods; + return this; + } + + /** + * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @param osType the osType value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the osSku property: Specifies an OS SKU. This value must not be specified if OSType is Windows. + * + * @return the osSku value. + */ + public Ossku osSku() { + return this.osSku; + } + + /** + * Set the osSku property: Specifies an OS SKU. This value must not be specified if OSType is Windows. + * + * @param osSku the osSku value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOsSku(Ossku osSku) { + this.osSku = osSku; + return this; + } + + /** + * Get the maxCount property: The maximum number of nodes for auto-scaling. + * + * @return the maxCount value. + */ + public Integer maxCount() { + return this.maxCount; + } + + /** + * Set the maxCount property: The maximum number of nodes for auto-scaling. + * + * @param maxCount the maxCount value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withMaxCount(Integer maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * Get the minCount property: The minimum number of nodes for auto-scaling. + * + * @return the minCount value. + */ + public Integer minCount() { + return this.minCount; + } + + /** + * Set the minCount property: The minimum number of nodes for auto-scaling. + * + * @param minCount the minCount value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withMinCount(Integer minCount) { + this.minCount = minCount; + return this; + } + + /** + * Get the enableAutoScaling property: Whether to enable auto-scaler. + * + * @return the enableAutoScaling value. + */ + public Boolean enableAutoScaling() { + return this.enableAutoScaling; + } + + /** + * Set the enableAutoScaling property: Whether to enable auto-scaler. + * + * @param enableAutoScaling the enableAutoScaling value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withEnableAutoScaling(Boolean enableAutoScaling) { + this.enableAutoScaling = enableAutoScaling; + return this; + } + + /** + * Get the scaleDownMode property: This also effects the cluster autoscaler behavior. If not specified, it defaults + * to Delete. + * + * @return the scaleDownMode value. + */ + public ScaleDownMode scaleDownMode() { + return this.scaleDownMode; + } + + /** + * Set the scaleDownMode property: This also effects the cluster autoscaler behavior. If not specified, it defaults + * to Delete. + * + * @param scaleDownMode the scaleDownMode value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withScaleDownMode(ScaleDownMode scaleDownMode) { + this.scaleDownMode = scaleDownMode; + return this; + } + + /** + * Get the typePropertiesType property: The type of Agent Pool. + * + * @return the typePropertiesType value. + */ + public AgentPoolType typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: The type of Agent Pool. + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withTypePropertiesType(AgentPoolType typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the mode property: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at all + * times. For additional information on agent pool restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools. + * + * @return the mode value. + */ + public AgentPoolMode mode() { + return this.mode; + } + + /** + * Set the mode property: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at all + * times. For additional information on agent pool restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools. + * + * @param mode the mode value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withMode(AgentPoolMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the orchestratorVersion property: The version of Kubernetes running on the Agent Pool. As a best practice, + * you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must + * have the same major version as the control plane. The node pool minor version must be within two minor versions + * of the control plane version. The node pool version cannot be greater than the control plane version. For more + * information see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + * + * @return the orchestratorVersion value. + */ + public String orchestratorVersion() { + return this.orchestratorVersion; + } + + /** + * Set the orchestratorVersion property: The version of Kubernetes running on the Agent Pool. As a best practice, + * you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must + * have the same major version as the control plane. The node pool minor version must be within two minor versions + * of the control plane version. The node pool version cannot be greater than the control plane version. For more + * information see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + * + * @param orchestratorVersion the orchestratorVersion value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOrchestratorVersion(String orchestratorVersion) { + this.orchestratorVersion = orchestratorVersion; + return this; + } + + /** + * Get the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + public String nodeImageVersion() { + return this.nodeImageVersion; + } + + /** + * Get the upgradeSettings property: Settings for upgrading the agentpool. + * + * @return the upgradeSettings value. + */ + public AgentPoolUpgradeSettings upgradeSettings() { + return this.upgradeSettings; + } + + /** + * Set the upgradeSettings property: Settings for upgrading the agentpool. + * + * @param upgradeSettings the upgradeSettings value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { + this.upgradeSettings = upgradeSettings; + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the powerState property: Describes whether the Agent Pool is Running or Stopped. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.powerState; + } + + /** + * Get the availabilityZones property: The list of Availability zones to use for nodes. This can only be specified + * if the AgentPoolType property is 'VirtualMachineScaleSets'. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: The list of Availability zones to use for nodes. This can only be specified + * if the AgentPoolType property is 'VirtualMachineScaleSets'. + * + * @param availabilityZones the availabilityZones value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the enableNodePublicIp property: Whether each node is allocated its own public IP. Some scenarios may require + * nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming + * workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For + * more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false. + * + * @return the enableNodePublicIp value. + */ + public Boolean enableNodePublicIp() { + return this.enableNodePublicIp; + } + + /** + * Set the enableNodePublicIp property: Whether each node is allocated its own public IP. Some scenarios may require + * nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming + * workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For + * more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false. + * + * @param enableNodePublicIp the enableNodePublicIp value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withEnableNodePublicIp(Boolean enableNodePublicIp) { + this.enableNodePublicIp = enableNodePublicIp; + return this; + } + + /** + * Get the nodePublicIpPrefixId property: The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @return the nodePublicIpPrefixId value. + */ + public String nodePublicIpPrefixId() { + return this.nodePublicIpPrefixId; + } + + /** + * Set the nodePublicIpPrefixId property: The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @param nodePublicIpPrefixId the nodePublicIpPrefixId value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withNodePublicIpPrefixId(String nodePublicIpPrefixId) { + this.nodePublicIpPrefixId = nodePublicIpPrefixId; + return this; + } + + /** + * Get the scaleSetPriority property: The Virtual Machine Scale Set priority. If not specified, the default is + * 'Regular'. + * + * @return the scaleSetPriority value. + */ + public ScaleSetPriority scaleSetPriority() { + return this.scaleSetPriority; + } + + /** + * Set the scaleSetPriority property: The Virtual Machine Scale Set priority. If not specified, the default is + * 'Regular'. + * + * @param scaleSetPriority the scaleSetPriority value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withScaleSetPriority(ScaleSetPriority scaleSetPriority) { + this.scaleSetPriority = scaleSetPriority; + return this; + } + + /** + * Get the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. This cannot be specified + * unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + * + * @return the scaleSetEvictionPolicy value. + */ + public ScaleSetEvictionPolicy scaleSetEvictionPolicy() { + return this.scaleSetEvictionPolicy; + } + + /** + * Set the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. This cannot be specified + * unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + * + * @param scaleSetEvictionPolicy the scaleSetEvictionPolicy value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy) { + this.scaleSetEvictionPolicy = scaleSetEvictionPolicy; + return this; + } + + /** + * Get the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any + * on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + * + * @return the spotMaxPrice value. + */ + public Float spotMaxPrice() { + return this.spotMaxPrice; + } + + /** + * Set the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any + * on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + * + * @param spotMaxPrice the spotMaxPrice value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withSpotMaxPrice(Float spotMaxPrice) { + this.spotMaxPrice = spotMaxPrice; + return this; + } + + /** + * Get the tags property: The tags to be persisted on the agent pool virtual machine scale set. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags to be persisted on the agent pool virtual machine scale set. + * + * @param tags the tags value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the nodeLabels property: The node labels to be persisted across all nodes in agent pool. + * + * @return the nodeLabels value. + */ + public Map nodeLabels() { + return this.nodeLabels; + } + + /** + * Set the nodeLabels property: The node labels to be persisted across all nodes in agent pool. + * + * @param nodeLabels the nodeLabels value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withNodeLabels(Map nodeLabels) { + this.nodeLabels = nodeLabels; + return this; + } + + /** + * Get the nodeTaints property: The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * + * @return the nodeTaints value. + */ + public List nodeTaints() { + return this.nodeTaints; + } + + /** + * Set the nodeTaints property: The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * + * @param nodeTaints the nodeTaints value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withNodeTaints(List nodeTaints) { + this.nodeTaints = nodeTaints; + return this; + } + + /** + * Get the proximityPlacementGroupId property: The ID for Proximity Placement Group. + * + * @return the proximityPlacementGroupId value. + */ + public String proximityPlacementGroupId() { + return this.proximityPlacementGroupId; + } + + /** + * Set the proximityPlacementGroupId property: The ID for Proximity Placement Group. + * + * @param proximityPlacementGroupId the proximityPlacementGroupId value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withProximityPlacementGroupId(String proximityPlacementGroupId) { + this.proximityPlacementGroupId = proximityPlacementGroupId; + return this; + } + + /** + * Get the kubeletConfig property: Kubelet configurations of agent nodes. The Kubelet configuration on the agent + * pool nodes. + * + * @return the kubeletConfig value. + */ + public KubeletConfig kubeletConfig() { + return this.kubeletConfig; + } + + /** + * Set the kubeletConfig property: Kubelet configurations of agent nodes. The Kubelet configuration on the agent + * pool nodes. + * + * @param kubeletConfig the kubeletConfig value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withKubeletConfig(KubeletConfig kubeletConfig) { + this.kubeletConfig = kubeletConfig; + return this; + } + + /** + * Get the linuxOSConfig property: OS configurations of Linux agent nodes. The OS configuration of Linux agent + * nodes. + * + * @return the linuxOSConfig value. + */ + public LinuxOSConfig linuxOSConfig() { + return this.linuxOSConfig; + } + + /** + * Set the linuxOSConfig property: OS configurations of Linux agent nodes. The OS configuration of Linux agent + * nodes. + * + * @param linuxOSConfig the linuxOSConfig value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { + this.linuxOSConfig = linuxOSConfig; + return this; + } + + /** + * Get the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. This is only + * supported on certain VM sizes and in certain Azure regions. For more information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption. + * + * @return the enableEncryptionAtHost value. + */ + public Boolean enableEncryptionAtHost() { + return this.enableEncryptionAtHost; + } + + /** + * Set the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. This is only + * supported on certain VM sizes and in certain Azure regions. For more information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption. + * + * @param enableEncryptionAtHost the enableEncryptionAtHost value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withEnableEncryptionAtHost(Boolean enableEncryptionAtHost) { + this.enableEncryptionAtHost = enableEncryptionAtHost; + return this; + } + + /** + * Get the enableUltraSsd property: Whether to enable UltraSSD. + * + * @return the enableUltraSsd value. + */ + public Boolean enableUltraSsd() { + return this.enableUltraSsd; + } + + /** + * Set the enableUltraSsd property: Whether to enable UltraSSD. + * + * @param enableUltraSsd the enableUltraSsd value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withEnableUltraSsd(Boolean enableUltraSsd) { + this.enableUltraSsd = enableUltraSsd; + return this; + } + + /** + * Get the enableFips property: Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more + * details. + * + * @return the enableFips value. + */ + public Boolean enableFips() { + return this.enableFips; + } + + /** + * Set the enableFips property: Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more + * details. + * + * @param enableFips the enableFips value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withEnableFips(Boolean enableFips) { + this.enableFips = enableFips; + return this; + } + + /** + * Get the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + * + * @return the gpuInstanceProfile value. + */ + public GpuInstanceProfile gpuInstanceProfile() { + return this.gpuInstanceProfile; + } + + /** + * Set the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + * + * @param gpuInstanceProfile the gpuInstanceProfile value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withGpuInstanceProfile(GpuInstanceProfile gpuInstanceProfile) { + this.gpuInstanceProfile = gpuInstanceProfile; + return this; + } + + /** + * Get the creationData property: CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.creationData; + } + + /** + * Set the creationData property: CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * + * @param creationData the creationData value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withCreationData(CreationData creationData) { + this.creationData = creationData; + return this; + } + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public AgentPoolInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (upgradeSettings() != null) { + upgradeSettings().validate(); + } + if (powerState() != null) { + powerState().validate(); + } + if (kubeletConfig() != null) { + kubeletConfig().validate(); + } + if (linuxOSConfig() != null) { + linuxOSConfig().validate(); + } + if (creationData() != null) { + creationData().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileInner.java new file mode 100644 index 0000000000000..6c3232c7963d6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileInner.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.models.AgentPoolUpgradeProfilePropertiesUpgradesItem; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of available upgrades for an agent pool. */ +@JsonFlatten +@Fluent +public class AgentPoolUpgradeProfileInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolUpgradeProfileInner.class); + + /* + * The ID of the agent pool upgrade profile. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The name of the agent pool upgrade profile. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The type of the agent pool upgrade profile. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The Kubernetes version (major.minor.patch). + */ + @JsonProperty(value = "properties.kubernetesVersion", required = true) + private String kubernetesVersion; + + /* + * OsType to be used to specify os type. Choose from Linux and Windows. + * Default to Linux. + */ + @JsonProperty(value = "properties.osType", required = true) + private OSType osType; + + /* + * List of orchestrator types and versions available for upgrade. + */ + @JsonProperty(value = "properties.upgrades") + private List upgrades; + + /* + * The latest AKS supported node image version. + */ + @JsonProperty(value = "properties.latestNodeImageVersion") + private String latestNodeImageVersion; + + /** + * Get the id property: The ID of the agent pool upgrade profile. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the agent pool upgrade profile. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the agent pool upgrade profile. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Set the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @param kubernetesVersion the kubernetesVersion value to set. + * @return the AgentPoolUpgradeProfileInner object itself. + */ + public AgentPoolUpgradeProfileInner withKubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + return this; + } + + /** + * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @param osType the osType value to set. + * @return the AgentPoolUpgradeProfileInner object itself. + */ + public AgentPoolUpgradeProfileInner withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the upgrades property: List of orchestrator types and versions available for upgrade. + * + * @return the upgrades value. + */ + public List upgrades() { + return this.upgrades; + } + + /** + * Set the upgrades property: List of orchestrator types and versions available for upgrade. + * + * @param upgrades the upgrades value to set. + * @return the AgentPoolUpgradeProfileInner object itself. + */ + public AgentPoolUpgradeProfileInner withUpgrades(List upgrades) { + this.upgrades = upgrades; + return this; + } + + /** + * Get the latestNodeImageVersion property: The latest AKS supported node image version. + * + * @return the latestNodeImageVersion value. + */ + public String latestNodeImageVersion() { + return this.latestNodeImageVersion; + } + + /** + * Set the latestNodeImageVersion property: The latest AKS supported node image version. + * + * @param latestNodeImageVersion the latestNodeImageVersion value to set. + * @return the AgentPoolUpgradeProfileInner object itself. + */ + public AgentPoolUpgradeProfileInner withLatestNodeImageVersion(String latestNodeImageVersion) { + this.latestNodeImageVersion = latestNodeImageVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kubernetesVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kubernetesVersion in model AgentPoolUpgradeProfileInner")); + } + if (osType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osType in model AgentPoolUpgradeProfileInner")); + } + if (upgrades() != null) { + upgrades().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ContainerServiceInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ContainerServiceInner.java new file mode 100644 index 0000000000000..6ac918062908a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ContainerServiceInner.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.models.ContainerServiceAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceCustomProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceDiagnosticsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceMasterProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceOrchestratorProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceWindowsProfile; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Container service. */ +@JsonFlatten +@Fluent +public class ContainerServiceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceInner.class); + + /* + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Profile for the container service orchestrator. + */ + @JsonProperty(value = "properties.orchestratorProfile") + private ContainerServiceOrchestratorProfile orchestratorProfile; + + /* + * Properties to configure a custom container service cluster. + */ + @JsonProperty(value = "properties.customProfile") + private ContainerServiceCustomProfile customProfile; + + /* + * Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef + * need to be specified. + */ + @JsonProperty(value = "properties.servicePrincipalProfile") + private ContainerServicePrincipalProfile servicePrincipalProfile; + + /* + * Profile for the container service master. + */ + @JsonProperty(value = "properties.masterProfile") + private ContainerServiceMasterProfile masterProfile; + + /* + * Properties of the agent pool. + */ + @JsonProperty(value = "properties.agentPoolProfiles") + private List agentPoolProfiles; + + /* + * Profile for Windows VMs in the container service cluster. + */ + @JsonProperty(value = "properties.windowsProfile") + private ContainerServiceWindowsProfile windowsProfile; + + /* + * Profile for Linux VMs in the container service cluster. + */ + @JsonProperty(value = "properties.linuxProfile") + private ContainerServiceLinuxProfile linuxProfile; + + /* + * Profile for diagnostics in the container service cluster. + */ + @JsonProperty(value = "properties.diagnosticsProfile") + private ContainerServiceDiagnosticsProfile diagnosticsProfile; + + /** + * Get the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the orchestratorProfile property: Profile for the container service orchestrator. + * + * @return the orchestratorProfile value. + */ + public ContainerServiceOrchestratorProfile orchestratorProfile() { + return this.orchestratorProfile; + } + + /** + * Set the orchestratorProfile property: Profile for the container service orchestrator. + * + * @param orchestratorProfile the orchestratorProfile value to set. + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withOrchestratorProfile(ContainerServiceOrchestratorProfile orchestratorProfile) { + this.orchestratorProfile = orchestratorProfile; + return this; + } + + /** + * Get the customProfile property: Properties to configure a custom container service cluster. + * + * @return the customProfile value. + */ + public ContainerServiceCustomProfile customProfile() { + return this.customProfile; + } + + /** + * Set the customProfile property: Properties to configure a custom container service cluster. + * + * @param customProfile the customProfile value to set. + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withCustomProfile(ContainerServiceCustomProfile customProfile) { + this.customProfile = customProfile; + return this; + } + + /** + * Get the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. + * + * @return the servicePrincipalProfile value. + */ + public ContainerServicePrincipalProfile servicePrincipalProfile() { + return this.servicePrincipalProfile; + } + + /** + * Set the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. + * + * @param servicePrincipalProfile the servicePrincipalProfile value to set. + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withServicePrincipalProfile(ContainerServicePrincipalProfile servicePrincipalProfile) { + this.servicePrincipalProfile = servicePrincipalProfile; + return this; + } + + /** + * Get the masterProfile property: Profile for the container service master. + * + * @return the masterProfile value. + */ + public ContainerServiceMasterProfile masterProfile() { + return this.masterProfile; + } + + /** + * Set the masterProfile property: Profile for the container service master. + * + * @param masterProfile the masterProfile value to set. + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withMasterProfile(ContainerServiceMasterProfile masterProfile) { + this.masterProfile = masterProfile; + return this; + } + + /** + * Get the agentPoolProfiles property: Properties of the agent pool. + * + * @return the agentPoolProfiles value. + */ + public List agentPoolProfiles() { + return this.agentPoolProfiles; + } + + /** + * Set the agentPoolProfiles property: Properties of the agent pool. + * + * @param agentPoolProfiles the agentPoolProfiles value to set. + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withAgentPoolProfiles(List agentPoolProfiles) { + this.agentPoolProfiles = agentPoolProfiles; + return this; + } + + /** + * Get the windowsProfile property: Profile for Windows VMs in the container service cluster. + * + * @return the windowsProfile value. + */ + public ContainerServiceWindowsProfile windowsProfile() { + return this.windowsProfile; + } + + /** + * Set the windowsProfile property: Profile for Windows VMs in the container service cluster. + * + * @param windowsProfile the windowsProfile value to set. + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withWindowsProfile(ContainerServiceWindowsProfile windowsProfile) { + this.windowsProfile = windowsProfile; + return this; + } + + /** + * Get the linuxProfile property: Profile for Linux VMs in the container service cluster. + * + * @return the linuxProfile value. + */ + public ContainerServiceLinuxProfile linuxProfile() { + return this.linuxProfile; + } + + /** + * Set the linuxProfile property: Profile for Linux VMs in the container service cluster. + * + * @param linuxProfile the linuxProfile value to set. + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { + this.linuxProfile = linuxProfile; + return this; + } + + /** + * Get the diagnosticsProfile property: Profile for diagnostics in the container service cluster. + * + * @return the diagnosticsProfile value. + */ + public ContainerServiceDiagnosticsProfile diagnosticsProfile() { + return this.diagnosticsProfile; + } + + /** + * Set the diagnosticsProfile property: Profile for diagnostics in the container service cluster. + * + * @param diagnosticsProfile the diagnosticsProfile value to set. + * @return the ContainerServiceInner object itself. + */ + public ContainerServiceInner withDiagnosticsProfile(ContainerServiceDiagnosticsProfile diagnosticsProfile) { + this.diagnosticsProfile = diagnosticsProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public ContainerServiceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContainerServiceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (orchestratorProfile() != null) { + orchestratorProfile().validate(); + } + if (customProfile() != null) { + customProfile().validate(); + } + if (servicePrincipalProfile() != null) { + servicePrincipalProfile().validate(); + } + if (masterProfile() != null) { + masterProfile().validate(); + } + if (agentPoolProfiles() != null) { + agentPoolProfiles().forEach(e -> e.validate()); + } + if (windowsProfile() != null) { + windowsProfile().validate(); + } + if (linuxProfile() != null) { + linuxProfile().validate(); + } + if (diagnosticsProfile() != null) { + diagnosticsProfile().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CredentialResultsInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CredentialResultsInner.java new file mode 100644 index 0000000000000..9404fdbec634a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CredentialResultsInner.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.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResult; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list credential result response. */ +@Immutable +public final class CredentialResultsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CredentialResultsInner.class); + + /* + * Base64-encoded Kubernetes configuration file. + */ + @JsonProperty(value = "kubeconfigs", access = JsonProperty.Access.WRITE_ONLY) + private List kubeconfigs; + + /** + * Get the kubeconfigs property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeconfigs value. + */ + public List kubeconfigs() { + return this.kubeconfigs; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kubeconfigs() != null) { + kubeconfigs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationInner.java new file mode 100644 index 0000000000000..55c9be785ac27 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about + * planned maintenance. + */ +@JsonFlatten +@Fluent +public class MaintenanceConfigurationInner extends SubResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MaintenanceConfigurationInner.class); + + /* + * The system metadata relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Time slots during the week when planned maintenance is allowed to + * proceed. If two array entries specify the same day of the week, the + * applied configuration is the union of times in both entries. + */ + @JsonProperty(value = "properties.timeInWeek") + private List timeInWeek; + + /* + * Time slots on which upgrade is not allowed. + */ + @JsonProperty(value = "properties.notAllowedTime") + private List notAllowedTime; + + /* + * The name of the resource that is unique within a resource group. This + * name can be used to access the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the timeInWeek property: Time slots during the week when planned maintenance is allowed to proceed. If two + * array entries specify the same day of the week, the applied configuration is the union of times in both entries. + * + * @return the timeInWeek value. + */ + public List timeInWeek() { + return this.timeInWeek; + } + + /** + * Set the timeInWeek property: Time slots during the week when planned maintenance is allowed to proceed. If two + * array entries specify the same day of the week, the applied configuration is the union of times in both entries. + * + * @param timeInWeek the timeInWeek value to set. + * @return the MaintenanceConfigurationInner object itself. + */ + public MaintenanceConfigurationInner withTimeInWeek(List timeInWeek) { + this.timeInWeek = timeInWeek; + return this; + } + + /** + * Get the notAllowedTime property: Time slots on which upgrade is not allowed. + * + * @return the notAllowedTime value. + */ + public List notAllowedTime() { + return this.notAllowedTime; + } + + /** + * Set the notAllowedTime property: Time slots on which upgrade is not allowed. + * + * @param notAllowedTime the notAllowedTime value to set. + * @return the MaintenanceConfigurationInner object itself. + */ + public MaintenanceConfigurationInner withNotAllowedTime(List notAllowedTime) { + this.notAllowedTime = notAllowedTime; + return this; + } + + /** + * Get the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** {@inheritDoc} */ + @Override + public MaintenanceConfigurationInner withId(String id) { + super.withId(id); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timeInWeek() != null) { + timeInWeek().forEach(e -> e.validate()); + } + if (notAllowedTime() != null) { + notAllowedTime().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAccessProfileInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAccessProfileInner.java new file mode 100644 index 0000000000000..f19a547270369 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAccessProfileInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed cluster Access Profile. */ +@JsonFlatten +@Fluent +public class ManagedClusterAccessProfileInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAccessProfileInner.class); + + /* + * Base64-encoded Kubernetes configuration file. + */ + @JsonProperty(value = "properties.kubeConfig") + private byte[] kubeConfig; + + /** + * Get the kubeConfig property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeConfig value. + */ + public byte[] kubeConfig() { + return CoreUtils.clone(this.kubeConfig); + } + + /** + * Set the kubeConfig property: Base64-encoded Kubernetes configuration file. + * + * @param kubeConfig the kubeConfig value to set. + * @return the ManagedClusterAccessProfileInner object itself. + */ + public ManagedClusterAccessProfileInner withKubeConfig(byte[] kubeConfig) { + this.kubeConfig = CoreUtils.clone(kubeConfig); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAccessProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAccessProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterInner.java new file mode 100644 index 0000000000000..b02cb619911a4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterInner.java @@ -0,0 +1,994 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.models.ContainerServiceLinuxProfileAutoGenerated; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.ExtendedLocation; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAadProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAutoUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSku; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.containerservice.generated.models.UserAssignedIdentity; +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. */ +@JsonFlatten +@Fluent +public class ManagedClusterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterInner.class); + + /* + * The managed cluster SKU. + */ + @JsonProperty(value = "sku") + private ManagedClusterSku sku; + + /* + * The extended location of the Virtual Machine. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /* + * The identity of the managed cluster, if configured. + */ + @JsonProperty(value = "identity") + private ManagedClusterIdentity identity; + + /* + * The current provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The Power State of the cluster. + */ + @JsonProperty(value = "properties.powerState", access = JsonProperty.Access.WRITE_ONLY) + private PowerState powerState; + + /* + * The max number of agent pools for the managed cluster. + */ + @JsonProperty(value = "properties.maxAgentPools", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxAgentPools; + + /* + * The version of Kubernetes the Managed Cluster is running. When you + * upgrade a supported AKS cluster, Kubernetes minor versions cannot be + * skipped. All upgrades must be performed sequentially by major version + * number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> + * 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See + * [upgrading an AKS + * cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more + * details. + */ + @JsonProperty(value = "properties.kubernetesVersion") + private String kubernetesVersion; + + /* + * The DNS prefix of the Managed Cluster. This cannot be updated once the + * Managed Cluster has been created. + */ + @JsonProperty(value = "properties.dnsPrefix") + private String dnsPrefix; + + /* + * The FQDN subdomain of the private cluster with custom private dns zone. + * This cannot be updated once the Managed Cluster has been created. + */ + @JsonProperty(value = "properties.fqdnSubdomain") + private String fqdnSubdomain; + + /* + * The FQDN of the master pool. + */ + @JsonProperty(value = "properties.fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The FQDN of private cluster. + */ + @JsonProperty(value = "properties.privateFQDN", access = JsonProperty.Access.WRITE_ONLY) + private String privateFqdn; + + /* + * The special FQDN used by the Azure Portal to access the Managed Cluster. + * This FQDN is for use only by the Azure Portal and should not be used by + * other clients. The Azure Portal requires certain Cross-Origin Resource + * Sharing (CORS) headers to be sent in some responses, which Kubernetes + * APIServer doesn't handle by default. This special FQDN supports CORS, + * allowing the Azure Portal to function properly. + */ + @JsonProperty(value = "properties.azurePortalFQDN", access = JsonProperty.Access.WRITE_ONLY) + private String azurePortalFqdn; + + /* + * The agent pool properties. + */ + @JsonProperty(value = "properties.agentPoolProfiles") + private List agentPoolProfiles; + + /* + * The profile for Linux VMs in the Managed Cluster. + */ + @JsonProperty(value = "properties.linuxProfile") + private ContainerServiceLinuxProfileAutoGenerated linuxProfile; + + /* + * The profile for Windows VMs in the Managed Cluster. + */ + @JsonProperty(value = "properties.windowsProfile") + private ManagedClusterWindowsProfile windowsProfile; + + /* + * Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. + */ + @JsonProperty(value = "properties.servicePrincipalProfile") + private ManagedClusterServicePrincipalProfile servicePrincipalProfile; + + /* + * The profile of managed cluster add-on. + */ + @JsonProperty(value = "properties.addonProfiles") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map addonProfiles; + + /* + * The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) + * for more details on AAD pod identity integration. + */ + @JsonProperty(value = "properties.podIdentityProfile") + private ManagedClusterPodIdentityProfile podIdentityProfile; + + /* + * The name of the resource group containing agent pool nodes. + */ + @JsonProperty(value = "properties.nodeResourceGroup") + private String nodeResourceGroup; + + /* + * Whether to enable Kubernetes Role-Based Access Control. + */ + @JsonProperty(value = "properties.enableRBAC") + private Boolean enableRbac; + + /* + * (DEPRECATING) Whether to enable Kubernetes pod security policy + * (preview). This feature is set for removal on October 15th, 2020. Learn + * more at aka.ms/aks/azpodpolicy. + */ + @JsonProperty(value = "properties.enablePodSecurityPolicy") + private Boolean enablePodSecurityPolicy; + + /* + * The network configuration profile. + */ + @JsonProperty(value = "properties.networkProfile") + private ContainerServiceNetworkProfile networkProfile; + + /* + * AADProfile specifies attributes for Azure Active Directory integration. + * The Azure Active Directory configuration. + */ + @JsonProperty(value = "properties.aadProfile") + private ManagedClusterAadProfile aadProfile; + + /* + * The auto upgrade configuration. + */ + @JsonProperty(value = "properties.autoUpgradeProfile") + private ManagedClusterAutoUpgradeProfile autoUpgradeProfile; + + /* + * Parameters to be applied to the cluster-autoscaler when enabled + */ + @JsonProperty(value = "properties.autoScalerProfile") + private ManagedClusterPropertiesAutoScalerProfile autoScalerProfile; + + /* + * The access profile for managed cluster API server. + */ + @JsonProperty(value = "properties.apiServerAccessProfile") + private ManagedClusterApiServerAccessProfile apiServerAccessProfile; + + /* + * The Resource ID of the disk encryption set to use for enabling + * encryption at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}' + */ + @JsonProperty(value = "properties.diskEncryptionSetID") + private String diskEncryptionSetId; + + /* + * Identities associated with the cluster. + */ + @JsonProperty(value = "properties.identityProfile") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map identityProfile; + + /* + * Private link resources associated with the cluster. + */ + @JsonProperty(value = "properties.privateLinkResources") + private List privateLinkResources; + + /* + * If local accounts should be disabled on the Managed Cluster. If set to + * true, getting static credentials will be disabled for this cluster. This + * must only be used on Managed Clusters that are AAD enabled. For more + * details see [disable local + * accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + */ + @JsonProperty(value = "properties.disableLocalAccounts") + private Boolean disableLocalAccounts; + + /* + * Configurations for provisioning the cluster with HTTP proxy servers. + */ + @JsonProperty(value = "properties.httpProxyConfig") + private ManagedClusterHttpProxyConfig httpProxyConfig; + + /* + * Security profile for the managed cluster. + */ + @JsonProperty(value = "properties.securityProfile") + private ManagedClusterSecurityProfile securityProfile; + + /* + * Whether the cluster can be accessed through public network or not + * Default value is 'Enabled' (case insensitive). Could be set to + * 'Disabled' to enable private cluster + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * Get the sku property: The managed cluster SKU. + * + * @return the sku value. + */ + public ManagedClusterSku sku() { + return this.sku; + } + + /** + * Set the sku property: The managed cluster SKU. + * + * @param sku the sku value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withSku(ManagedClusterSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the extendedLocation property: The extended location of the Virtual Machine. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: The extended location of the Virtual Machine. + * + * @param extendedLocation the extendedLocation value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** + * Get the identity property: The identity of the managed cluster, if configured. + * + * @return the identity value. + */ + public ManagedClusterIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the managed cluster, if configured. + * + * @param identity the identity value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withIdentity(ManagedClusterIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the powerState property: The Power State of the cluster. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.powerState; + } + + /** + * Get the maxAgentPools property: The max number of agent pools for the managed cluster. + * + * @return the maxAgentPools value. + */ + public Integer maxAgentPools() { + return this.maxAgentPools; + } + + /** + * Get the kubernetesVersion property: The version of Kubernetes the Managed Cluster is running. When you upgrade a + * supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially + * by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, + * however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS + * cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Set the kubernetesVersion property: The version of Kubernetes the Managed Cluster is running. When you upgrade a + * supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially + * by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, + * however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS + * cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. + * + * @param kubernetesVersion the kubernetesVersion value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withKubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + return this; + } + + /** + * Get the dnsPrefix property: The DNS prefix of the Managed Cluster. This cannot be updated once the Managed + * Cluster has been created. + * + * @return the dnsPrefix value. + */ + public String dnsPrefix() { + return this.dnsPrefix; + } + + /** + * Set the dnsPrefix property: The DNS prefix of the Managed Cluster. This cannot be updated once the Managed + * Cluster has been created. + * + * @param dnsPrefix the dnsPrefix value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withDnsPrefix(String dnsPrefix) { + this.dnsPrefix = dnsPrefix; + return this; + } + + /** + * Get the fqdnSubdomain property: The FQDN subdomain of the private cluster with custom private dns zone. This + * cannot be updated once the Managed Cluster has been created. + * + * @return the fqdnSubdomain value. + */ + public String fqdnSubdomain() { + return this.fqdnSubdomain; + } + + /** + * Set the fqdnSubdomain property: The FQDN subdomain of the private cluster with custom private dns zone. This + * cannot be updated once the Managed Cluster has been created. + * + * @param fqdnSubdomain the fqdnSubdomain value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withFqdnSubdomain(String fqdnSubdomain) { + this.fqdnSubdomain = fqdnSubdomain; + return this; + } + + /** + * Get the fqdn property: The FQDN of the master pool. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the privateFqdn property: The FQDN of private cluster. + * + * @return the privateFqdn value. + */ + public String privateFqdn() { + return this.privateFqdn; + } + + /** + * Get the azurePortalFqdn property: The special FQDN used by the Azure Portal to access the Managed Cluster. This + * FQDN is for use only by the Azure Portal and should not be used by other clients. The Azure Portal requires + * certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer + * doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. + * + * @return the azurePortalFqdn value. + */ + public String azurePortalFqdn() { + return this.azurePortalFqdn; + } + + /** + * Get the agentPoolProfiles property: The agent pool properties. + * + * @return the agentPoolProfiles value. + */ + public List agentPoolProfiles() { + return this.agentPoolProfiles; + } + + /** + * Set the agentPoolProfiles property: The agent pool properties. + * + * @param agentPoolProfiles the agentPoolProfiles value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAgentPoolProfiles(List agentPoolProfiles) { + this.agentPoolProfiles = agentPoolProfiles; + return this; + } + + /** + * Get the linuxProfile property: The profile for Linux VMs in the Managed Cluster. + * + * @return the linuxProfile value. + */ + public ContainerServiceLinuxProfileAutoGenerated linuxProfile() { + return this.linuxProfile; + } + + /** + * Set the linuxProfile property: The profile for Linux VMs in the Managed Cluster. + * + * @param linuxProfile the linuxProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withLinuxProfile(ContainerServiceLinuxProfileAutoGenerated linuxProfile) { + this.linuxProfile = linuxProfile; + return this; + } + + /** + * Get the windowsProfile property: The profile for Windows VMs in the Managed Cluster. + * + * @return the windowsProfile value. + */ + public ManagedClusterWindowsProfile windowsProfile() { + return this.windowsProfile; + } + + /** + * Set the windowsProfile property: The profile for Windows VMs in the Managed Cluster. + * + * @param windowsProfile the windowsProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withWindowsProfile(ManagedClusterWindowsProfile windowsProfile) { + this.windowsProfile = windowsProfile; + return this; + } + + /** + * Get the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. + * + * @return the servicePrincipalProfile value. + */ + public ManagedClusterServicePrincipalProfile servicePrincipalProfile() { + return this.servicePrincipalProfile; + } + + /** + * Set the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. + * + * @param servicePrincipalProfile the servicePrincipalProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withServicePrincipalProfile( + ManagedClusterServicePrincipalProfile servicePrincipalProfile) { + this.servicePrincipalProfile = servicePrincipalProfile; + return this; + } + + /** + * Get the addonProfiles property: The profile of managed cluster add-on. + * + * @return the addonProfiles value. + */ + public Map addonProfiles() { + return this.addonProfiles; + } + + /** + * Set the addonProfiles property: The profile of managed cluster add-on. + * + * @param addonProfiles the addonProfiles value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAddonProfiles(Map addonProfiles) { + this.addonProfiles = addonProfiles; + return this; + } + + /** + * Get the podIdentityProfile property: The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity + * integration. + * + * @return the podIdentityProfile value. + */ + public ManagedClusterPodIdentityProfile podIdentityProfile() { + return this.podIdentityProfile; + } + + /** + * Set the podIdentityProfile property: The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity + * integration. + * + * @param podIdentityProfile the podIdentityProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile) { + this.podIdentityProfile = podIdentityProfile; + return this; + } + + /** + * Get the nodeResourceGroup property: The name of the resource group containing agent pool nodes. + * + * @return the nodeResourceGroup value. + */ + public String nodeResourceGroup() { + return this.nodeResourceGroup; + } + + /** + * Set the nodeResourceGroup property: The name of the resource group containing agent pool nodes. + * + * @param nodeResourceGroup the nodeResourceGroup value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withNodeResourceGroup(String nodeResourceGroup) { + this.nodeResourceGroup = nodeResourceGroup; + return this; + } + + /** + * Get the enableRbac property: Whether to enable Kubernetes Role-Based Access Control. + * + * @return the enableRbac value. + */ + public Boolean enableRbac() { + return this.enableRbac; + } + + /** + * Set the enableRbac property: Whether to enable Kubernetes Role-Based Access Control. + * + * @param enableRbac the enableRbac value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withEnableRbac(Boolean enableRbac) { + this.enableRbac = enableRbac; + return this; + } + + /** + * Get the enablePodSecurityPolicy property: (DEPRECATING) Whether to enable Kubernetes pod security policy + * (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. + * + * @return the enablePodSecurityPolicy value. + */ + public Boolean enablePodSecurityPolicy() { + return this.enablePodSecurityPolicy; + } + + /** + * Set the enablePodSecurityPolicy property: (DEPRECATING) Whether to enable Kubernetes pod security policy + * (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. + * + * @param enablePodSecurityPolicy the enablePodSecurityPolicy value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withEnablePodSecurityPolicy(Boolean enablePodSecurityPolicy) { + this.enablePodSecurityPolicy = enablePodSecurityPolicy; + return this; + } + + /** + * Get the networkProfile property: The network configuration profile. + * + * @return the networkProfile value. + */ + public ContainerServiceNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: The network configuration profile. + * + * @param networkProfile the networkProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withNetworkProfile(ContainerServiceNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the aadProfile property: AADProfile specifies attributes for Azure Active Directory integration. The Azure + * Active Directory configuration. + * + * @return the aadProfile value. + */ + public ManagedClusterAadProfile aadProfile() { + return this.aadProfile; + } + + /** + * Set the aadProfile property: AADProfile specifies attributes for Azure Active Directory integration. The Azure + * Active Directory configuration. + * + * @param aadProfile the aadProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAadProfile(ManagedClusterAadProfile aadProfile) { + this.aadProfile = aadProfile; + return this; + } + + /** + * Get the autoUpgradeProfile property: The auto upgrade configuration. + * + * @return the autoUpgradeProfile value. + */ + public ManagedClusterAutoUpgradeProfile autoUpgradeProfile() { + return this.autoUpgradeProfile; + } + + /** + * Set the autoUpgradeProfile property: The auto upgrade configuration. + * + * @param autoUpgradeProfile the autoUpgradeProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile) { + this.autoUpgradeProfile = autoUpgradeProfile; + return this; + } + + /** + * Get the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. + * + * @return the autoScalerProfile value. + */ + public ManagedClusterPropertiesAutoScalerProfile autoScalerProfile() { + return this.autoScalerProfile; + } + + /** + * Set the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. + * + * @param autoScalerProfile the autoScalerProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile) { + this.autoScalerProfile = autoScalerProfile; + return this; + } + + /** + * Get the apiServerAccessProfile property: The access profile for managed cluster API server. + * + * @return the apiServerAccessProfile value. + */ + public ManagedClusterApiServerAccessProfile apiServerAccessProfile() { + return this.apiServerAccessProfile; + } + + /** + * Set the apiServerAccessProfile property: The access profile for managed cluster API server. + * + * @param apiServerAccessProfile the apiServerAccessProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withApiServerAccessProfile(ManagedClusterApiServerAccessProfile apiServerAccessProfile) { + this.apiServerAccessProfile = apiServerAccessProfile; + return this; + } + + /** + * Get the diskEncryptionSetId property: The Resource ID of the disk encryption set to use for enabling encryption + * at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * + * @return the diskEncryptionSetId value. + */ + public String diskEncryptionSetId() { + return this.diskEncryptionSetId; + } + + /** + * Set the diskEncryptionSetId property: The Resource ID of the disk encryption set to use for enabling encryption + * at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * + * @param diskEncryptionSetId the diskEncryptionSetId value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withDiskEncryptionSetId(String diskEncryptionSetId) { + this.diskEncryptionSetId = diskEncryptionSetId; + return this; + } + + /** + * Get the identityProfile property: Identities associated with the cluster. + * + * @return the identityProfile value. + */ + public Map identityProfile() { + return this.identityProfile; + } + + /** + * Set the identityProfile property: Identities associated with the cluster. + * + * @param identityProfile the identityProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withIdentityProfile(Map identityProfile) { + this.identityProfile = identityProfile; + return this; + } + + /** + * Get the privateLinkResources property: Private link resources associated with the cluster. + * + * @return the privateLinkResources value. + */ + public List privateLinkResources() { + return this.privateLinkResources; + } + + /** + * Set the privateLinkResources property: Private link resources associated with the cluster. + * + * @param privateLinkResources the privateLinkResources value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withPrivateLinkResources(List privateLinkResources) { + this.privateLinkResources = privateLinkResources; + return this; + } + + /** + * Get the disableLocalAccounts property: If local accounts should be disabled on the Managed Cluster. If set to + * true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters + * that are AAD enabled. For more details see [disable local + * accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + * + * @return the disableLocalAccounts value. + */ + public Boolean disableLocalAccounts() { + return this.disableLocalAccounts; + } + + /** + * Set the disableLocalAccounts property: If local accounts should be disabled on the Managed Cluster. If set to + * true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters + * that are AAD enabled. For more details see [disable local + * accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + * + * @param disableLocalAccounts the disableLocalAccounts value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withDisableLocalAccounts(Boolean disableLocalAccounts) { + this.disableLocalAccounts = disableLocalAccounts; + return this; + } + + /** + * Get the httpProxyConfig property: Configurations for provisioning the cluster with HTTP proxy servers. + * + * @return the httpProxyConfig value. + */ + public ManagedClusterHttpProxyConfig httpProxyConfig() { + return this.httpProxyConfig; + } + + /** + * Set the httpProxyConfig property: Configurations for provisioning the cluster with HTTP proxy servers. + * + * @param httpProxyConfig the httpProxyConfig value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withHttpProxyConfig(ManagedClusterHttpProxyConfig httpProxyConfig) { + this.httpProxyConfig = httpProxyConfig; + return this; + } + + /** + * Get the securityProfile property: Security profile for the managed cluster. + * + * @return the securityProfile value. + */ + public ManagedClusterSecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: Security profile for the managed cluster. + * + * @param securityProfile the securityProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withSecurityProfile(ManagedClusterSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the publicNetworkAccess property: Whether the cluster can be accessed through public network or not Default + * value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private cluster. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether the cluster can be accessed through public network or not Default + * value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private cluster. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** {@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 (extendedLocation() != null) { + extendedLocation().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (powerState() != null) { + powerState().validate(); + } + if (agentPoolProfiles() != null) { + agentPoolProfiles().forEach(e -> e.validate()); + } + if (linuxProfile() != null) { + linuxProfile().validate(); + } + if (windowsProfile() != null) { + windowsProfile().validate(); + } + if (servicePrincipalProfile() != null) { + servicePrincipalProfile().validate(); + } + if (addonProfiles() != null) { + addonProfiles() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (podIdentityProfile() != null) { + podIdentityProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (aadProfile() != null) { + aadProfile().validate(); + } + if (autoUpgradeProfile() != null) { + autoUpgradeProfile().validate(); + } + if (autoScalerProfile() != null) { + autoScalerProfile().validate(); + } + if (apiServerAccessProfile() != null) { + apiServerAccessProfile().validate(); + } + if (identityProfile() != null) { + identityProfile() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (privateLinkResources() != null) { + privateLinkResources().forEach(e -> e.validate()); + } + if (httpProxyConfig() != null) { + httpProxyConfig().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileInner.java new file mode 100644 index 0000000000000..afa11d5e57361 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileInner.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.models.ManagedClusterPoolUpgradeProfile; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of available upgrades for compute pools. */ +@JsonFlatten +@Fluent +public class ManagedClusterUpgradeProfileInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterUpgradeProfileInner.class); + + /* + * The ID of the upgrade profile. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The name of the upgrade profile. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The type of the upgrade profile. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The list of available upgrade versions for the control plane. + */ + @JsonProperty(value = "properties.controlPlaneProfile", required = true) + private ManagedClusterPoolUpgradeProfile controlPlaneProfile; + + /* + * The list of available upgrade versions for agent pools. + */ + @JsonProperty(value = "properties.agentPoolProfiles", required = true) + private List agentPoolProfiles; + + /** + * Get the id property: The ID of the upgrade profile. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the upgrade profile. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the upgrade profile. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the controlPlaneProfile property: The list of available upgrade versions for the control plane. + * + * @return the controlPlaneProfile value. + */ + public ManagedClusterPoolUpgradeProfile controlPlaneProfile() { + return this.controlPlaneProfile; + } + + /** + * Set the controlPlaneProfile property: The list of available upgrade versions for the control plane. + * + * @param controlPlaneProfile the controlPlaneProfile value to set. + * @return the ManagedClusterUpgradeProfileInner object itself. + */ + public ManagedClusterUpgradeProfileInner withControlPlaneProfile( + ManagedClusterPoolUpgradeProfile controlPlaneProfile) { + this.controlPlaneProfile = controlPlaneProfile; + return this; + } + + /** + * Get the agentPoolProfiles property: The list of available upgrade versions for agent pools. + * + * @return the agentPoolProfiles value. + */ + public List agentPoolProfiles() { + return this.agentPoolProfiles; + } + + /** + * Set the agentPoolProfiles property: The list of available upgrade versions for agent pools. + * + * @param agentPoolProfiles the agentPoolProfiles value to set. + * @return the ManagedClusterUpgradeProfileInner object itself. + */ + public ManagedClusterUpgradeProfileInner withAgentPoolProfiles( + List agentPoolProfiles) { + this.agentPoolProfiles = agentPoolProfiles; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (controlPlaneProfile() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property controlPlaneProfile in model ManagedClusterUpgradeProfileInner")); + } else { + controlPlaneProfile().validate(); + } + if (agentPoolProfiles() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property agentPoolProfiles in model ManagedClusterUpgradeProfileInner")); + } else { + agentPoolProfiles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OSOptionProfileInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OSOptionProfileInner.java new file mode 100644 index 0000000000000..644f51d80fdce --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OSOptionProfileInner.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.models.OSOptionProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The OS option profile. */ +@JsonFlatten +@Fluent +public class OSOptionProfileInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSOptionProfileInner.class); + + /* + * The ID of the OS option resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The name of the OS option resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The type of the OS option resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The list of OS options. + */ + @JsonProperty(value = "properties.osOptionPropertyList", required = true) + private List osOptionPropertyList; + + /** + * Get the id property: The ID of the OS option resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the OS option resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the OS option resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the osOptionPropertyList property: The list of OS options. + * + * @return the osOptionPropertyList value. + */ + public List osOptionPropertyList() { + return this.osOptionPropertyList; + } + + /** + * Set the osOptionPropertyList property: The list of OS options. + * + * @param osOptionPropertyList the osOptionPropertyList value to set. + * @return the OSOptionProfileInner object itself. + */ + public OSOptionProfileInner withOsOptionPropertyList(List osOptionPropertyList) { + this.osOptionPropertyList = osOptionPropertyList; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osOptionPropertyList() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osOptionPropertyList in model OSOptionProfileInner")); + } else { + osOptionPropertyList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OpenShiftManagedClusterInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OpenShiftManagedClusterInner.java new file mode 100644 index 0000000000000..2d187a9ba5d01 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OpenShiftManagedClusterInner.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.models.NetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterAuthProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterMasterPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftRouterProfile; +import com.azure.resourcemanager.containerservice.generated.models.PurchasePlan; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** OpenShift Managed cluster. */ +@JsonFlatten +@Fluent +public class OpenShiftManagedClusterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterInner.class); + + /* + * Define the resource plan as required by ARM for billing purposes + */ + @JsonProperty(value = "plan") + private PurchasePlan plan; + + /* + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Version of OpenShift specified when creating the cluster. + */ + @JsonProperty(value = "properties.openShiftVersion") + private String openShiftVersion; + + /* + * Version of OpenShift specified when creating the cluster. + */ + @JsonProperty(value = "properties.clusterVersion", access = JsonProperty.Access.WRITE_ONLY) + private String clusterVersion; + + /* + * Service generated FQDN for OpenShift API server. + */ + @JsonProperty(value = "properties.publicHostname", access = JsonProperty.Access.WRITE_ONLY) + private String publicHostname; + + /* + * Service generated FQDN for OpenShift API server loadbalancer internal + * hostname. + */ + @JsonProperty(value = "properties.fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * Configuration for OpenShift networking. + */ + @JsonProperty(value = "properties.networkProfile") + private NetworkProfile networkProfile; + + /* + * Configuration for OpenShift router(s). + */ + @JsonProperty(value = "properties.routerProfiles") + private List routerProfiles; + + /* + * Configuration for OpenShift master VMs. + */ + @JsonProperty(value = "properties.masterPoolProfile") + private OpenShiftManagedClusterMasterPoolProfile masterPoolProfile; + + /* + * Configuration of OpenShift cluster VMs. + */ + @JsonProperty(value = "properties.agentPoolProfiles") + private List agentPoolProfiles; + + /* + * Configures OpenShift authentication. + */ + @JsonProperty(value = "properties.authProfile") + private OpenShiftManagedClusterAuthProfile authProfile; + + /** + * Get the plan property: Define the resource plan as required by ARM for billing purposes. + * + * @return the plan value. + */ + public PurchasePlan plan() { + return this.plan; + } + + /** + * Set the plan property: Define the resource plan as required by ARM for billing purposes. + * + * @param plan the plan value to set. + * @return the OpenShiftManagedClusterInner object itself. + */ + public OpenShiftManagedClusterInner withPlan(PurchasePlan plan) { + this.plan = plan; + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the openShiftVersion property: Version of OpenShift specified when creating the cluster. + * + * @return the openShiftVersion value. + */ + public String openShiftVersion() { + return this.openShiftVersion; + } + + /** + * Set the openShiftVersion property: Version of OpenShift specified when creating the cluster. + * + * @param openShiftVersion the openShiftVersion value to set. + * @return the OpenShiftManagedClusterInner object itself. + */ + public OpenShiftManagedClusterInner withOpenShiftVersion(String openShiftVersion) { + this.openShiftVersion = openShiftVersion; + return this; + } + + /** + * Get the clusterVersion property: Version of OpenShift specified when creating the cluster. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Get the publicHostname property: Service generated FQDN for OpenShift API server. + * + * @return the publicHostname value. + */ + public String publicHostname() { + return this.publicHostname; + } + + /** + * Get the fqdn property: Service generated FQDN for OpenShift API server loadbalancer internal hostname. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the networkProfile property: Configuration for OpenShift networking. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Configuration for OpenShift networking. + * + * @param networkProfile the networkProfile value to set. + * @return the OpenShiftManagedClusterInner object itself. + */ + public OpenShiftManagedClusterInner withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the routerProfiles property: Configuration for OpenShift router(s). + * + * @return the routerProfiles value. + */ + public List routerProfiles() { + return this.routerProfiles; + } + + /** + * Set the routerProfiles property: Configuration for OpenShift router(s). + * + * @param routerProfiles the routerProfiles value to set. + * @return the OpenShiftManagedClusterInner object itself. + */ + public OpenShiftManagedClusterInner withRouterProfiles(List routerProfiles) { + this.routerProfiles = routerProfiles; + return this; + } + + /** + * Get the masterPoolProfile property: Configuration for OpenShift master VMs. + * + * @return the masterPoolProfile value. + */ + public OpenShiftManagedClusterMasterPoolProfile masterPoolProfile() { + return this.masterPoolProfile; + } + + /** + * Set the masterPoolProfile property: Configuration for OpenShift master VMs. + * + * @param masterPoolProfile the masterPoolProfile value to set. + * @return the OpenShiftManagedClusterInner object itself. + */ + public OpenShiftManagedClusterInner withMasterPoolProfile( + OpenShiftManagedClusterMasterPoolProfile masterPoolProfile) { + this.masterPoolProfile = masterPoolProfile; + return this; + } + + /** + * Get the agentPoolProfiles property: Configuration of OpenShift cluster VMs. + * + * @return the agentPoolProfiles value. + */ + public List agentPoolProfiles() { + return this.agentPoolProfiles; + } + + /** + * Set the agentPoolProfiles property: Configuration of OpenShift cluster VMs. + * + * @param agentPoolProfiles the agentPoolProfiles value to set. + * @return the OpenShiftManagedClusterInner object itself. + */ + public OpenShiftManagedClusterInner withAgentPoolProfiles( + List agentPoolProfiles) { + this.agentPoolProfiles = agentPoolProfiles; + return this; + } + + /** + * Get the authProfile property: Configures OpenShift authentication. + * + * @return the authProfile value. + */ + public OpenShiftManagedClusterAuthProfile authProfile() { + return this.authProfile; + } + + /** + * Set the authProfile property: Configures OpenShift authentication. + * + * @param authProfile the authProfile value to set. + * @return the OpenShiftManagedClusterInner object itself. + */ + public OpenShiftManagedClusterInner withAuthProfile(OpenShiftManagedClusterAuthProfile authProfile) { + this.authProfile = authProfile; + return this; + } + + /** {@inheritDoc} */ + @Override + public OpenShiftManagedClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public OpenShiftManagedClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (plan() != null) { + plan().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (routerProfiles() != null) { + routerProfiles().forEach(e -> e.validate()); + } + if (masterPoolProfile() != null) { + masterPoolProfile().validate(); + } + if (agentPoolProfiles() != null) { + agentPoolProfiles().forEach(e -> e.validate()); + } + if (authProfile() != null) { + authProfile().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueInner.java new file mode 100644 index 0000000000000..f26c98d40ec72 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueInner.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +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; + +/** Describes the properties of a Operation value. */ +@JsonFlatten +@Immutable +public class OperationValueInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationValueInner.class); + + /* + * The origin of the operation. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /* + * The name of the operation. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The display name of the operation. + */ + @JsonProperty(value = "display.operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The display name of the resource the operation applies to. + */ + @JsonProperty(value = "display.resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The description of the operation. + */ + @JsonProperty(value = "display.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The resource provider for the operation. + */ + @JsonProperty(value = "display.provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Get the origin property: The origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Get the name property: The name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the operation property: The display name of the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OrchestratorVersionProfileListResultInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OrchestratorVersionProfileListResultInner.java new file mode 100644 index 0000000000000..a548ebd87e8ac --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OrchestratorVersionProfileListResultInner.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.models.OrchestratorVersionProfile; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of versions for supported orchestrators. */ +@JsonFlatten +@Fluent +public class OrchestratorVersionProfileListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorVersionProfileListResultInner.class); + + /* + * Id of the orchestrator version profile list result. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Name of the orchestrator version profile list result. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Type of the orchestrator version profile list result. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * List of orchestrator version profiles. + */ + @JsonProperty(value = "properties.orchestrators", required = true) + private List orchestrators; + + /** + * Get the id property: Id of the orchestrator version profile list result. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the orchestrator version profile list result. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Type of the orchestrator version profile list result. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the orchestrators property: List of orchestrator version profiles. + * + * @return the orchestrators value. + */ + public List orchestrators() { + return this.orchestrators; + } + + /** + * Set the orchestrators property: List of orchestrator version profiles. + * + * @param orchestrators the orchestrators value to set. + * @return the OrchestratorVersionProfileListResultInner object itself. + */ + public OrchestratorVersionProfileListResultInner withOrchestrators(List orchestrators) { + this.orchestrators = orchestrators; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (orchestrators() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property orchestrators in model OrchestratorVersionProfileListResultInner")); + } else { + orchestrators().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OutboundEnvironmentEndpointInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OutboundEnvironmentEndpointInner.java new file mode 100644 index 0000000000000..049b8e53f395b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OutboundEnvironmentEndpointInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.models.EndpointDependency; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Egress endpoints which AKS agent nodes connect to for common purpose. */ +@Fluent +public final class OutboundEnvironmentEndpointInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundEnvironmentEndpointInner.class); + + /* + * The category of endpoints accessed by the AKS agent node, e.g. + * azure-resource-management, apiserver, etc. + */ + @JsonProperty(value = "category") + private String category; + + /* + * The endpoints that AKS agent nodes connect to + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /** + * Get the category property: The category of endpoints accessed by the AKS agent node, e.g. + * azure-resource-management, apiserver, etc. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: The category of endpoints accessed by the AKS agent node, e.g. + * azure-resource-management, apiserver, etc. + * + * @param category the category value to set. + * @return the OutboundEnvironmentEndpointInner object itself. + */ + public OutboundEnvironmentEndpointInner withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the endpoints property: The endpoints that AKS agent nodes connect to. + * + * @return the endpoints value. + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints property: The endpoints that AKS agent nodes connect to. + * + * @param endpoints the endpoints value to set. + * @return the OutboundEnvironmentEndpointInner object itself. + */ + public OutboundEnvironmentEndpointInner withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoints() != null) { + endpoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..1954dc5d33cad --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A private endpoint connection. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * The current provisioning state. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /* + * The resource of private endpoint. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Get the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private endpoint. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionListResultInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionListResultInner.java new file mode 100644 index 0000000000000..c822c4f716f13 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionListResultInner.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.containerservice.generated.fluent.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; + +/** A list of private endpoint connections. */ +@Fluent +public final class PrivateEndpointConnectionListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionListResultInner.class); + + /* + * The collection value. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The collection value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection value. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResultInner object itself. + */ + public PrivateEndpointConnectionListResultInner withValue(List value) { + this.value = value; + 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourceInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..63c222971bf0c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourceInner.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.containerservice.generated.fluent.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; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResourceInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); + + /* + * The ID of the private link resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the private link resource. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The group ID of the resource. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /* + * The RequiredMembers of the resource + */ + @JsonProperty(value = "requiredMembers") + private List requiredMembers; + + /* + * The private link service ID of the resource, this field is exposed only + * to NRP internally. + */ + @JsonProperty(value = "privateLinkServiceID", access = JsonProperty.Access.WRITE_ONLY) + private String privateLinkServiceId; + + /** + * Get the id property: The ID of the private link resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the private link resource. + * + * @param id the id value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the private link resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the private link resource. + * + * @param name the name value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type. + * + * @param type the type value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the groupId property: The group ID of the resource. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The group ID of the resource. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requiredMembers property: The RequiredMembers of the resource. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers property: The RequiredMembers of the resource. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the privateLinkServiceId property: The private link service ID of the resource, this field is exposed only to + * NRP internally. + * + * @return the privateLinkServiceId value. + */ + public String privateLinkServiceId() { + return this.privateLinkServiceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourcesListResultInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourcesListResultInner.java new file mode 100644 index 0000000000000..98787f879dc4f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourcesListResultInner.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.containerservice.generated.fluent.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; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourcesListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesListResultInner.class); + + /* + * The collection value. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The collection value. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The collection value. + * + * @param value the value value to set. + * @return the PrivateLinkResourcesListResultInner object itself. + */ + public PrivateLinkResourcesListResultInner withValue(List value) { + this.value = value; + 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/RunCommandResultInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/RunCommandResultInner.java new file mode 100644 index 0000000000000..49634d4463c0d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/RunCommandResultInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +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.time.OffsetDateTime; + +/** run command result. */ +@JsonFlatten +@Immutable +public class RunCommandResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandResultInner.class); + + /* + * The command id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * provisioning State + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The exit code of the command + */ + @JsonProperty(value = "properties.exitCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer exitCode; + + /* + * The time when the command started. + */ + @JsonProperty(value = "properties.startedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedAt; + + /* + * The time when the command finished. + */ + @JsonProperty(value = "properties.finishedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime finishedAt; + + /* + * The command output. + */ + @JsonProperty(value = "properties.logs", access = JsonProperty.Access.WRITE_ONLY) + private String logs; + + /* + * An explanation of why provisioningState is set to failed (if so). + */ + @JsonProperty(value = "properties.reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * Get the id property: The command id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the exitCode property: The exit code of the command. + * + * @return the exitCode value. + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Get the startedAt property: The time when the command started. + * + * @return the startedAt value. + */ + public OffsetDateTime startedAt() { + return this.startedAt; + } + + /** + * Get the finishedAt property: The time when the command finished. + * + * @return the finishedAt value. + */ + public OffsetDateTime finishedAt() { + return this.finishedAt; + } + + /** + * Get the logs property: The command output. + * + * @return the logs value. + */ + public String logs() { + return this.logs; + } + + /** + * Get the reason property: An explanation of why provisioningState is set to failed (if so). + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotInner.java new file mode 100644 index 0000000000000..ad653b48c6000 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotInner.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.containerservice.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A node pool snapshot resource. */ +@JsonFlatten +@Fluent +public class SnapshotInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotInner.class); + + /* + * The system metadata relating to this snapshot. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * CreationData to be used to specify the source agent pool resource ID to + * create this snapshot. + */ + @JsonProperty(value = "properties.creationData") + private CreationData creationData; + + /* + * The type of a snapshot. The default is NodePool. + */ + @JsonProperty(value = "properties.snapshotType") + private SnapshotType snapshotType; + + /** + * Get the systemData property: The system metadata relating to this snapshot. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the creationData property: CreationData to be used to specify the source agent pool resource ID to create + * this snapshot. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.creationData; + } + + /** + * Set the creationData property: CreationData to be used to specify the source agent pool resource ID to create + * this snapshot. + * + * @param creationData the creationData value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withCreationData(CreationData creationData) { + this.creationData = creationData; + return this; + } + + /** + * Get the snapshotType property: The type of a snapshot. The default is NodePool. + * + * @return the snapshotType value. + */ + public SnapshotType snapshotType() { + return this.snapshotType; + } + + /** + * Set the snapshotType property: The type of a snapshot. The default is NodePool. + * + * @param snapshotType the snapshotType value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withSnapshotType(SnapshotType snapshotType) { + this.snapshotType = snapshotType; + return this; + } + + /** {@inheritDoc} */ + @Override + public SnapshotInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SnapshotInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (creationData() != null) { + creationData().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/package-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..e6d443bef7d93 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for ContainerServiceManagementClient. Container Service Client. */ +package com.azure.resourcemanager.containerservice.generated.fluent.models; diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/package-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/package-info.java new file mode 100644 index 0000000000000..383b8e3c63277 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for ContainerServiceManagementClient. Container Service Client. */ +package com.azure.resourcemanager.containerservice.generated.fluent; diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolAvailableVersionsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolAvailableVersionsImpl.java new file mode 100644 index 0000000000000..57d97bd1c377a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolAvailableVersionsImpl.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.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersions; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; +import java.util.Collections; +import java.util.List; + +public final class AgentPoolAvailableVersionsImpl implements AgentPoolAvailableVersions { + private AgentPoolAvailableVersionsInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + AgentPoolAvailableVersionsImpl( + AgentPoolAvailableVersionsInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List agentPoolVersions() { + List inner = this.innerModel().agentPoolVersions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AgentPoolAvailableVersionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolImpl.java new file mode 100644 index 0000000000000..7ec05abcf5d17 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolImpl.java @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerservice.generated.models.AgentPool; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeSettings; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.GpuInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.KubeletConfig; +import com.azure.resourcemanager.containerservice.generated.models.KubeletDiskType; +import com.azure.resourcemanager.containerservice.generated.models.LinuxOSConfig; +import com.azure.resourcemanager.containerservice.generated.models.OSDiskType; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.Ossku; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.ScaleDownMode; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetEvictionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetPriority; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class AgentPoolImpl implements AgentPool, AgentPool.Definition, AgentPool.Update { + private AgentPoolInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public Integer count() { + return this.innerModel().count(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public Integer osDiskSizeGB() { + return this.innerModel().osDiskSizeGB(); + } + + public OSDiskType osDiskType() { + return this.innerModel().osDiskType(); + } + + public KubeletDiskType kubeletDiskType() { + return this.innerModel().kubeletDiskType(); + } + + public String vnetSubnetId() { + return this.innerModel().vnetSubnetId(); + } + + public String podSubnetId() { + return this.innerModel().podSubnetId(); + } + + public Integer maxPods() { + return this.innerModel().maxPods(); + } + + public OSType osType() { + return this.innerModel().osType(); + } + + public Ossku osSku() { + return this.innerModel().osSku(); + } + + public Integer maxCount() { + return this.innerModel().maxCount(); + } + + public Integer minCount() { + return this.innerModel().minCount(); + } + + public Boolean enableAutoScaling() { + return this.innerModel().enableAutoScaling(); + } + + public ScaleDownMode scaleDownMode() { + return this.innerModel().scaleDownMode(); + } + + public AgentPoolType typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public AgentPoolMode mode() { + return this.innerModel().mode(); + } + + public String orchestratorVersion() { + return this.innerModel().orchestratorVersion(); + } + + public String nodeImageVersion() { + return this.innerModel().nodeImageVersion(); + } + + public AgentPoolUpgradeSettings upgradeSettings() { + return this.innerModel().upgradeSettings(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public PowerState powerState() { + return this.innerModel().powerState(); + } + + public List availabilityZones() { + List inner = this.innerModel().availabilityZones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean enableNodePublicIp() { + return this.innerModel().enableNodePublicIp(); + } + + public String nodePublicIpPrefixId() { + return this.innerModel().nodePublicIpPrefixId(); + } + + public ScaleSetPriority scaleSetPriority() { + return this.innerModel().scaleSetPriority(); + } + + public ScaleSetEvictionPolicy scaleSetEvictionPolicy() { + return this.innerModel().scaleSetEvictionPolicy(); + } + + public Float spotMaxPrice() { + return this.innerModel().spotMaxPrice(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map nodeLabels() { + Map inner = this.innerModel().nodeLabels(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List nodeTaints() { + List inner = this.innerModel().nodeTaints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String proximityPlacementGroupId() { + return this.innerModel().proximityPlacementGroupId(); + } + + public KubeletConfig kubeletConfig() { + return this.innerModel().kubeletConfig(); + } + + public LinuxOSConfig linuxOSConfig() { + return this.innerModel().linuxOSConfig(); + } + + public Boolean enableEncryptionAtHost() { + return this.innerModel().enableEncryptionAtHost(); + } + + public Boolean enableUltraSsd() { + return this.innerModel().enableUltraSsd(); + } + + public Boolean enableFips() { + return this.innerModel().enableFips(); + } + + public GpuInstanceProfile gpuInstanceProfile() { + return this.innerModel().gpuInstanceProfile(); + } + + public CreationData creationData() { + return this.innerModel().creationData(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AgentPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String agentPoolName; + + public AgentPoolImpl withExistingManagedCluster(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public AgentPool create() { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), Context.NONE); + return this; + } + + public AgentPool create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), context); + return this; + } + + AgentPoolImpl( + String name, com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new AgentPoolInner(); + this.serviceManager = serviceManager; + this.agentPoolName = name; + } + + public AgentPoolImpl update() { + return this; + } + + public AgentPool apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), Context.NONE); + return this; + } + + public AgentPool apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .createOrUpdate(resourceGroupName, resourceName, agentPoolName, this.innerModel(), context); + return this; + } + + AgentPoolImpl( + AgentPoolInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "managedClusters"); + this.agentPoolName = Utils.getValueFromIdByName(innerObject.id(), "agentPools"); + } + + public AgentPool refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .getWithResponse(resourceGroupName, resourceName, agentPoolName, Context.NONE) + .getValue(); + return this; + } + + public AgentPool refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAgentPools() + .getWithResponse(resourceGroupName, resourceName, agentPoolName, context) + .getValue(); + return this; + } + + public AgentPool upgradeNodeImageVersion() { + return serviceManager.agentPools().upgradeNodeImageVersion(resourceGroupName, resourceName, agentPoolName); + } + + public AgentPool upgradeNodeImageVersion(Context context) { + return serviceManager + .agentPools() + .upgradeNodeImageVersion(resourceGroupName, resourceName, agentPoolName, context); + } + + public AgentPoolImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public AgentPoolImpl withCount(Integer count) { + this.innerModel().withCount(count); + return this; + } + + public AgentPoolImpl withVmSize(String vmSize) { + this.innerModel().withVmSize(vmSize); + return this; + } + + public AgentPoolImpl withOsDiskSizeGB(Integer osDiskSizeGB) { + this.innerModel().withOsDiskSizeGB(osDiskSizeGB); + return this; + } + + public AgentPoolImpl withOsDiskType(OSDiskType osDiskType) { + this.innerModel().withOsDiskType(osDiskType); + return this; + } + + public AgentPoolImpl withKubeletDiskType(KubeletDiskType kubeletDiskType) { + this.innerModel().withKubeletDiskType(kubeletDiskType); + return this; + } + + public AgentPoolImpl withVnetSubnetId(String vnetSubnetId) { + this.innerModel().withVnetSubnetId(vnetSubnetId); + return this; + } + + public AgentPoolImpl withPodSubnetId(String podSubnetId) { + this.innerModel().withPodSubnetId(podSubnetId); + return this; + } + + public AgentPoolImpl withMaxPods(Integer maxPods) { + this.innerModel().withMaxPods(maxPods); + return this; + } + + public AgentPoolImpl withOsType(OSType osType) { + this.innerModel().withOsType(osType); + return this; + } + + public AgentPoolImpl withOsSku(Ossku osSku) { + this.innerModel().withOsSku(osSku); + return this; + } + + public AgentPoolImpl withMaxCount(Integer maxCount) { + this.innerModel().withMaxCount(maxCount); + return this; + } + + public AgentPoolImpl withMinCount(Integer minCount) { + this.innerModel().withMinCount(minCount); + return this; + } + + public AgentPoolImpl withEnableAutoScaling(Boolean enableAutoScaling) { + this.innerModel().withEnableAutoScaling(enableAutoScaling); + return this; + } + + public AgentPoolImpl withScaleDownMode(ScaleDownMode scaleDownMode) { + this.innerModel().withScaleDownMode(scaleDownMode); + return this; + } + + public AgentPoolImpl withTypePropertiesType(AgentPoolType typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public AgentPoolImpl withMode(AgentPoolMode mode) { + this.innerModel().withMode(mode); + return this; + } + + public AgentPoolImpl withOrchestratorVersion(String orchestratorVersion) { + this.innerModel().withOrchestratorVersion(orchestratorVersion); + return this; + } + + public AgentPoolImpl withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { + this.innerModel().withUpgradeSettings(upgradeSettings); + return this; + } + + public AgentPoolImpl withAvailabilityZones(List availabilityZones) { + this.innerModel().withAvailabilityZones(availabilityZones); + return this; + } + + public AgentPoolImpl withEnableNodePublicIp(Boolean enableNodePublicIp) { + this.innerModel().withEnableNodePublicIp(enableNodePublicIp); + return this; + } + + public AgentPoolImpl withNodePublicIpPrefixId(String nodePublicIpPrefixId) { + this.innerModel().withNodePublicIpPrefixId(nodePublicIpPrefixId); + return this; + } + + public AgentPoolImpl withScaleSetPriority(ScaleSetPriority scaleSetPriority) { + this.innerModel().withScaleSetPriority(scaleSetPriority); + return this; + } + + public AgentPoolImpl withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy) { + this.innerModel().withScaleSetEvictionPolicy(scaleSetEvictionPolicy); + return this; + } + + public AgentPoolImpl withSpotMaxPrice(Float spotMaxPrice) { + this.innerModel().withSpotMaxPrice(spotMaxPrice); + return this; + } + + public AgentPoolImpl withNodeLabels(Map nodeLabels) { + this.innerModel().withNodeLabels(nodeLabels); + return this; + } + + public AgentPoolImpl withNodeTaints(List nodeTaints) { + this.innerModel().withNodeTaints(nodeTaints); + return this; + } + + public AgentPoolImpl withProximityPlacementGroupId(String proximityPlacementGroupId) { + this.innerModel().withProximityPlacementGroupId(proximityPlacementGroupId); + return this; + } + + public AgentPoolImpl withKubeletConfig(KubeletConfig kubeletConfig) { + this.innerModel().withKubeletConfig(kubeletConfig); + return this; + } + + public AgentPoolImpl withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { + this.innerModel().withLinuxOSConfig(linuxOSConfig); + return this; + } + + public AgentPoolImpl withEnableEncryptionAtHost(Boolean enableEncryptionAtHost) { + this.innerModel().withEnableEncryptionAtHost(enableEncryptionAtHost); + return this; + } + + public AgentPoolImpl withEnableUltraSsd(Boolean enableUltraSsd) { + this.innerModel().withEnableUltraSsd(enableUltraSsd); + return this; + } + + public AgentPoolImpl withEnableFips(Boolean enableFips) { + this.innerModel().withEnableFips(enableFips); + return this; + } + + public AgentPoolImpl withGpuInstanceProfile(GpuInstanceProfile gpuInstanceProfile) { + this.innerModel().withGpuInstanceProfile(gpuInstanceProfile); + return this; + } + + public AgentPoolImpl withCreationData(CreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolUpgradeProfileImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolUpgradeProfileImpl.java new file mode 100644 index 0000000000000..d394a5ce03402 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolUpgradeProfileImpl.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfilePropertiesUpgradesItem; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import java.util.Collections; +import java.util.List; + +public final class AgentPoolUpgradeProfileImpl implements AgentPoolUpgradeProfile { + private AgentPoolUpgradeProfileInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + AgentPoolUpgradeProfileImpl( + AgentPoolUpgradeProfileInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String kubernetesVersion() { + return this.innerModel().kubernetesVersion(); + } + + public OSType osType() { + return this.innerModel().osType(); + } + + public List upgrades() { + List inner = this.innerModel().upgrades(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String latestNodeImageVersion() { + return this.innerModel().latestNodeImageVersion(); + } + + public AgentPoolUpgradeProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsClientImpl.java new file mode 100644 index 0000000000000..c5cb739e8c4dc --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsClientImpl.java @@ -0,0 +1,1769 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.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.containerservice.generated.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolListResult; +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 AgentPoolsClient. */ +public final class AgentPoolsClientImpl implements AgentPoolsClient { + private final ClientLogger logger = new ClientLogger(AgentPoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final AgentPoolsService service; + + /** The service client containing this operation class. */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of AgentPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AgentPoolsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy.create(AgentPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientAgentPools to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface AgentPoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/agentPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/agentPools/{agentPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/agentPools/{agentPoolName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, + @BodyParam("application/json") AgentPoolInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/agentPools/{agentPoolName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getUpgradeProfile( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/availableAgentPoolVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAvailableAgentPoolVersions( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> upgradeNodeImageVersion( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("agentPoolName") String agentPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of agent pools in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + 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 a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of agent pools in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of agent pools in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, resourceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of agent pools in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of agent pools in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); + } + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of agent pools in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); + } + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 specified managed cluster agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String agentPoolName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 specified managed cluster agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String agentPoolName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + accept, + context); + } + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 specified managed cluster agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, String agentPoolName) { + return getWithResponseAsync(resourceGroupName, resourceName, agentPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 specified managed cluster agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner get(String resourceGroupName, String resourceName, String agentPoolName) { + return getAsync(resourceGroupName, resourceName, agentPoolName).block(); + } + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 specified managed cluster agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String resourceName, String agentPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, resourceName, agentPoolName, context).block(); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName 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 = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String resourceName, + String agentPoolName, + AgentPoolInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + parameters, + accept, + context); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AgentPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, agentPoolName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AgentPoolInner.class, AgentPoolInner.class, Context.NONE); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AgentPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String resourceName, + String agentPoolName, + AgentPoolInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, agentPoolName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AgentPoolInner.class, AgentPoolInner.class, context); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AgentPoolInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters).getSyncPoller(); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AgentPoolInner> beginCreateOrUpdate( + String resourceGroupName, + String resourceName, + String agentPoolName, + AgentPoolInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String resourceName, + String agentPoolName, + AgentPoolInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner createOrUpdate( + String resourceGroupName, String resourceName, String agentPoolName, AgentPoolInner parameters) { + return createOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters).block(); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters The agent pool to create or update. + * @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 agent Pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner createOrUpdate( + String resourceGroupName, + String resourceName, + String agentPoolName, + AgentPoolInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, resourceName, agentPoolName, parameters, context).block(); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + accept, + context); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, agentPoolName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, agentPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName) { + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName).getSyncPoller(); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, context).getSyncPoller(); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName) { + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName) { + deleteAsync(resourceGroupName, resourceName, agentPoolName).block(); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName, Context context) { + deleteAsync(resourceGroupName, resourceName, agentPoolName, context).block(); + } + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 upgrade profile for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpgradeProfileWithResponseAsync( + String resourceGroupName, String resourceName, String agentPoolName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getUpgradeProfile( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 upgrade profile for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpgradeProfileWithResponseAsync( + String resourceGroupName, String resourceName, String agentPoolName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getUpgradeProfile( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + accept, + context); + } + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 upgrade profile for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getUpgradeProfileAsync( + String resourceGroupName, String resourceName, String agentPoolName) { + return getUpgradeProfileWithResponseAsync(resourceGroupName, resourceName, agentPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 upgrade profile for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolUpgradeProfileInner getUpgradeProfile( + String resourceGroupName, String resourceName, String agentPoolName) { + return getUpgradeProfileAsync(resourceGroupName, resourceName, agentPoolName).block(); + } + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 upgrade profile for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpgradeProfileWithResponse( + String resourceGroupName, String resourceName, String agentPoolName, Context context) { + return getUpgradeProfileWithResponseAsync(resourceGroupName, resourceName, agentPoolName, context).block(); + } + + /** + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of available versions for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAvailableAgentPoolVersionsWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAvailableAgentPoolVersions( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of available versions for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAvailableAgentPoolVersionsWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAvailableAgentPoolVersions( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of available versions for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAvailableAgentPoolVersionsAsync( + String resourceGroupName, String resourceName) { + return getAvailableAgentPoolVersionsWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of available versions for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolAvailableVersionsInner getAvailableAgentPoolVersions( + String resourceGroupName, String resourceName) { + return getAvailableAgentPoolVersionsAsync(resourceGroupName, resourceName).block(); + } + + /** + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of available versions for an agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAvailableAgentPoolVersionsWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getAvailableAgentPoolVersionsWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeNodeImageVersionWithResponseAsync( + String resourceGroupName, String resourceName, String agentPoolName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .upgradeNodeImageVersion( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> upgradeNodeImageVersionWithResponseAsync( + String resourceGroupName, String resourceName, String agentPoolName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .upgradeNodeImageVersion( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + accept, + context); + } + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AgentPoolInner> beginUpgradeNodeImageVersionAsync( + String resourceGroupName, String resourceName, String agentPoolName) { + Mono>> mono = + upgradeNodeImageVersionWithResponseAsync(resourceGroupName, resourceName, agentPoolName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AgentPoolInner.class, AgentPoolInner.class, Context.NONE); + } + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, AgentPoolInner> beginUpgradeNodeImageVersionAsync( + String resourceGroupName, String resourceName, String agentPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + upgradeNodeImageVersionWithResponseAsync(resourceGroupName, resourceName, agentPoolName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AgentPoolInner.class, AgentPoolInner.class, context); + } + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AgentPoolInner> beginUpgradeNodeImageVersion( + String resourceGroupName, String resourceName, String agentPoolName) { + return beginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).getSyncPoller(); + } + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AgentPoolInner> beginUpgradeNodeImageVersion( + String resourceGroupName, String resourceName, String agentPoolName, Context context) { + return beginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName, context) + .getSyncPoller(); + } + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeNodeImageVersionAsync( + String resourceGroupName, String resourceName, String agentPoolName) { + return beginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeNodeImageVersionAsync( + String resourceGroupName, String resourceName, String agentPoolName, Context context) { + return beginUpgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName) { + return upgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName).block(); + } + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentPoolInner upgradeNodeImageVersion( + String resourceGroupName, String resourceName, String agentPoolName, Context context) { + return upgradeNodeImageVersionAsync(resourceGroupName, resourceName, agentPoolName, 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 the response from the List Agent Pools operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 the response from the List Agent Pools operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsImpl.java new file mode 100644 index 0000000000000..945f472167288 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsImpl.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.containerservice.generated.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.containerservice.generated.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.AgentPool; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersions; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.AgentPools; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AgentPoolsImpl implements AgentPools { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolsImpl.class); + + private final AgentPoolsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public AgentPoolsImpl( + AgentPoolsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return Utils.mapPage(inner, inner1 -> new AgentPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context); + return Utils.mapPage(inner, inner1 -> new AgentPoolImpl(inner1, this.manager())); + } + + public AgentPool get(String resourceGroupName, String resourceName, String agentPoolName) { + AgentPoolInner inner = this.serviceClient().get(resourceGroupName, resourceName, agentPoolName); + if (inner != null) { + return new AgentPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String resourceName, String agentPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, resourceName, agentPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AgentPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, String agentPoolName) { + this.serviceClient().delete(resourceGroupName, resourceName, agentPoolName); + } + + public void delete(String resourceGroupName, String resourceName, String agentPoolName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, agentPoolName, context); + } + + public AgentPoolUpgradeProfile getUpgradeProfile( + String resourceGroupName, String resourceName, String agentPoolName) { + AgentPoolUpgradeProfileInner inner = + this.serviceClient().getUpgradeProfile(resourceGroupName, resourceName, agentPoolName); + if (inner != null) { + return new AgentPoolUpgradeProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getUpgradeProfileWithResponse( + String resourceGroupName, String resourceName, String agentPoolName, Context context) { + Response inner = + this.serviceClient().getUpgradeProfileWithResponse(resourceGroupName, resourceName, agentPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AgentPoolUpgradeProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AgentPoolAvailableVersions getAvailableAgentPoolVersions(String resourceGroupName, String resourceName) { + AgentPoolAvailableVersionsInner inner = + this.serviceClient().getAvailableAgentPoolVersions(resourceGroupName, resourceName); + if (inner != null) { + return new AgentPoolAvailableVersionsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAvailableAgentPoolVersionsWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getAvailableAgentPoolVersionsWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AgentPoolAvailableVersionsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AgentPool upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName) { + AgentPoolInner inner = + this.serviceClient().upgradeNodeImageVersion(resourceGroupName, resourceName, agentPoolName); + if (inner != null) { + return new AgentPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public AgentPool upgradeNodeImageVersion( + String resourceGroupName, String resourceName, String agentPoolName, Context context) { + AgentPoolInner inner = + this.serviceClient().upgradeNodeImageVersion(resourceGroupName, resourceName, agentPoolName, context); + if (inner != null) { + return new AgentPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public AgentPool 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, agentPoolName, 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + return this.getWithResponse(resourceGroupName, resourceName, agentPoolName, 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + this.delete(resourceGroupName, resourceName, agentPoolName, 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String agentPoolName = Utils.getValueFromIdByName(id, "agentPools"); + if (agentPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentPools'.", id))); + } + this.delete(resourceGroupName, resourceName, agentPoolName, context); + } + + private AgentPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public AgentPoolImpl define(String name) { + return new AgentPoolImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceImpl.java new file mode 100644 index 0000000000000..d4de8562ef82a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceImpl.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ContainerServiceInner; +import com.azure.resourcemanager.containerservice.generated.models.ContainerService; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceCustomProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceDiagnosticsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceMasterProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceOrchestratorProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceWindowsProfile; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ContainerServiceImpl + implements ContainerService, ContainerService.Definition, ContainerService.Update { + private ContainerServiceInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager 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 String provisioningState() { + return this.innerModel().provisioningState(); + } + + public ContainerServiceOrchestratorProfile orchestratorProfile() { + return this.innerModel().orchestratorProfile(); + } + + public ContainerServiceCustomProfile customProfile() { + return this.innerModel().customProfile(); + } + + public ContainerServicePrincipalProfile servicePrincipalProfile() { + return this.innerModel().servicePrincipalProfile(); + } + + public ContainerServiceMasterProfile masterProfile() { + return this.innerModel().masterProfile(); + } + + public List agentPoolProfiles() { + List inner = this.innerModel().agentPoolProfiles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerServiceWindowsProfile windowsProfile() { + return this.innerModel().windowsProfile(); + } + + public ContainerServiceLinuxProfile linuxProfile() { + return this.innerModel().linuxProfile(); + } + + public ContainerServiceDiagnosticsProfile diagnosticsProfile() { + return this.innerModel().diagnosticsProfile(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ContainerServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String containerServiceName; + + public ContainerServiceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ContainerService create() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerServices() + .createOrUpdate(resourceGroupName, containerServiceName, this.innerModel(), Context.NONE); + return this; + } + + public ContainerService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerServices() + .createOrUpdate(resourceGroupName, containerServiceName, this.innerModel(), context); + return this; + } + + ContainerServiceImpl( + String name, com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new ContainerServiceInner(); + this.serviceManager = serviceManager; + this.containerServiceName = name; + } + + public ContainerServiceImpl update() { + return this; + } + + public ContainerService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerServices() + .createOrUpdate(resourceGroupName, containerServiceName, this.innerModel(), Context.NONE); + return this; + } + + public ContainerService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerServices() + .createOrUpdate(resourceGroupName, containerServiceName, this.innerModel(), context); + return this; + } + + ContainerServiceImpl( + ContainerServiceInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.containerServiceName = Utils.getValueFromIdByName(innerObject.id(), "containerServices"); + } + + public ContainerService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerServices() + .getByResourceGroupWithResponse(resourceGroupName, containerServiceName, Context.NONE) + .getValue(); + return this; + } + + public ContainerService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerServices() + .getByResourceGroupWithResponse(resourceGroupName, containerServiceName, context) + .getValue(); + return this; + } + + public ContainerServiceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ContainerServiceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ContainerServiceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ContainerServiceImpl withOrchestratorProfile(ContainerServiceOrchestratorProfile orchestratorProfile) { + this.innerModel().withOrchestratorProfile(orchestratorProfile); + return this; + } + + public ContainerServiceImpl withCustomProfile(ContainerServiceCustomProfile customProfile) { + this.innerModel().withCustomProfile(customProfile); + return this; + } + + public ContainerServiceImpl withServicePrincipalProfile(ContainerServicePrincipalProfile servicePrincipalProfile) { + this.innerModel().withServicePrincipalProfile(servicePrincipalProfile); + return this; + } + + public ContainerServiceImpl withMasterProfile(ContainerServiceMasterProfile masterProfile) { + this.innerModel().withMasterProfile(masterProfile); + return this; + } + + public ContainerServiceImpl withAgentPoolProfiles(List agentPoolProfiles) { + this.innerModel().withAgentPoolProfiles(agentPoolProfiles); + return this; + } + + public ContainerServiceImpl withWindowsProfile(ContainerServiceWindowsProfile windowsProfile) { + this.innerModel().withWindowsProfile(windowsProfile); + return this; + } + + public ContainerServiceImpl withLinuxProfile(ContainerServiceLinuxProfile linuxProfile) { + this.innerModel().withLinuxProfile(linuxProfile); + return this; + } + + public ContainerServiceImpl withDiagnosticsProfile(ContainerServiceDiagnosticsProfile diagnosticsProfile) { + this.innerModel().withDiagnosticsProfile(diagnosticsProfile); + return this; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientBuilder.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientBuilder.java new file mode 100644 index 0000000000000..be257665e16f6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ContainerServiceManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ContainerServiceManagementClientImpl.class}) +public final class ContainerServiceManagementClientBuilder { + /* + * Subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ContainerServiceManagementClientBuilder. + */ + public ContainerServiceManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ContainerServiceManagementClientImpl with the provided parameters. + * + * @return an instance of ContainerServiceManagementClientImpl. + */ + public ContainerServiceManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ContainerServiceManagementClientImpl client = + new ContainerServiceManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientImpl.java new file mode 100644 index 0000000000000..ad3f167eec607 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientImpl.java @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.containerservice.generated.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.ContainerServiceManagementClient; +import com.azure.resourcemanager.containerservice.generated.fluent.ContainerServicesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.ManagedClustersClient; +import com.azure.resourcemanager.containerservice.generated.fluent.OpenShiftManagedClustersClient; +import com.azure.resourcemanager.containerservice.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.ResolvePrivateLinkServiceIdsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ContainerServiceManagementClientImpl type. */ +@ServiceClient(builder = ContainerServiceManagementClientBuilder.class) +public final class ContainerServiceManagementClientImpl implements ContainerServiceManagementClient { + private final ClientLogger logger = new ClientLogger(ContainerServiceManagementClientImpl.class); + + /** + * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OpenShiftManagedClustersClient object to access its operations. */ + private final OpenShiftManagedClustersClient openShiftManagedClusters; + + /** + * Gets the OpenShiftManagedClustersClient object to access its operations. + * + * @return the OpenShiftManagedClustersClient object. + */ + public OpenShiftManagedClustersClient getOpenShiftManagedClusters() { + return this.openShiftManagedClusters; + } + + /** The ContainerServicesClient object to access its operations. */ + private final ContainerServicesClient containerServices; + + /** + * Gets the ContainerServicesClient object to access its operations. + * + * @return the ContainerServicesClient object. + */ + public ContainerServicesClient getContainerServices() { + return this.containerServices; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** 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 MaintenanceConfigurationsClient object to access its operations. */ + private final MaintenanceConfigurationsClient maintenanceConfigurations; + + /** + * Gets the MaintenanceConfigurationsClient object to access its operations. + * + * @return the MaintenanceConfigurationsClient object. + */ + public MaintenanceConfigurationsClient getMaintenanceConfigurations() { + return this.maintenanceConfigurations; + } + + /** The AgentPoolsClient object to access its operations. */ + private final AgentPoolsClient agentPools; + + /** + * Gets the AgentPoolsClient object to access its operations. + * + * @return the AgentPoolsClient object. + */ + public AgentPoolsClient getAgentPools() { + return this.agentPools; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The ResolvePrivateLinkServiceIdsClient object to access its operations. */ + private final ResolvePrivateLinkServiceIdsClient resolvePrivateLinkServiceIds; + + /** + * Gets the ResolvePrivateLinkServiceIdsClient object to access its operations. + * + * @return the ResolvePrivateLinkServiceIdsClient object. + */ + public ResolvePrivateLinkServiceIdsClient getResolvePrivateLinkServiceIds() { + return this.resolvePrivateLinkServiceIds; + } + + /** The SnapshotsClient object to access its operations. */ + private final SnapshotsClient snapshots; + + /** + * Gets the SnapshotsClient object to access its operations. + * + * @return the SnapshotsClient object. + */ + public SnapshotsClient getSnapshots() { + return this.snapshots; + } + + /** + * Initializes an instance of ContainerServiceManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + ContainerServiceManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.openShiftManagedClusters = new OpenShiftManagedClustersClientImpl(this); + this.containerServices = new ContainerServicesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.managedClusters = new ManagedClustersClientImpl(this); + this.maintenanceConfigurations = new MaintenanceConfigurationsClientImpl(this); + this.agentPools = new AgentPoolsClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.resolvePrivateLinkServiceIds = new ResolvePrivateLinkServiceIdsClientImpl(this); + this.snapshots = new SnapshotsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServicesClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServicesClientImpl.java new file mode 100644 index 0000000000000..d14207cf2076f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServicesClientImpl.java @@ -0,0 +1,1500 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.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.containerservice.generated.fluent.ContainerServicesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ContainerServiceInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OrchestratorVersionProfileListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceListResult; +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 ContainerServicesClient. */ +public final class ContainerServicesClientImpl implements ContainerServicesClient { + private final ClientLogger logger = new ClientLogger(ContainerServicesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainerServicesService service; + + /** The service client containing this operation class. */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of ContainerServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerServicesClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy.create(ContainerServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientContainerServices to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface ContainerServicesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices") + @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"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/containerServices/{containerServiceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerServiceName") String containerServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ContainerServiceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/containerServices/{containerServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerServiceName") String containerServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/containerServices/{containerServiceName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerServiceName") String containerServiceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/containerServices") + @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.ContainerService/locations/{location}/orchestrators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOrchestrators( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("resource-type") String resourceType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @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> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 list of container services in the specified 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 = "2017-07-01"; + 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 a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 list of container services in the specified 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 = "2017-07-01"; + 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 a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 list of container services in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 list of container services in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 list of container services in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 list of container services in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String containerServiceName, ContainerServiceInner 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 (containerServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerServiceName 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 = "2017-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + containerServiceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String containerServiceName, ContainerServiceInner 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 (containerServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerServiceName 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 = "2017-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + containerServiceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ContainerServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerServiceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerServiceInner.class, + ContainerServiceInner.class, + Context.NONE); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ContainerServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerServiceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContainerServiceInner.class, ContainerServiceInner.class, context); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ContainerServiceInner> beginCreateOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ContainerServiceInner> beginCreateOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service 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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerServiceInner createOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { + return createOrUpdateAsync(resourceGroupName, containerServiceName, parameters).block(); + } + + /** + * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and resource group. + * @param parameters Parameters supplied to the Create or Update a Container Service operation. + * @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 container service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerServiceInner createOrUpdate( + String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, containerServiceName, parameters, context).block(); + } + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the properties of the specified container service in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String containerServiceName) { + 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 (containerServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerServiceName 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 = "2017-07-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + containerServiceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the properties of the specified container service in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String containerServiceName, 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 (containerServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerServiceName 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 = "2017-07-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + containerServiceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the properties of the specified container service in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String containerServiceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, containerServiceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the properties of the specified container service in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerServiceInner getByResourceGroup(String resourceGroupName, String containerServiceName) { + return getByResourceGroupAsync(resourceGroupName, containerServiceName).block(); + } + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the properties of the specified container service in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String containerServiceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, containerServiceName, context).block(); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String containerServiceName) { + 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 (containerServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerServiceName 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 = "2017-07-01"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + containerServiceName, + apiVersion, + this.client.getSubscriptionId(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String containerServiceName, 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 (containerServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerServiceName 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 = "2017-07-01"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + containerServiceName, + apiVersion, + this.client.getSubscriptionId(), + context); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerServiceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerServiceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String containerServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, containerServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String containerServiceName) { + return beginDeleteAsync(resourceGroupName, containerServiceName).getSyncPoller(); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String containerServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, containerServiceName, context).getSyncPoller(); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerServiceName) { + return beginDeleteAsync(resourceGroupName, containerServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, containerServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String containerServiceName) { + deleteAsync(resourceGroupName, containerServiceName).block(); + } + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String containerServiceName, Context context) { + deleteAsync(resourceGroupName, containerServiceName, context).block(); + } + + /** + * Gets a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 a list of container services in the specified subscription and 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 = "2017-07-01"; + 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 a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 a list of container services in the specified subscription and 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 = "2017-07-01"; + 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 a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 a list of container services in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 a list of container services in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 a list of container services in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 a list of container services in the specified subscription and resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each + * orchestrator including version, available upgrades and whether that version or upgrades are in preview. + * + * @param location The name of a supported Azure region. + * @param resourceType resource type for which the list of orchestrators needs to be returned. + * @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 list of supported orchestrators in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOrchestratorsWithResponseAsync( + String location, String resourceType) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String apiVersion = "2019-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOrchestrators( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + location, + resourceType, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each + * orchestrator including version, available upgrades and whether that version or upgrades are in preview. + * + * @param location The name of a supported Azure region. + * @param resourceType resource type for which the list of orchestrators needs to be returned. + * @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 list of supported orchestrators in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOrchestratorsWithResponseAsync( + String location, String resourceType, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String apiVersion = "2019-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOrchestrators( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + location, + resourceType, + accept, + context); + } + + /** + * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each + * orchestrator including version, available upgrades and whether that version or upgrades are in preview. + * + * @param location The name of a supported Azure region. + * @param resourceType resource type for which the list of orchestrators needs to be returned. + * @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 list of supported orchestrators in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listOrchestratorsAsync( + String location, String resourceType) { + return listOrchestratorsWithResponseAsync(location, resourceType) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each + * orchestrator including version, available upgrades and whether that version or upgrades are in preview. + * + * @param location The name of a supported Azure region. + * @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 list of supported orchestrators in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listOrchestratorsAsync(String location) { + final String resourceType = null; + return listOrchestratorsWithResponseAsync(location, resourceType) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each + * orchestrator including version, available upgrades and whether that version or upgrades are in preview. + * + * @param location The name of a supported Azure region. + * @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 list of supported orchestrators in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrchestratorVersionProfileListResultInner listOrchestrators(String location) { + final String resourceType = null; + return listOrchestratorsAsync(location, resourceType).block(); + } + + /** + * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each + * orchestrator including version, available upgrades and whether that version or upgrades are in preview. + * + * @param location The name of a supported Azure region. + * @param resourceType resource type for which the list of orchestrators needs to be returned. + * @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 list of supported orchestrators in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listOrchestratorsWithResponse( + String location, String resourceType, Context context) { + return listOrchestratorsWithResponseAsync(location, resourceType, 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 the response from the List Container Services operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 the response from the List Container Services operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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 the response from the List Container Services operation. + */ + @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 the response from the List Container Services operation. + */ + @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)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServicesImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServicesImpl.java new file mode 100644 index 0000000000000..1eebbb9697890 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServicesImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.ContainerServicesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ContainerServiceInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OrchestratorVersionProfileListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.ContainerService; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServices; +import com.azure.resourcemanager.containerservice.generated.models.OrchestratorVersionProfileListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainerServicesImpl implements ContainerServices { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServicesImpl.class); + + private final ContainerServicesClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public ContainerServicesImpl( + ContainerServicesClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ContainerServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ContainerServiceImpl(inner1, this.manager())); + } + + public ContainerService getByResourceGroup(String resourceGroupName, String containerServiceName) { + ContainerServiceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, containerServiceName); + if (inner != null) { + return new ContainerServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String containerServiceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, containerServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContainerServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String containerServiceName) { + this.serviceClient().delete(resourceGroupName, containerServiceName); + } + + public void delete(String resourceGroupName, String containerServiceName, Context context) { + this.serviceClient().delete(resourceGroupName, containerServiceName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ContainerServiceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ContainerServiceImpl(inner1, this.manager())); + } + + public OrchestratorVersionProfileListResult listOrchestrators(String location) { + OrchestratorVersionProfileListResultInner inner = this.serviceClient().listOrchestrators(location); + if (inner != null) { + return new OrchestratorVersionProfileListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listOrchestratorsWithResponse( + String location, String resourceType, Context context) { + Response inner = + this.serviceClient().listOrchestratorsWithResponse(location, resourceType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OrchestratorVersionProfileListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerService 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 containerServiceName = Utils.getValueFromIdByName(id, "containerServices"); + if (containerServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'containerServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, containerServiceName, 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 containerServiceName = Utils.getValueFromIdByName(id, "containerServices"); + if (containerServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'containerServices'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, containerServiceName, 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 containerServiceName = Utils.getValueFromIdByName(id, "containerServices"); + if (containerServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'containerServices'.", id))); + } + this.delete(resourceGroupName, containerServiceName, 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 containerServiceName = Utils.getValueFromIdByName(id, "containerServices"); + if (containerServiceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'containerServices'.", id))); + } + this.delete(resourceGroupName, containerServiceName, context); + } + + private ContainerServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public ContainerServiceImpl define(String name) { + return new ContainerServiceImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/CredentialResultsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/CredentialResultsImpl.java new file mode 100644 index 0000000000000..15d36b816b79a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/CredentialResultsImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResult; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import java.util.Collections; +import java.util.List; + +public final class CredentialResultsImpl implements CredentialResults { + private CredentialResultsInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + CredentialResultsImpl( + CredentialResultsInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List kubeconfigs() { + List inner = this.innerModel().kubeconfigs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CredentialResultsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationImpl.java new file mode 100644 index 0000000000000..65db44d0dc7c9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationImpl.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import java.util.Collections; +import java.util.List; + +public final class MaintenanceConfigurationImpl + implements MaintenanceConfiguration, MaintenanceConfiguration.Definition, MaintenanceConfiguration.Update { + private MaintenanceConfigurationInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List timeInWeek() { + List inner = this.innerModel().timeInWeek(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List notAllowedTime() { + List inner = this.innerModel().notAllowedTime(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public MaintenanceConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String configName; + + public MaintenanceConfigurationImpl withExistingManagedCluster(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public MaintenanceConfiguration create() { + this.innerObject = + serviceManager + .serviceClient() + .getMaintenanceConfigurations() + .createOrUpdateWithResponse( + resourceGroupName, resourceName, configName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public MaintenanceConfiguration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMaintenanceConfigurations() + .createOrUpdateWithResponse(resourceGroupName, resourceName, configName, this.innerModel(), context) + .getValue(); + return this; + } + + MaintenanceConfigurationImpl( + String name, com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new MaintenanceConfigurationInner(); + this.serviceManager = serviceManager; + this.configName = name; + } + + public MaintenanceConfigurationImpl update() { + return this; + } + + public MaintenanceConfiguration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getMaintenanceConfigurations() + .createOrUpdateWithResponse( + resourceGroupName, resourceName, configName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public MaintenanceConfiguration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMaintenanceConfigurations() + .createOrUpdateWithResponse(resourceGroupName, resourceName, configName, this.innerModel(), context) + .getValue(); + return this; + } + + MaintenanceConfigurationImpl( + MaintenanceConfigurationInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "managedClusters"); + this.configName = Utils.getValueFromIdByName(innerObject.id(), "maintenanceConfigurations"); + } + + public MaintenanceConfiguration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getMaintenanceConfigurations() + .getWithResponse(resourceGroupName, resourceName, configName, Context.NONE) + .getValue(); + return this; + } + + public MaintenanceConfiguration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getMaintenanceConfigurations() + .getWithResponse(resourceGroupName, resourceName, configName, context) + .getValue(); + return this; + } + + public MaintenanceConfigurationImpl withTimeInWeek(List timeInWeek) { + this.innerModel().withTimeInWeek(timeInWeek); + return this; + } + + public MaintenanceConfigurationImpl withNotAllowedTime(List notAllowedTime) { + this.innerModel().withNotAllowedTime(notAllowedTime); + return this; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsClientImpl.java new file mode 100644 index 0000000000000..c2511c36ce23b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsClientImpl.java @@ -0,0 +1,912 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.MaintenanceConfigurationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfigurationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in MaintenanceConfigurationsClient. */ +public final class MaintenanceConfigurationsClientImpl implements MaintenanceConfigurationsClient { + private final ClientLogger logger = new ClientLogger(MaintenanceConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final MaintenanceConfigurationsService service; + + /** The service client containing this operation class. */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of MaintenanceConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MaintenanceConfigurationsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy + .create( + MaintenanceConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientMaintenanceConfigurations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface MaintenanceConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/maintenanceConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByManagedCluster( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/maintenanceConfigurations/{configName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("configName") String configName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/maintenanceConfigurations/{configName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("configName") String configName, + @BodyParam("application/json") MaintenanceConfigurationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/maintenanceConfigurations/{configName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("configName") String configName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByManagedClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of maintenance configurations in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClusterSinglePageAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByManagedCluster( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + 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 a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of maintenance configurations in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClusterSinglePageAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByManagedCluster( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of maintenance configurations in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByManagedClusterAsync( + String resourceGroupName, String resourceName) { + return new PagedFlux<>( + () -> listByManagedClusterSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listByManagedClusterNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of maintenance configurations in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByManagedClusterAsync( + String resourceGroupName, String resourceName, Context context) { + return new PagedFlux<>( + () -> listByManagedClusterSinglePageAsync(resourceGroupName, resourceName, context), + nextLink -> listByManagedClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of maintenance configurations in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagedCluster( + String resourceGroupName, String resourceName) { + return new PagedIterable<>(listByManagedClusterAsync(resourceGroupName, resourceName)); + } + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of maintenance configurations in the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByManagedCluster( + String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(listByManagedClusterAsync(resourceGroupName, resourceName, context)); + } + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 specified maintenance configuration of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String configName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + configName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 specified maintenance configuration of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String configName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + configName, + accept, + context); + } + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 specified maintenance configuration of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String resourceName, String configName) { + return getWithResponseAsync(resourceGroupName, resourceName, configName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 specified maintenance configuration of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceConfigurationInner get(String resourceGroupName, String resourceName, String configName) { + return getAsync(resourceGroupName, resourceName, configName).block(); + } + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 specified maintenance configuration of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String resourceName, String configName, Context context) { + return getWithResponseAsync(resourceGroupName, resourceName, configName, context).block(); + } + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. + * @param parameters The maintenance configuration to create or update. + * @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 see [planned maintenance](https://docs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, String configName, MaintenanceConfigurationInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName 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 = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + configName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. + * @param parameters The maintenance configuration to create or update. + * @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 see [planned maintenance](https://docs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String resourceName, + String configName, + MaintenanceConfigurationInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + configName, + parameters, + accept, + context); + } + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. + * @param parameters The maintenance configuration to create or update. + * @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 see [planned maintenance](https://docs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, String configName, MaintenanceConfigurationInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, configName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. + * @param parameters The maintenance configuration to create or update. + * @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 see [planned maintenance](https://docs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceConfigurationInner createOrUpdate( + String resourceGroupName, String resourceName, String configName, MaintenanceConfigurationInner parameters) { + return createOrUpdateAsync(resourceGroupName, resourceName, configName, parameters).block(); + } + + /** + * Creates or updates a maintenance configuration in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance configuration. + * @param parameters The maintenance configuration to create or update. + * @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 see [planned maintenance](https://docs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String resourceName, + String configName, + MaintenanceConfigurationInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, configName, parameters, context) + .block(); + } + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String resourceName, String configName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + configName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String resourceName, String configName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (configName == null) { + return Mono.error(new IllegalArgumentException("Parameter configName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + configName, + accept, + context); + } + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String configName) { + return deleteWithResponseAsync(resourceGroupName, resourceName, configName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String configName) { + deleteAsync(resourceGroupName, resourceName, configName).block(); + } + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String resourceName, String configName, Context context) { + return deleteWithResponseAsync(resourceGroupName, resourceName, configName, 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 the response from the List maintenance configurations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClusterNextSinglePageAsync( + 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.listByManagedClusterNext(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 the response from the List maintenance configurations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByManagedClusterNextSinglePageAsync( + 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 + .listByManagedClusterNext(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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsImpl.java new file mode 100644 index 0000000000000..ab7b89ce6dc24 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.MaintenanceConfigurationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.MaintenanceConfigurations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MaintenanceConfigurationsImpl implements MaintenanceConfigurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MaintenanceConfigurationsImpl.class); + + private final MaintenanceConfigurationsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public MaintenanceConfigurationsImpl( + MaintenanceConfigurationsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByManagedCluster(String resourceGroupName, String resourceName) { + PagedIterable inner = + this.serviceClient().listByManagedCluster(resourceGroupName, resourceName); + return Utils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listByManagedCluster( + String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = + this.serviceClient().listByManagedCluster(resourceGroupName, resourceName, context); + return Utils.mapPage(inner, inner1 -> new MaintenanceConfigurationImpl(inner1, this.manager())); + } + + public MaintenanceConfiguration get(String resourceGroupName, String resourceName, String configName) { + MaintenanceConfigurationInner inner = this.serviceClient().get(resourceGroupName, resourceName, configName); + if (inner != null) { + return new MaintenanceConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String resourceName, String configName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, resourceName, configName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MaintenanceConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, String configName) { + this.serviceClient().delete(resourceGroupName, resourceName, configName); + } + + public Response deleteWithResponse( + String resourceGroupName, String resourceName, String configName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, configName, context); + } + + public MaintenanceConfiguration 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String configName = Utils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (configName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, resourceName, configName, 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String configName = Utils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (configName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", + id))); + } + return this.getWithResponse(resourceGroupName, resourceName, configName, 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String configName = Utils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (configName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", + id))); + } + this.deleteWithResponse(resourceGroupName, resourceName, configName, Context.NONE).getValue(); + } + + public Response 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + String configName = Utils.getValueFromIdByName(id, "maintenanceConfigurations"); + if (configName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'maintenanceConfigurations'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, resourceName, configName, context); + } + + private MaintenanceConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public MaintenanceConfigurationImpl define(String name) { + return new MaintenanceConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterAccessProfileImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterAccessProfileImpl.java new file mode 100644 index 0000000000000..fe8b64679bb2a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterAccessProfileImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAccessProfile; +import java.util.Collections; +import java.util.Map; + +public final class ManagedClusterAccessProfileImpl implements ManagedClusterAccessProfile { + private ManagedClusterAccessProfileInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + ManagedClusterAccessProfileImpl( + ManagedClusterAccessProfileInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = 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 byte[] kubeConfig() { + return this.innerModel().kubeConfig(); + } + + public ManagedClusterAccessProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterImpl.java new file mode 100644 index 0000000000000..847868b452b52 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterImpl.java @@ -0,0 +1,573 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfileAutoGenerated; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import com.azure.resourcemanager.containerservice.generated.models.ExtendedLocation; +import com.azure.resourcemanager.containerservice.generated.models.ManagedCluster; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAadProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAddonProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAutoUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPodIdentityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesAutoScalerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSecurityProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSku; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.PowerState; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.containerservice.generated.models.PublicNetworkAccess; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandResult; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import com.azure.resourcemanager.containerservice.generated.models.UserAssignedIdentity; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class ManagedClusterImpl implements ManagedCluster, ManagedCluster.Definition, ManagedCluster.Update { + private ManagedClusterInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager 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 ManagedClusterSku sku() { + return this.innerModel().sku(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public ManagedClusterIdentity identity() { + return this.innerModel().identity(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public PowerState powerState() { + return this.innerModel().powerState(); + } + + public Integer maxAgentPools() { + return this.innerModel().maxAgentPools(); + } + + public String kubernetesVersion() { + return this.innerModel().kubernetesVersion(); + } + + public String dnsPrefix() { + return this.innerModel().dnsPrefix(); + } + + public String fqdnSubdomain() { + return this.innerModel().fqdnSubdomain(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String privateFqdn() { + return this.innerModel().privateFqdn(); + } + + public String azurePortalFqdn() { + return this.innerModel().azurePortalFqdn(); + } + + public List agentPoolProfiles() { + List inner = this.innerModel().agentPoolProfiles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ContainerServiceLinuxProfileAutoGenerated linuxProfile() { + return this.innerModel().linuxProfile(); + } + + public ManagedClusterWindowsProfile windowsProfile() { + return this.innerModel().windowsProfile(); + } + + public ManagedClusterServicePrincipalProfile servicePrincipalProfile() { + return this.innerModel().servicePrincipalProfile(); + } + + public Map addonProfiles() { + Map inner = this.innerModel().addonProfiles(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedClusterPodIdentityProfile podIdentityProfile() { + return this.innerModel().podIdentityProfile(); + } + + public String nodeResourceGroup() { + return this.innerModel().nodeResourceGroup(); + } + + public Boolean enableRbac() { + return this.innerModel().enableRbac(); + } + + public Boolean enablePodSecurityPolicy() { + return this.innerModel().enablePodSecurityPolicy(); + } + + public ContainerServiceNetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public ManagedClusterAadProfile aadProfile() { + return this.innerModel().aadProfile(); + } + + public ManagedClusterAutoUpgradeProfile autoUpgradeProfile() { + return this.innerModel().autoUpgradeProfile(); + } + + public ManagedClusterPropertiesAutoScalerProfile autoScalerProfile() { + return this.innerModel().autoScalerProfile(); + } + + public ManagedClusterApiServerAccessProfile apiServerAccessProfile() { + return this.innerModel().apiServerAccessProfile(); + } + + public String diskEncryptionSetId() { + return this.innerModel().diskEncryptionSetId(); + } + + public Map identityProfile() { + Map inner = this.innerModel().identityProfile(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List privateLinkResources() { + List inner = this.innerModel().privateLinkResources(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Boolean disableLocalAccounts() { + return this.innerModel().disableLocalAccounts(); + } + + public ManagedClusterHttpProxyConfig httpProxyConfig() { + return this.innerModel().httpProxyConfig(); + } + + public ManagedClusterSecurityProfile securityProfile() { + return this.innerModel().securityProfile(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ManagedClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private TagsObject updateParameters; + + public ManagedClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ManagedCluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedCluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), context); + return this; + } + + ManagedClusterImpl( + String name, com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new ManagedClusterInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public ManagedClusterImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ManagedCluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .updateTags(resourceGroupName, resourceName, updateParameters, Context.NONE); + return this; + } + + public ManagedCluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .updateTags(resourceGroupName, resourceName, updateParameters, context); + return this; + } + + ManagedClusterImpl( + ManagedClusterInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "managedClusters"); + } + + public ManagedCluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public ManagedCluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusters() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public CredentialResults listClusterAdminCredentials() { + return serviceManager.managedClusters().listClusterAdminCredentials(resourceGroupName, resourceName); + } + + public Response listClusterAdminCredentialsWithResponse(String serverFqdn, Context context) { + return serviceManager + .managedClusters() + .listClusterAdminCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, context); + } + + public CredentialResults listClusterUserCredentials() { + return serviceManager.managedClusters().listClusterUserCredentials(resourceGroupName, resourceName); + } + + public Response listClusterUserCredentialsWithResponse(String serverFqdn, Context context) { + return serviceManager + .managedClusters() + .listClusterUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, context); + } + + public CredentialResults listClusterMonitoringUserCredentials() { + return serviceManager.managedClusters().listClusterMonitoringUserCredentials(resourceGroupName, resourceName); + } + + public Response listClusterMonitoringUserCredentialsWithResponse( + String serverFqdn, Context context) { + return serviceManager + .managedClusters() + .listClusterMonitoringUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, context); + } + + public void resetServicePrincipalProfile(ManagedClusterServicePrincipalProfile parameters) { + serviceManager.managedClusters().resetServicePrincipalProfile(resourceGroupName, resourceName, parameters); + } + + public void resetServicePrincipalProfile(ManagedClusterServicePrincipalProfile parameters, Context context) { + serviceManager + .managedClusters() + .resetServicePrincipalProfile(resourceGroupName, resourceName, parameters, context); + } + + public void resetAadProfile(ManagedClusterAadProfile parameters) { + serviceManager.managedClusters().resetAadProfile(resourceGroupName, resourceName, parameters); + } + + public void resetAadProfile(ManagedClusterAadProfile parameters, Context context) { + serviceManager.managedClusters().resetAadProfile(resourceGroupName, resourceName, parameters, context); + } + + public void rotateClusterCertificates() { + serviceManager.managedClusters().rotateClusterCertificates(resourceGroupName, resourceName); + } + + public void rotateClusterCertificates(Context context) { + serviceManager.managedClusters().rotateClusterCertificates(resourceGroupName, resourceName, context); + } + + public void stop() { + serviceManager.managedClusters().stop(resourceGroupName, resourceName); + } + + public void stop(Context context) { + serviceManager.managedClusters().stop(resourceGroupName, resourceName, context); + } + + public void start() { + serviceManager.managedClusters().start(resourceGroupName, resourceName); + } + + public void start(Context context) { + serviceManager.managedClusters().start(resourceGroupName, resourceName, context); + } + + public RunCommandResult runCommand(RunCommandRequest requestPayload) { + return serviceManager.managedClusters().runCommand(resourceGroupName, resourceName, requestPayload); + } + + public RunCommandResult runCommand(RunCommandRequest requestPayload, Context context) { + return serviceManager.managedClusters().runCommand(resourceGroupName, resourceName, requestPayload, context); + } + + 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(ManagedClusterSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ManagedClusterImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + + public ManagedClusterImpl withIdentity(ManagedClusterIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ManagedClusterImpl withKubernetesVersion(String kubernetesVersion) { + this.innerModel().withKubernetesVersion(kubernetesVersion); + return this; + } + + public ManagedClusterImpl withDnsPrefix(String dnsPrefix) { + this.innerModel().withDnsPrefix(dnsPrefix); + return this; + } + + public ManagedClusterImpl withFqdnSubdomain(String fqdnSubdomain) { + this.innerModel().withFqdnSubdomain(fqdnSubdomain); + return this; + } + + public ManagedClusterImpl withAgentPoolProfiles(List agentPoolProfiles) { + this.innerModel().withAgentPoolProfiles(agentPoolProfiles); + return this; + } + + public ManagedClusterImpl withLinuxProfile(ContainerServiceLinuxProfileAutoGenerated linuxProfile) { + this.innerModel().withLinuxProfile(linuxProfile); + return this; + } + + public ManagedClusterImpl withWindowsProfile(ManagedClusterWindowsProfile windowsProfile) { + this.innerModel().withWindowsProfile(windowsProfile); + return this; + } + + public ManagedClusterImpl withServicePrincipalProfile( + ManagedClusterServicePrincipalProfile servicePrincipalProfile) { + this.innerModel().withServicePrincipalProfile(servicePrincipalProfile); + return this; + } + + public ManagedClusterImpl withAddonProfiles(Map addonProfiles) { + this.innerModel().withAddonProfiles(addonProfiles); + return this; + } + + public ManagedClusterImpl withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile) { + this.innerModel().withPodIdentityProfile(podIdentityProfile); + return this; + } + + public ManagedClusterImpl withNodeResourceGroup(String nodeResourceGroup) { + this.innerModel().withNodeResourceGroup(nodeResourceGroup); + return this; + } + + public ManagedClusterImpl withEnableRbac(Boolean enableRbac) { + this.innerModel().withEnableRbac(enableRbac); + return this; + } + + public ManagedClusterImpl withEnablePodSecurityPolicy(Boolean enablePodSecurityPolicy) { + this.innerModel().withEnablePodSecurityPolicy(enablePodSecurityPolicy); + return this; + } + + public ManagedClusterImpl withNetworkProfile(ContainerServiceNetworkProfile networkProfile) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } + + public ManagedClusterImpl withAadProfile(ManagedClusterAadProfile aadProfile) { + this.innerModel().withAadProfile(aadProfile); + return this; + } + + public ManagedClusterImpl withAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile) { + this.innerModel().withAutoUpgradeProfile(autoUpgradeProfile); + return this; + } + + public ManagedClusterImpl withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile) { + this.innerModel().withAutoScalerProfile(autoScalerProfile); + return this; + } + + public ManagedClusterImpl withApiServerAccessProfile(ManagedClusterApiServerAccessProfile apiServerAccessProfile) { + this.innerModel().withApiServerAccessProfile(apiServerAccessProfile); + return this; + } + + public ManagedClusterImpl withDiskEncryptionSetId(String diskEncryptionSetId) { + this.innerModel().withDiskEncryptionSetId(diskEncryptionSetId); + return this; + } + + public ManagedClusterImpl withIdentityProfile(Map identityProfile) { + this.innerModel().withIdentityProfile(identityProfile); + return this; + } + + public ManagedClusterImpl withPrivateLinkResources(List privateLinkResources) { + this.innerModel().withPrivateLinkResources(privateLinkResources); + return this; + } + + public ManagedClusterImpl withDisableLocalAccounts(Boolean disableLocalAccounts) { + this.innerModel().withDisableLocalAccounts(disableLocalAccounts); + return this; + } + + public ManagedClusterImpl withHttpProxyConfig(ManagedClusterHttpProxyConfig httpProxyConfig) { + this.innerModel().withHttpProxyConfig(httpProxyConfig); + return this; + } + + public ManagedClusterImpl withSecurityProfile(ManagedClusterSecurityProfile securityProfile) { + this.innerModel().withSecurityProfile(securityProfile); + return this; + } + + public ManagedClusterImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterUpgradeProfileImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterUpgradeProfileImpl.java new file mode 100644 index 0000000000000..aef12a142e0b3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterUpgradeProfileImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPoolUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterUpgradeProfile; +import java.util.Collections; +import java.util.List; + +public final class ManagedClusterUpgradeProfileImpl implements ManagedClusterUpgradeProfile { + private ManagedClusterUpgradeProfileInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + ManagedClusterUpgradeProfileImpl( + ManagedClusterUpgradeProfileInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ManagedClusterPoolUpgradeProfile controlPlaneProfile() { + return this.innerModel().controlPlaneProfile(); + } + + public List agentPoolProfiles() { + List inner = this.innerModel().agentPoolProfiles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ManagedClusterUpgradeProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersClientImpl.java new file mode 100644 index 0000000000000..e3158c6a36c01 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersClientImpl.java @@ -0,0 +1,4831 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.ManagedClustersClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OSOptionProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAadProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterListResult; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.OutboundEnvironmentEndpointCollection; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +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 ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of ManagedClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedClustersClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy.create(ManagedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientManagedClusters to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface ManagedClustersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions" + + "/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getOSOptions( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("resource-type") String resourceType, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/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.ContainerService" + + "/managedClusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/upgradeProfiles/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getUpgradeProfile( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAccessProfile( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("roleName") String roleName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/listClusterAdminCredential") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterAdminCredentials( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("server-fqdn") String serverFqdn, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/listClusterUserCredential") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterUserCredentials( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("server-fqdn") String serverFqdn, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/listClusterMonitoringUserCredential") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterMonitoringUserCredentials( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @QueryParam("server-fqdn") String serverFqdn, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") ManagedClusterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/resetServicePrincipalProfile") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetServicePrincipalProfile( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") ManagedClusterServicePrincipalProfile parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/resetAADProfile") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resetAadProfile( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") ManagedClusterAadProfile parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/rotateClusterCertificates") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rotateClusterCertificates( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/stop") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/start") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/runCommand") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> runCommand( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") RunCommandRequest requestPayload, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/commandResults/{commandId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCommandResult( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("commandId") String commandId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listOutboundNetworkDependenciesEndpoints( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @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> 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> listOutboundNetworkDependenciesEndpointsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets supported OS options in the specified subscription. + * + * @param location The name of a supported Azure region. + * @param resourceType The resource type for which the OS options needs to be returned. + * @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 supported OS options in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSOptionsWithResponseAsync(String location, String resourceType) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getOSOptions( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + location, + resourceType, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets supported OS options in the specified subscription. + * + * @param location The name of a supported Azure region. + * @param resourceType The resource type for which the OS options needs to be returned. + * @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 supported OS options in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getOSOptionsWithResponseAsync( + String location, String resourceType, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getOSOptions( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + location, + resourceType, + accept, + context); + } + + /** + * Gets supported OS options in the specified subscription. + * + * @param location The name of a supported Azure region. + * @param resourceType The resource type for which the OS options needs to be returned. + * @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 supported OS options in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOSOptionsAsync(String location, String resourceType) { + return getOSOptionsWithResponseAsync(location, resourceType) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets supported OS options in the specified subscription. + * + * @param location The name of a supported Azure region. + * @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 supported OS options in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getOSOptionsAsync(String location) { + final String resourceType = null; + return getOSOptionsWithResponseAsync(location, resourceType) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets supported OS options in the specified subscription. + * + * @param location The name of a supported Azure region. + * @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 supported OS options in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OSOptionProfileInner getOSOptions(String location) { + final String resourceType = null; + return getOSOptionsAsync(location, resourceType).block(); + } + + /** + * Gets supported OS options in the specified subscription. + * + * @param location The name of a supported Azure region. + * @param resourceType The resource type for which the OS options needs to be returned. + * @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 supported OS options in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOSOptionsWithResponse( + String location, String resourceType, Context context) { + return getOSOptionsWithResponseAsync(location, resourceType, context).block(); + } + + /** + * Gets a list of managed clusters in the specified 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 a list of managed clusters in the specified 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 = "2021-08-01"; + 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 a list of managed clusters in the specified 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 a list of managed clusters in the specified 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 = "2021-08-01"; + 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 a list of managed clusters in the specified 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 a list of managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of managed clusters in the specified 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 a list of managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of managed clusters in the specified 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 a list of managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of managed clusters in the specified 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 a list of managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists managed clusters in the specified subscription and 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 the response from the List Managed Clusters operation. + */ + @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 (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.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + 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())); + } + + /** + * Lists managed clusters in the specified subscription and 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 the response from the List Managed Clusters operation. + */ + @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 (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.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists managed clusters in the specified subscription and 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 the response from the List Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists managed clusters in the specified subscription and 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 the response from the List Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists managed clusters in the specified subscription and 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 the response from the List Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists managed clusters in the specified subscription and 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 the response from the List Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 upgrade profile of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpgradeProfileWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getUpgradeProfile( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 upgrade profile of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getUpgradeProfileWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getUpgradeProfile( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 upgrade profile of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getUpgradeProfileAsync( + String resourceGroupName, String resourceName) { + return getUpgradeProfileWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 upgrade profile of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterUpgradeProfileInner getUpgradeProfile(String resourceGroupName, String resourceName) { + return getUpgradeProfileAsync(resourceGroupName, resourceName).block(); + } + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 upgrade profile of a managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpgradeProfileWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getUpgradeProfileWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * **WARNING**: This API will be deprecated. Instead use + * [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + * or + * [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + * . + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile 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 managed cluster Access Profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAccessProfileWithResponseAsync( + String resourceGroupName, String resourceName, String roleName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (roleName == null) { + return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAccessProfile( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + roleName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * **WARNING**: This API will be deprecated. Instead use + * [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + * or + * [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + * . + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile 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 managed cluster Access Profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAccessProfileWithResponseAsync( + String resourceGroupName, String resourceName, String roleName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (roleName == null) { + return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAccessProfile( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + roleName, + accept, + context); + } + + /** + * **WARNING**: This API will be deprecated. Instead use + * [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + * or + * [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + * . + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile 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 managed cluster Access Profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAccessProfileAsync( + String resourceGroupName, String resourceName, String roleName) { + return getAccessProfileWithResponseAsync(resourceGroupName, resourceName, roleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * **WARNING**: This API will be deprecated. Instead use + * [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + * or + * [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + * . + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile 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 managed cluster Access Profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterAccessProfileInner getAccessProfile( + String resourceGroupName, String resourceName, String roleName) { + return getAccessProfileAsync(resourceGroupName, resourceName, roleName).block(); + } + + /** + * **WARNING**: This API will be deprecated. Instead use + * [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + * or + * [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + * . + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile 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 managed cluster Access Profile. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAccessProfileWithResponse( + String resourceGroupName, String resourceName, String roleName, Context context) { + return getAccessProfileWithResponseAsync(resourceGroupName, resourceName, roleName, context).block(); + } + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterAdminCredentialsWithResponseAsync( + String resourceGroupName, String resourceName, String serverFqdn) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listClusterAdminCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + serverFqdn, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterAdminCredentialsWithResponseAsync( + String resourceGroupName, String resourceName, String serverFqdn, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listClusterAdminCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + serverFqdn, + accept, + context); + } + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterAdminCredentialsAsync( + String resourceGroupName, String resourceName, String serverFqdn) { + return listClusterAdminCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterAdminCredentialsAsync( + String resourceGroupName, String resourceName) { + final String serverFqdn = null; + return listClusterAdminCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialResultsInner listClusterAdminCredentials(String resourceGroupName, String resourceName) { + final String serverFqdn = null; + return listClusterAdminCredentialsAsync(resourceGroupName, resourceName, serverFqdn).block(); + } + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterAdminCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context) { + return listClusterAdminCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn, context) + .block(); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialsWithResponseAsync( + String resourceGroupName, String resourceName, String serverFqdn) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listClusterUserCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + serverFqdn, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialsWithResponseAsync( + String resourceGroupName, String resourceName, String serverFqdn, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listClusterUserCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + serverFqdn, + accept, + context); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterUserCredentialsAsync( + String resourceGroupName, String resourceName, String serverFqdn) { + return listClusterUserCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterUserCredentialsAsync( + String resourceGroupName, String resourceName) { + final String serverFqdn = null; + return listClusterUserCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialResultsInner listClusterUserCredentials(String resourceGroupName, String resourceName) { + final String serverFqdn = null; + return listClusterUserCredentialsAsync(resourceGroupName, resourceName, serverFqdn).block(); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context) { + return listClusterUserCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn, context) + .block(); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterMonitoringUserCredentialsWithResponseAsync( + String resourceGroupName, String resourceName, String serverFqdn) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listClusterMonitoringUserCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + serverFqdn, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterMonitoringUserCredentialsWithResponseAsync( + String resourceGroupName, String resourceName, String serverFqdn, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listClusterMonitoringUserCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + serverFqdn, + accept, + context); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterMonitoringUserCredentialsAsync( + String resourceGroupName, String resourceName, String serverFqdn) { + return listClusterMonitoringUserCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterMonitoringUserCredentialsAsync( + String resourceGroupName, String resourceName) { + final String serverFqdn = null; + return listClusterMonitoringUserCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialResultsInner listClusterMonitoringUserCredentials(String resourceGroupName, String resourceName) { + final String serverFqdn = null; + return listClusterMonitoringUserCredentialsAsync(resourceGroupName, resourceName, serverFqdn).block(); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterMonitoringUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context) { + return listClusterMonitoringUserCredentialsWithResponseAsync( + resourceGroupName, resourceName, serverFqdn, context) + .block(); + } + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + } + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, ManagedClusterInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, 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 (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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, ManagedClusterInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedClusterInner.class, + ManagedClusterInner.class, + Context.NONE); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedClusterInner.class, ManagedClusterInner.class, context); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, ManagedClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner createOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterInner parameters) { + return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster to create or update. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner createOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String resourceName, TagsObject 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String resourceName, TagsObject 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginUpdateTagsAsync( + String resourceGroupName, String resourceName, TagsObject parameters) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedClusterInner.class, + ManagedClusterInner.class, + Context.NONE); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ManagedClusterInner> beginUpdateTagsAsync( + String resourceGroupName, String resourceName, TagsObject parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedClusterInner.class, ManagedClusterInner.class, context); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginUpdateTags( + String resourceGroupName, String resourceName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ManagedClusterInner> beginUpdateTags( + String resourceGroupName, String resourceName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String resourceName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String resourceName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update Managed Cluster Tags operation. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterInner updateTags( + String resourceGroupName, String resourceName, TagsObject parameters, Context context) { + return updateTagsAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName) { + deleteAsync(resourceGroupName, resourceName).block(); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName, Context context) { + deleteAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetServicePrincipalProfileWithResponseAsync( + String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetServicePrincipalProfile( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetServicePrincipalProfileWithResponseAsync( + String resourceGroupName, + String resourceName, + ManagedClusterServicePrincipalProfile 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetServicePrincipalProfile( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResetServicePrincipalProfileAsync( + String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) { + Mono>> mono = + resetServicePrincipalProfileWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResetServicePrincipalProfileAsync( + String resourceGroupName, + String resourceName, + ManagedClusterServicePrincipalProfile parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resetServicePrincipalProfileWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginResetServicePrincipalProfile( + String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) { + return beginResetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginResetServicePrincipalProfile( + String resourceGroupName, + String resourceName, + ManagedClusterServicePrincipalProfile parameters, + Context context) { + return beginResetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters, context) + .getSyncPoller(); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetServicePrincipalProfileAsync( + String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) { + return beginResetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetServicePrincipalProfileAsync( + String resourceGroupName, + String resourceName, + ManagedClusterServicePrincipalProfile parameters, + Context context) { + return beginResetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetServicePrincipalProfile( + String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) { + resetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetServicePrincipalProfile( + String resourceGroupName, + String resourceName, + ManagedClusterServicePrincipalProfile parameters, + Context context) { + resetServicePrincipalProfileAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetAadProfileWithResponseAsync( + String resourceGroupName, String resourceName, ManagedClusterAadProfile 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resetAadProfile( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resetAadProfileWithResponseAsync( + String resourceGroupName, String resourceName, ManagedClusterAadProfile 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resetAadProfile( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResetAadProfileAsync( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters) { + Mono>> mono = + resetAadProfileWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResetAadProfileAsync( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resetAadProfileWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginResetAadProfile( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters) { + return beginResetAadProfileAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginResetAadProfile( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context) { + return beginResetAadProfileAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAadProfileAsync( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters) { + return beginResetAadProfileAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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 the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resetAadProfileAsync( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context) { + return beginResetAadProfileAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetAadProfile(String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters) { + resetAadProfileAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void resetAadProfile( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context) { + resetAadProfileAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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>> rotateClusterCertificatesWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rotateClusterCertificates( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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>> rotateClusterCertificatesWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rotateClusterCertificates( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginRotateClusterCertificatesAsync( + String resourceGroupName, String resourceName) { + Mono>> mono = + rotateClusterCertificatesWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginRotateClusterCertificatesAsync( + String resourceGroupName, String resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rotateClusterCertificatesWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginRotateClusterCertificates( + String resourceGroupName, String resourceName) { + return beginRotateClusterCertificatesAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginRotateClusterCertificates( + String resourceGroupName, String resourceName, Context context) { + return beginRotateClusterCertificatesAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 rotateClusterCertificatesAsync(String resourceGroupName, String resourceName) { + return beginRotateClusterCertificatesAsync(resourceGroupName, resourceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 rotateClusterCertificatesAsync(String resourceGroupName, String resourceName, Context context) { + return beginRotateClusterCertificatesAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 rotateClusterCertificates(String resourceGroupName, String resourceName) { + rotateClusterCertificatesAsync(resourceGroupName, resourceName).block(); + } + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 rotateClusterCertificates(String resourceGroupName, String resourceName, Context context) { + rotateClusterCertificatesAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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>> stopWithResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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>> stopWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStopAsync(String resourceGroupName, String resourceName) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStopAsync( + String resourceGroupName, String resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = stopWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStop(String resourceGroupName, String resourceName) { + return beginStopAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStop( + String resourceGroupName, String resourceName, Context context) { + return beginStopAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 stopAsync(String resourceGroupName, String resourceName) { + return beginStopAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 stopAsync(String resourceGroupName, String resourceName, Context context) { + return beginStopAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 stop(String resourceGroupName, String resourceName) { + stopAsync(resourceGroupName, resourceName).block(); + } + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 stop(String resourceGroupName, String resourceName, Context context) { + stopAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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>> startWithResponseAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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>> startWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStartAsync(String resourceGroupName, String resourceName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStartAsync( + String resourceGroupName, String resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStart(String resourceGroupName, String resourceName) { + return beginStartAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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> beginStart( + String resourceGroupName, String resourceName, Context context) { + return beginStartAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 startAsync(String resourceGroupName, String resourceName) { + return beginStartAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 startAsync(String resourceGroupName, String resourceName, Context context) { + return beginStartAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 start(String resourceGroupName, String resourceName) { + startAsync(resourceGroupName, resourceName).block(); + } + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 start(String resourceGroupName, String resourceName, Context context) { + startAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runCommandWithResponseAsync( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (requestPayload == null) { + return Mono.error(new IllegalArgumentException("Parameter requestPayload is required and cannot be null.")); + } else { + requestPayload.validate(); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .runCommand( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + requestPayload, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runCommandWithResponseAsync( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (requestPayload == null) { + return Mono.error(new IllegalArgumentException("Parameter requestPayload is required and cannot be null.")); + } else { + requestPayload.validate(); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .runCommand( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + requestPayload, + accept, + context); + } + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RunCommandResultInner> beginRunCommandAsync( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload) { + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, resourceName, requestPayload); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RunCommandResultInner.class, + RunCommandResultInner.class, + Context.NONE); + } + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RunCommandResultInner> beginRunCommandAsync( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + runCommandWithResponseAsync(resourceGroupName, resourceName, requestPayload, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RunCommandResultInner.class, RunCommandResultInner.class, context); + } + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload) { + return beginRunCommandAsync(resourceGroupName, resourceName, requestPayload).getSyncPoller(); + } + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RunCommandResultInner> beginRunCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload, Context context) { + return beginRunCommandAsync(resourceGroupName, resourceName, requestPayload, context).getSyncPoller(); + } + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runCommandAsync( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload) { + return beginRunCommandAsync(resourceGroupName, resourceName, requestPayload) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runCommandAsync( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload, Context context) { + return beginRunCommandAsync(resourceGroupName, resourceName, requestPayload, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner runCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload) { + return runCommandAsync(resourceGroupName, resourceName, requestPayload).block(); + } + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner runCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload, Context context) { + return runCommandAsync(resourceGroupName, resourceName, requestPayload, context).block(); + } + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @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 results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCommandResultWithResponseAsync( + String resourceGroupName, String resourceName, String commandId) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (commandId == null) { + return Mono.error(new IllegalArgumentException("Parameter commandId is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getCommandResult( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + commandId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @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 results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCommandResultWithResponseAsync( + String resourceGroupName, String resourceName, String commandId, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (commandId == null) { + return Mono.error(new IllegalArgumentException("Parameter commandId is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getCommandResult( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + commandId, + accept, + context); + } + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @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 results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCommandResultAsync( + String resourceGroupName, String resourceName, String commandId) { + return getCommandResultWithResponseAsync(resourceGroupName, resourceName, commandId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @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 results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunCommandResultInner getCommandResult(String resourceGroupName, String resourceName, String commandId) { + return getCommandResultAsync(resourceGroupName, resourceName, commandId).block(); + } + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @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 results of a command which has been run on the Managed Cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCommandResultWithResponse( + String resourceGroupName, String resourceName, String commandId, Context context) { + return getCommandResultWithResponseAsync(resourceGroupName, resourceName, commandId, context).block(); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. The operation returns properties of each egress endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsSinglePageAsync(String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listOutboundNetworkDependenciesEndpoints( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + 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 a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. The operation returns properties of each egress endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsSinglePageAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listOutboundNetworkDependenciesEndpoints( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. The operation returns properties of each egress endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOutboundNetworkDependenciesEndpointsAsync( + String resourceGroupName, String resourceName) { + return new PagedFlux<>( + () -> listOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, resourceName), + nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. The operation returns properties of each egress endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listOutboundNetworkDependenciesEndpointsAsync( + String resourceGroupName, String resourceName, Context context) { + return new PagedFlux<>( + () -> listOutboundNetworkDependenciesEndpointsSinglePageAsync(resourceGroupName, resourceName, context), + nextLink -> listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. The operation returns properties of each egress endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String resourceName) { + return new PagedIterable<>(listOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, resourceName)); + } + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. The operation returns properties of each egress endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>( + listOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, resourceName, context)); + } + + /** + * 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 the response from the List Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 the response from the List Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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 the response from the List Managed Clusters operation. + */ + @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 the response from the List Managed Clusters operation. + */ + @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 collection of OutboundEnvironmentEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(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 + .listOutboundNetworkDependenciesEndpointsNext( + 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 collection of OutboundEnvironmentEndpoint. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listOutboundNetworkDependenciesEndpointsNextSinglePageAsync(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 + .listOutboundNetworkDependenciesEndpointsNext(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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersImpl.java new file mode 100644 index 0000000000000..d37a5f7cc80f3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersImpl.java @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.ManagedClustersClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OSOptionProfileInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import com.azure.resourcemanager.containerservice.generated.models.ManagedCluster; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAadProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterUpgradeProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusters; +import com.azure.resourcemanager.containerservice.generated.models.OSOptionProfile; +import com.azure.resourcemanager.containerservice.generated.models.OutboundEnvironmentEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandResult; +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.containerservice.generated.ContainerServiceManager serviceManager; + + public ManagedClustersImpl( + ManagedClustersClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OSOptionProfile getOSOptions(String location) { + OSOptionProfileInner inner = this.serviceClient().getOSOptions(location); + if (inner != null) { + return new OSOptionProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getOSOptionsWithResponse(String location, String resourceType, Context context) { + Response inner = + this.serviceClient().getOSOptionsWithResponse(location, resourceType, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OSOptionProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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 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 ManagedClusterUpgradeProfile getUpgradeProfile(String resourceGroupName, String resourceName) { + ManagedClusterUpgradeProfileInner inner = + this.serviceClient().getUpgradeProfile(resourceGroupName, resourceName); + if (inner != null) { + return new ManagedClusterUpgradeProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getUpgradeProfileWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getUpgradeProfileWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedClusterUpgradeProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ManagedClusterAccessProfile getAccessProfile( + String resourceGroupName, String resourceName, String roleName) { + ManagedClusterAccessProfileInner inner = + this.serviceClient().getAccessProfile(resourceGroupName, resourceName, roleName); + if (inner != null) { + return new ManagedClusterAccessProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAccessProfileWithResponse( + String resourceGroupName, String resourceName, String roleName, Context context) { + Response inner = + this.serviceClient().getAccessProfileWithResponse(resourceGroupName, resourceName, roleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedClusterAccessProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CredentialResults listClusterAdminCredentials(String resourceGroupName, String resourceName) { + CredentialResultsInner inner = + this.serviceClient().listClusterAdminCredentials(resourceGroupName, resourceName); + if (inner != null) { + return new CredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterAdminCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context) { + Response inner = + this + .serviceClient() + .listClusterAdminCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CredentialResultsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CredentialResults listClusterUserCredentials(String resourceGroupName, String resourceName) { + CredentialResultsInner inner = this.serviceClient().listClusterUserCredentials(resourceGroupName, resourceName); + if (inner != null) { + return new CredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context) { + Response inner = + this + .serviceClient() + .listClusterUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CredentialResultsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CredentialResults listClusterMonitoringUserCredentials(String resourceGroupName, String resourceName) { + CredentialResultsInner inner = + this.serviceClient().listClusterMonitoringUserCredentials(resourceGroupName, resourceName); + if (inner != null) { + return new CredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterMonitoringUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context) { + Response inner = + this + .serviceClient() + .listClusterMonitoringUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CredentialResultsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ManagedCluster getByResourceGroup(String resourceGroupName, String resourceName) { + ManagedClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new ManagedClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public void delete(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, context); + } + + public void resetServicePrincipalProfile( + String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) { + this.serviceClient().resetServicePrincipalProfile(resourceGroupName, resourceName, parameters); + } + + public void resetServicePrincipalProfile( + String resourceGroupName, + String resourceName, + ManagedClusterServicePrincipalProfile parameters, + Context context) { + this.serviceClient().resetServicePrincipalProfile(resourceGroupName, resourceName, parameters, context); + } + + public void resetAadProfile(String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters) { + this.serviceClient().resetAadProfile(resourceGroupName, resourceName, parameters); + } + + public void resetAadProfile( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context) { + this.serviceClient().resetAadProfile(resourceGroupName, resourceName, parameters, context); + } + + public void rotateClusterCertificates(String resourceGroupName, String resourceName) { + this.serviceClient().rotateClusterCertificates(resourceGroupName, resourceName); + } + + public void rotateClusterCertificates(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().rotateClusterCertificates(resourceGroupName, resourceName, context); + } + + public void stop(String resourceGroupName, String resourceName) { + this.serviceClient().stop(resourceGroupName, resourceName); + } + + public void stop(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().stop(resourceGroupName, resourceName, context); + } + + public void start(String resourceGroupName, String resourceName) { + this.serviceClient().start(resourceGroupName, resourceName); + } + + public void start(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().start(resourceGroupName, resourceName, context); + } + + public RunCommandResult runCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload) { + RunCommandResultInner inner = this.serviceClient().runCommand(resourceGroupName, resourceName, requestPayload); + if (inner != null) { + return new RunCommandResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public RunCommandResult runCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload, Context context) { + RunCommandResultInner inner = + this.serviceClient().runCommand(resourceGroupName, resourceName, requestPayload, context); + if (inner != null) { + return new RunCommandResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public RunCommandResult getCommandResult(String resourceGroupName, String resourceName, String commandId) { + RunCommandResultInner inner = this.serviceClient().getCommandResult(resourceGroupName, resourceName, commandId); + if (inner != null) { + return new RunCommandResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getCommandResultWithResponse( + String resourceGroupName, String resourceName, String commandId, Context context) { + Response inner = + this.serviceClient().getCommandResultWithResponse(resourceGroupName, resourceName, commandId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RunCommandResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String resourceName) { + PagedIterable inner = + this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, resourceName); + return Utils.mapPage(inner, inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); + } + + public PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = + this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, resourceName, context); + return Utils.mapPage(inner, inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); + } + + 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + this.delete(resourceGroupName, resourceName, 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 resourceName = Utils.getValueFromIdByName(id, "managedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'managedClusters'.", id))); + } + this.delete(resourceGroupName, resourceName, context); + } + + private ManagedClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public ManagedClusterImpl define(String name) { + return new ManagedClusterImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OSOptionProfileImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OSOptionProfileImpl.java new file mode 100644 index 0000000000000..3958239a65207 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OSOptionProfileImpl.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.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OSOptionProfileInner; +import com.azure.resourcemanager.containerservice.generated.models.OSOptionProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSOptionProperty; +import java.util.Collections; +import java.util.List; + +public final class OSOptionProfileImpl implements OSOptionProfile { + private OSOptionProfileInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + OSOptionProfileImpl( + OSOptionProfileInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List osOptionPropertyList() { + List inner = this.innerModel().osOptionPropertyList(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OSOptionProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClusterImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClusterImpl.java new file mode 100644 index 0000000000000..e1e9494025f0e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClusterImpl.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.containerservice.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OpenShiftManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.models.NetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedCluster; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterAuthProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterMasterPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftRouterProfile; +import com.azure.resourcemanager.containerservice.generated.models.PurchasePlan; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class OpenShiftManagedClusterImpl + implements OpenShiftManagedCluster, OpenShiftManagedCluster.Definition, OpenShiftManagedCluster.Update { + private OpenShiftManagedClusterInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager 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 PurchasePlan plan() { + return this.innerModel().plan(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String openShiftVersion() { + return this.innerModel().openShiftVersion(); + } + + public String clusterVersion() { + return this.innerModel().clusterVersion(); + } + + public String publicHostname() { + return this.innerModel().publicHostname(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public NetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public List routerProfiles() { + List inner = this.innerModel().routerProfiles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OpenShiftManagedClusterMasterPoolProfile masterPoolProfile() { + return this.innerModel().masterPoolProfile(); + } + + public List agentPoolProfiles() { + List inner = this.innerModel().agentPoolProfiles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OpenShiftManagedClusterAuthProfile authProfile() { + return this.innerModel().authProfile(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public OpenShiftManagedClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private TagsObject updateParameters; + + public OpenShiftManagedClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public OpenShiftManagedCluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getOpenShiftManagedClusters() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), Context.NONE); + return this; + } + + public OpenShiftManagedCluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOpenShiftManagedClusters() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), context); + return this; + } + + OpenShiftManagedClusterImpl( + String name, com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new OpenShiftManagedClusterInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public OpenShiftManagedClusterImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public OpenShiftManagedCluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getOpenShiftManagedClusters() + .updateTags(resourceGroupName, resourceName, updateParameters, Context.NONE); + return this; + } + + public OpenShiftManagedCluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOpenShiftManagedClusters() + .updateTags(resourceGroupName, resourceName, updateParameters, context); + return this; + } + + OpenShiftManagedClusterImpl( + OpenShiftManagedClusterInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "openShiftManagedClusters"); + } + + public OpenShiftManagedCluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getOpenShiftManagedClusters() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public OpenShiftManagedCluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getOpenShiftManagedClusters() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public OpenShiftManagedClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public OpenShiftManagedClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public OpenShiftManagedClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public OpenShiftManagedClusterImpl withPlan(PurchasePlan plan) { + this.innerModel().withPlan(plan); + return this; + } + + public OpenShiftManagedClusterImpl withOpenShiftVersion(String openShiftVersion) { + this.innerModel().withOpenShiftVersion(openShiftVersion); + return this; + } + + public OpenShiftManagedClusterImpl withNetworkProfile(NetworkProfile networkProfile) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } + + public OpenShiftManagedClusterImpl withRouterProfiles(List routerProfiles) { + this.innerModel().withRouterProfiles(routerProfiles); + return this; + } + + public OpenShiftManagedClusterImpl withMasterPoolProfile( + OpenShiftManagedClusterMasterPoolProfile masterPoolProfile) { + this.innerModel().withMasterPoolProfile(masterPoolProfile); + return this; + } + + public OpenShiftManagedClusterImpl withAgentPoolProfiles( + List agentPoolProfiles) { + this.innerModel().withAgentPoolProfiles(agentPoolProfiles); + return this; + } + + public OpenShiftManagedClusterImpl withAuthProfile(OpenShiftManagedClusterAuthProfile authProfile) { + this.innerModel().withAuthProfile(authProfile); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClustersClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClustersClientImpl.java new file mode 100644 index 0000000000000..458b374cbaac3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClustersClientImpl.java @@ -0,0 +1,1561 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.OpenShiftManagedClustersClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OpenShiftManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterListResult; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +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 OpenShiftManagedClustersClient. */ +public final class OpenShiftManagedClustersClientImpl implements OpenShiftManagedClustersClient { + private final ClientLogger logger = new ClientLogger(OpenShiftManagedClustersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OpenShiftManagedClustersService service; + + /** The service client containing this operation class. */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of OpenShiftManagedClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OpenShiftManagedClustersClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy + .create(OpenShiftManagedClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientOpenShiftManagedClusters to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface OpenShiftManagedClustersService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters") + @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.ContainerService" + + "/openShiftManagedClusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/openShiftManagedClusters/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/openShiftManagedClusters/{resourceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") OpenShiftManagedClusterInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/openShiftManagedClusters/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/openShiftManagedClusters/{resourceName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @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> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each + * OpenShift managed cluster. + * + * @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 list of OpenShift managed clusters in the specified 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 = "2019-04-30"; + 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 a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each + * OpenShift managed 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 a list of OpenShift managed clusters in the specified 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 = "2019-04-30"; + 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 a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each + * OpenShift managed cluster. + * + * @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 list of OpenShift managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each + * OpenShift managed 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 a list of OpenShift managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each + * OpenShift managed cluster. + * + * @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 list of OpenShift managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each + * OpenShift managed 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 a list of OpenShift managed clusters in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns + * properties of each OpenShift managed cluster. + * + * @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 the response from the List OpenShift Managed Clusters operation. + */ + @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 (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.")); + } + final String apiVersion = "2019-04-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + 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())); + } + + /** + * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns + * properties of each OpenShift managed cluster. + * + * @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 the response from the List OpenShift Managed Clusters operation. + */ + @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 (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.")); + } + final String apiVersion = "2019-04-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns + * properties of each OpenShift managed cluster. + * + * @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 the response from the List OpenShift Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns + * properties of each OpenShift managed cluster. + * + * @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 the response from the List OpenShift Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns + * properties of each OpenShift managed cluster. + * + * @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 the response from the List OpenShift Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns + * properties of each OpenShift managed cluster. + * + * @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 the response from the List OpenShift Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 details of the managed OpenShift cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2019-04-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 details of the managed OpenShift cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2019-04-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 details of the managed OpenShift cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 details of the managed OpenShift cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenShiftManagedClusterInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + } + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 details of the managed OpenShift cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2019-04-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2019-04-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OpenShiftManagedClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OpenShiftManagedClusterInner.class, + OpenShiftManagedClusterInner.class, + Context.NONE); + } + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OpenShiftManagedClusterInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OpenShiftManagedClusterInner.class, + OpenShiftManagedClusterInner.class, + context); + } + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OpenShiftManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OpenShiftManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenShiftManagedClusterInner createOrUpdate( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters) { + return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Creates or updates a OpenShift managed cluster with the specified configuration for agents and OpenShift version. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Create or Update an OpenShift Managed Cluster operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenShiftManagedClusterInner createOrUpdate( + String resourceGroupName, String resourceName, OpenShiftManagedClusterInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String resourceName, TagsObject 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2019-04-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String resourceName, TagsObject 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2019-04-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OpenShiftManagedClusterInner> beginUpdateTagsAsync( + String resourceGroupName, String resourceName, TagsObject parameters) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OpenShiftManagedClusterInner.class, + OpenShiftManagedClusterInner.class, + Context.NONE); + } + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OpenShiftManagedClusterInner> beginUpdateTagsAsync( + String resourceGroupName, String resourceName, TagsObject parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OpenShiftManagedClusterInner.class, + OpenShiftManagedClusterInner.class, + context); + } + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OpenShiftManagedClusterInner> beginUpdateTags( + String resourceGroupName, String resourceName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OpenShiftManagedClusterInner> beginUpdateTags( + String resourceGroupName, String resourceName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String resourceName, TagsObject parameters) { + return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String resourceName, TagsObject parameters, Context context) { + return beginUpdateTagsAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags 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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenShiftManagedClusterInner updateTags( + String resourceGroupName, String resourceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Updates an OpenShift managed cluster with the specified tags. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed cluster resource. + * @param parameters Parameters supplied to the Update OpenShift Managed Cluster Tags operation. + * @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 openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OpenShiftManagedClusterInner updateTags( + String resourceGroupName, String resourceName, TagsObject parameters, Context context) { + return updateTagsAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2019-04-30"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2019-04-30"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName) { + deleteAsync(resourceGroupName, resourceName).block(); + } + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName, Context context) { + deleteAsync(resourceGroupName, resourceName, 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 the response from the List OpenShift Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 the response from the List OpenShift Managed Clusters operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + 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 + .listNext(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 the response from the List OpenShift Managed Clusters operation. + */ + @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 the response from the List OpenShift Managed Clusters operation. + */ + @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)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClustersImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClustersImpl.java new file mode 100644 index 0000000000000..8cde7c3a68555 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClustersImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.OpenShiftManagedClustersClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OpenShiftManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedCluster; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OpenShiftManagedClustersImpl implements OpenShiftManagedClusters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClustersImpl.class); + + private final OpenShiftManagedClustersClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public OpenShiftManagedClustersImpl( + OpenShiftManagedClustersClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OpenShiftManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OpenShiftManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new OpenShiftManagedClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new OpenShiftManagedClusterImpl(inner1, this.manager())); + } + + public OpenShiftManagedCluster getByResourceGroup(String resourceGroupName, String resourceName) { + OpenShiftManagedClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new OpenShiftManagedClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OpenShiftManagedClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public void delete(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, context); + } + + public OpenShiftManagedCluster 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 resourceName = Utils.getValueFromIdByName(id, "openShiftManagedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'openShiftManagedClusters'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = Utils.getValueFromIdByName(id, "openShiftManagedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'openShiftManagedClusters'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = Utils.getValueFromIdByName(id, "openShiftManagedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'openShiftManagedClusters'.", + id))); + } + this.delete(resourceGroupName, resourceName, 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 resourceName = Utils.getValueFromIdByName(id, "openShiftManagedClusters"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'openShiftManagedClusters'.", + id))); + } + this.delete(resourceGroupName, resourceName, context); + } + + private OpenShiftManagedClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public OpenShiftManagedClusterImpl define(String name) { + return new OpenShiftManagedClusterImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationValueImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationValueImpl.java new file mode 100644 index 0000000000000..21df82661f94f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationValueImpl.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.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; +import com.azure.resourcemanager.containerservice.generated.models.OperationValue; + +public final class OperationValueImpl implements OperationValue { + private OperationValueInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + OperationValueImpl( + OperationValueInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String origin() { + return this.innerModel().origin(); + } + + public String name() { + return this.innerModel().name(); + } + + public String operation() { + return this.innerModel().operation(); + } + + public String resource() { + return this.innerModel().resource(); + } + + public String description() { + return this.innerModel().description(); + } + + public String provider() { + return this.innerModel().provider(); + } + + public OperationValueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..e3f3c238e2d37 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; +import com.azure.resourcemanager.containerservice.generated.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ContainerService/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of 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 a list of 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 = "2021-08-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(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of 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 a list of 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 = "2021-08-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(), null, null)); + } + + /** + * Gets a list of 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 a list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Gets a list of 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 a list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Gets a list of 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 a list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of 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 a list of operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..7d9c8ad4d72ea --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.OperationsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; +import com.azure.resourcemanager.containerservice.generated.models.OperationValue; +import com.azure.resourcemanager.containerservice.generated.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationValueImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationValueImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OrchestratorVersionProfileListResultImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OrchestratorVersionProfileListResultImpl.java new file mode 100644 index 0000000000000..44cdb7333b3c9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OrchestratorVersionProfileListResultImpl.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.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OrchestratorVersionProfileListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.OrchestratorVersionProfile; +import com.azure.resourcemanager.containerservice.generated.models.OrchestratorVersionProfileListResult; +import java.util.Collections; +import java.util.List; + +public final class OrchestratorVersionProfileListResultImpl implements OrchestratorVersionProfileListResult { + private OrchestratorVersionProfileListResultInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + OrchestratorVersionProfileListResultImpl( + OrchestratorVersionProfileListResultInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List orchestrators() { + List inner = this.innerModel().orchestrators(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OrchestratorVersionProfileListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OutboundEnvironmentEndpointImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OutboundEnvironmentEndpointImpl.java new file mode 100644 index 0000000000000..4e4fa837461ee --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OutboundEnvironmentEndpointImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import com.azure.resourcemanager.containerservice.generated.models.EndpointDependency; +import com.azure.resourcemanager.containerservice.generated.models.OutboundEnvironmentEndpoint; +import java.util.Collections; +import java.util.List; + +public final class OutboundEnvironmentEndpointImpl implements OutboundEnvironmentEndpoint { + private OutboundEnvironmentEndpointInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + OutboundEnvironmentEndpointImpl( + OutboundEnvironmentEndpointInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String category() { + return this.innerModel().category(); + } + + public List endpoints() { + List inner = this.innerModel().endpoints(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public OutboundEnvironmentEndpointInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..77afcf6d8169a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionListResultImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionListResultImpl.java new file mode 100644 index 0000000000000..f9f390e2e0a2c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionListResultImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateEndpointConnectionListResultImpl implements PrivateEndpointConnectionListResult { + private PrivateEndpointConnectionListResultInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + PrivateEndpointConnectionListResultImpl( + PrivateEndpointConnectionListResultInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpointConnectionListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..8527ed4f70ddb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,926 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.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.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.containerservice.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; +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 PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientPrivateEndpointConnections to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String resourceName) { + return listWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionListResultInner list(String resourceGroupName, String resourceName) { + return listAsync(resourceGroupName, resourceName).block(); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String resourceName, Context context) { + return listWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, resourceName, privateEndpointConnectionName).block(); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context).block(); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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 = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + parameters, + accept, + context); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return updateWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner update( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return updateAsync(resourceGroupName, resourceName, privateEndpointConnectionName, parameters).block(); + } + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @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 private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, resourceName, privateEndpointConnectionName, parameters, context) + .block(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).block(); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context).block(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..d471cde3ccb1f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnection; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnectionListResult list(String resourceGroupName, String resourceName) { + PrivateEndpointConnectionListResultInner inner = this.serviceClient().list(resourceGroupName, resourceName); + if (inner != null) { + return new PrivateEndpointConnectionListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection get( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, resourceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection update( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + PrivateEndpointConnectionInner inner = + this.serviceClient().update(resourceGroupName, resourceName, privateEndpointConnectionName, parameters); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse( + resourceGroupName, resourceName, privateEndpointConnectionName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourceImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..5a19b1c0096e5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String privateLinkServiceId() { + return this.innerModel().privateLinkServiceId(); + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..4e2a4b0a1eb6a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientPrivateLinkResources to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String resourceName) { + return listWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourcesListResultInner list(String resourceGroupName, String resourceName) { + return listAsync(resourceGroupName, resourceName).block(); + } + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String resourceName, Context context) { + return listWithResponseAsync(resourceGroupName, resourceName, context).block(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..21c1d272ff475 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResources; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResourcesListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateLinkResourcesListResult list(String resourceGroupName, String resourceName) { + PrivateLinkResourcesListResultInner inner = this.serviceClient().list(resourceGroupName, resourceName); + if (inner != null) { + return new PrivateLinkResourcesListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourcesListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesListResultImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesListResultImpl.java new file mode 100644 index 0000000000000..19a0adca83997 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesListResultImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResourcesListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class PrivateLinkResourcesListResultImpl implements PrivateLinkResourcesListResult { + private PrivateLinkResourcesListResultInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + PrivateLinkResourcesListResultImpl( + PrivateLinkResourcesListResultInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourcesListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsClientImpl.java new file mode 100644 index 0000000000000..5e56c6e0dcab7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsClientImpl.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +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.Post; +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.containerservice.generated.fluent.ResolvePrivateLinkServiceIdsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResolvePrivateLinkServiceIdsClient. */ +public final class ResolvePrivateLinkServiceIdsClientImpl implements ResolvePrivateLinkServiceIdsClient { + private final ClientLogger logger = new ClientLogger(ResolvePrivateLinkServiceIdsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ResolvePrivateLinkServiceIdsService service; + + /** The service client containing this operation class. */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of ResolvePrivateLinkServiceIdsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResolvePrivateLinkServiceIdsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy + .create( + ResolvePrivateLinkServiceIdsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientResolvePrivateLinkServiceIds to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface ResolvePrivateLinkServiceIdsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedClusters/{resourceName}/resolvePrivateLinkServiceId") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> post( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") PrivateLinkResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @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 private link service ID for the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> postWithResponseAsync( + String resourceGroupName, String resourceName, PrivateLinkResourceInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .post( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @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 private link service ID for the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> postWithResponseAsync( + String resourceGroupName, String resourceName, PrivateLinkResourceInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .post( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @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 private link service ID for the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postAsync( + String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters) { + return postWithResponseAsync(resourceGroupName, resourceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @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 private link service ID for the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner post( + String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters) { + return postAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service ID. + * @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 private link service ID for the specified managed cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postWithResponse( + String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters, Context context) { + return postWithResponseAsync(resourceGroupName, resourceName, parameters, context).block(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsImpl.java new file mode 100644 index 0000000000000..c49a830d7ab0d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.ResolvePrivateLinkServiceIdsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkResource; +import com.azure.resourcemanager.containerservice.generated.models.ResolvePrivateLinkServiceIds; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ResolvePrivateLinkServiceIdsImpl implements ResolvePrivateLinkServiceIds { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResolvePrivateLinkServiceIdsImpl.class); + + private final ResolvePrivateLinkServiceIdsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public ResolvePrivateLinkServiceIdsImpl( + ResolvePrivateLinkServiceIdsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateLinkResource post( + String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters) { + PrivateLinkResourceInner inner = this.serviceClient().post(resourceGroupName, resourceName, parameters); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response postWithResponse( + String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters, Context context) { + Response inner = + this.serviceClient().postWithResponse(resourceGroupName, resourceName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ResolvePrivateLinkServiceIdsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/RunCommandResultImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/RunCommandResultImpl.java new file mode 100644 index 0000000000000..d0739ec1ddb2d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/RunCommandResultImpl.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.containerservice.generated.implementation; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandResult; +import java.time.OffsetDateTime; + +public final class RunCommandResultImpl implements RunCommandResult { + private RunCommandResultInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + RunCommandResultImpl( + RunCommandResultInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public Integer exitCode() { + return this.innerModel().exitCode(); + } + + public OffsetDateTime startedAt() { + return this.innerModel().startedAt(); + } + + public OffsetDateTime finishedAt() { + return this.innerModel().finishedAt(); + } + + public String logs() { + return this.innerModel().logs(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public RunCommandResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotImpl.java new file mode 100644 index 0000000000000..d499aa2e0ce55 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotImpl.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class SnapshotImpl implements Snapshot, Snapshot.Definition, Snapshot.Update { + private SnapshotInner innerObject; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public CreationData creationData() { + return this.innerModel().creationData(); + } + + public SnapshotType snapshotType() { + return this.innerModel().snapshotType(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SnapshotInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private TagsObject updateParameters; + + public SnapshotImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Snapshot create() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Snapshot create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), context) + .getValue(); + return this; + } + + SnapshotImpl( + String name, com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new SnapshotInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public SnapshotImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public Snapshot apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .updateTagsWithResponse(resourceGroupName, resourceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Snapshot apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .updateTagsWithResponse(resourceGroupName, resourceName, updateParameters, context) + .getValue(); + return this; + } + + SnapshotImpl( + SnapshotInner innerObject, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "snapshots"); + } + + public Snapshot refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public Snapshot refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public SnapshotImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SnapshotImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SnapshotImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public SnapshotImpl withCreationData(CreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } + + public SnapshotImpl withSnapshotType(SnapshotType snapshotType) { + this.innerModel().withSnapshotType(snapshotType); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsClientImpl.java new file mode 100644 index 0000000000000..898a5ab56cd0a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsClientImpl.java @@ -0,0 +1,1243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.SnapshotsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotListResult; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SnapshotsClient. */ +public final class SnapshotsClientImpl implements SnapshotsClient { + private final ClientLogger logger = new ClientLogger(SnapshotsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SnapshotsService service; + + /** The service client containing this operation class. */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of SnapshotsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SnapshotsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy.create(SnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientSnapshots to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface SnapshotsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots") + @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.ContainerService" + + "/snapshots") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/snapshots/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/snapshots/{resourceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") SnapshotInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/snapshots/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateTags( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") TagsObject parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/snapshots/{resourceName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @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> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of snapshots in the specified 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 a list of snapshots in the specified 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 = "2021-08-01"; + 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 a list of snapshots in the specified 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 a list of snapshots in the specified 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 = "2021-08-01"; + 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 a list of snapshots in the specified 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 a list of snapshots in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of snapshots in the specified 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 a list of snapshots in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of snapshots in the specified 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 a list of snapshots in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of snapshots in the specified 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 a list of snapshots in the specified subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists snapshots in the specified subscription and 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 the response from the List Snapshots operation. + */ + @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 (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.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + 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())); + } + + /** + * Lists snapshots in the specified subscription and 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 the response from the List Snapshots operation. + */ + @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 (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.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists snapshots in the specified subscription and 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 the response from the List Snapshots operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists snapshots in the specified subscription and 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 the response from the List Snapshots operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists snapshots in the specified subscription and 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 the response from the List Snapshots operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists snapshots in the specified subscription and 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 the response from the List Snapshots operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + } + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, SnapshotInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, SnapshotInner 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, SnapshotInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner createOrUpdate(String resourceGroupName, String resourceName, SnapshotInner parameters) { + return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Creates or updates a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The snapshot to create or update. + * @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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String resourceName, SnapshotInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags 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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String resourceName, TagsObject 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags operation. + * @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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateTagsWithResponseAsync( + String resourceGroupName, String resourceName, TagsObject 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName 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 = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags 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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync(String resourceGroupName, String resourceName, TagsObject parameters) { + return updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags 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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Updates tags on a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update snapshot Tags operation. + * @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 node pool snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String resourceName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName) { + 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName, 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 (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String apiVersion = "2021-08-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName) { + return deleteWithResponseAsync(resourceGroupName, resourceName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName) { + deleteAsync(resourceGroupName, resourceName).block(); + } + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String resourceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, resourceName, 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 the response from the List Snapshots operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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.listNext(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 the response from the List Snapshots operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(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 + .listNext(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 the response from the List Snapshots operation. + */ + @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 the response from the List Snapshots operation. + */ + @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)); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsImpl.java new file mode 100644 index 0000000000000..37c6efcfc9a35 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsImpl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.containerservice.generated.fluent.SnapshotsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import com.azure.resourcemanager.containerservice.generated.models.Snapshots; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SnapshotsImpl implements Snapshots { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotsImpl.class); + + private final SnapshotsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public SnapshotsImpl( + SnapshotsClient innerClient, + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public Snapshot getByResourceGroup(String resourceGroupName, String resourceName) { + SnapshotInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new SnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SnapshotImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public Response deleteWithResponse(String resourceGroupName, String resourceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, context); + } + + public Snapshot 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 resourceName = Utils.getValueFromIdByName(id, "snapshots"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = Utils.getValueFromIdByName(id, "snapshots"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = Utils.getValueFromIdByName(id, "snapshots"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + this.deleteWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + public Response 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 resourceName = Utils.getValueFromIdByName(id, "snapshots"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.deleteWithResponse(resourceGroupName, resourceName, context); + } + + private SnapshotsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public SnapshotImpl define(String name) { + return new SnapshotImpl(name, this.manager()); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/Utils.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/Utils.java new file mode 100644 index 0000000000000..c519865337e72 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.implementation; + +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.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/package-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/package-info.java new file mode 100644 index 0000000000000..8f8c9fbd74000 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for ContainerServiceManagementClient. Container Service Client. */ +package com.azure.resourcemanager.containerservice.generated.implementation; diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPool.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPool.java new file mode 100644 index 0000000000000..2c76e4512b247 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPool.java @@ -0,0 +1,1420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of AgentPool. */ +public interface AgentPool { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of + * 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default + * value is 1. + * + * @return the count value. + */ + Integer count(); + + /** + * Gets the vmSize property: The size of the agent pool VMs. VM size availability varies by region. If a node + * contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + * restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in the + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + * + * @return the osDiskSizeGB value. + */ + Integer osDiskSizeGB(); + + /** + * Gets the osDiskType property: The OS disk type to be used for machines in the agent pool. The default is + * 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + * defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + * + * @return the osDiskType value. + */ + OSDiskType osDiskType(); + + /** + * Gets the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * + * @return the kubeletDiskType value. + */ + KubeletDiskType kubeletDiskType(); + + /** + * Gets the vnetSubnetId property: The ID of the subnet which agent pool nodes and optionally pods will join on + * startup. If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, + * this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @return the vnetSubnetId value. + */ + String vnetSubnetId(); + + /** + * Gets the podSubnetId property: The ID of the subnet which pods will join when launched. If omitted, pod IPs are + * statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @return the podSubnetId value. + */ + String podSubnetId(); + + /** + * Gets the maxPods property: The maximum number of pods that can run on a node. + * + * @return the maxPods value. + */ + Integer maxPods(); + + /** + * Gets the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @return the osType value. + */ + OSType osType(); + + /** + * Gets the osSku property: Specifies an OS SKU. This value must not be specified if OSType is Windows. + * + * @return the osSku value. + */ + Ossku osSku(); + + /** + * Gets the maxCount property: The maximum number of nodes for auto-scaling. + * + * @return the maxCount value. + */ + Integer maxCount(); + + /** + * Gets the minCount property: The minimum number of nodes for auto-scaling. + * + * @return the minCount value. + */ + Integer minCount(); + + /** + * Gets the enableAutoScaling property: Whether to enable auto-scaler. + * + * @return the enableAutoScaling value. + */ + Boolean enableAutoScaling(); + + /** + * Gets the scaleDownMode property: This also effects the cluster autoscaler behavior. If not specified, it defaults + * to Delete. + * + * @return the scaleDownMode value. + */ + ScaleDownMode scaleDownMode(); + + /** + * Gets the typePropertiesType property: The type of Agent Pool. + * + * @return the typePropertiesType value. + */ + AgentPoolType typePropertiesType(); + + /** + * Gets the mode property: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at all + * times. For additional information on agent pool restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools. + * + * @return the mode value. + */ + AgentPoolMode mode(); + + /** + * Gets the orchestratorVersion property: The version of Kubernetes running on the Agent Pool. As a best practice, + * you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must + * have the same major version as the control plane. The node pool minor version must be within two minor versions + * of the control plane version. The node pool version cannot be greater than the control plane version. For more + * information see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + * + * @return the orchestratorVersion value. + */ + String orchestratorVersion(); + + /** + * Gets the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + String nodeImageVersion(); + + /** + * Gets the upgradeSettings property: Settings for upgrading the agentpool. + * + * @return the upgradeSettings value. + */ + AgentPoolUpgradeSettings upgradeSettings(); + + /** + * Gets the provisioningState property: The current deployment or provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the powerState property: Describes whether the Agent Pool is Running or Stopped. + * + * @return the powerState value. + */ + PowerState powerState(); + + /** + * Gets the availabilityZones property: The list of Availability zones to use for nodes. This can only be specified + * if the AgentPoolType property is 'VirtualMachineScaleSets'. + * + * @return the availabilityZones value. + */ + List availabilityZones(); + + /** + * Gets the enableNodePublicIp property: Whether each node is allocated its own public IP. Some scenarios may + * require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming + * workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For + * more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false. + * + * @return the enableNodePublicIp value. + */ + Boolean enableNodePublicIp(); + + /** + * Gets the nodePublicIpPrefixId property: The public IP prefix ID which VM nodes should use IPs from. This is of + * the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @return the nodePublicIpPrefixId value. + */ + String nodePublicIpPrefixId(); + + /** + * Gets the scaleSetPriority property: The Virtual Machine Scale Set priority. If not specified, the default is + * 'Regular'. + * + * @return the scaleSetPriority value. + */ + ScaleSetPriority scaleSetPriority(); + + /** + * Gets the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. This cannot be specified + * unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + * + * @return the scaleSetEvictionPolicy value. + */ + ScaleSetEvictionPolicy scaleSetEvictionPolicy(); + + /** + * Gets the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any + * on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + * + * @return the spotMaxPrice value. + */ + Float spotMaxPrice(); + + /** + * Gets the tags property: The tags to be persisted on the agent pool virtual machine scale set. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the nodeLabels property: The node labels to be persisted across all nodes in agent pool. + * + * @return the nodeLabels value. + */ + Map nodeLabels(); + + /** + * Gets the nodeTaints property: The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * + * @return the nodeTaints value. + */ + List nodeTaints(); + + /** + * Gets the proximityPlacementGroupId property: The ID for Proximity Placement Group. + * + * @return the proximityPlacementGroupId value. + */ + String proximityPlacementGroupId(); + + /** + * Gets the kubeletConfig property: Kubelet configurations of agent nodes. The Kubelet configuration on the agent + * pool nodes. + * + * @return the kubeletConfig value. + */ + KubeletConfig kubeletConfig(); + + /** + * Gets the linuxOSConfig property: OS configurations of Linux agent nodes. The OS configuration of Linux agent + * nodes. + * + * @return the linuxOSConfig value. + */ + LinuxOSConfig linuxOSConfig(); + + /** + * Gets the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. This is only + * supported on certain VM sizes and in certain Azure regions. For more information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption. + * + * @return the enableEncryptionAtHost value. + */ + Boolean enableEncryptionAtHost(); + + /** + * Gets the enableUltraSsd property: Whether to enable UltraSSD. + * + * @return the enableUltraSsd value. + */ + Boolean enableUltraSsd(); + + /** + * Gets the enableFips property: Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more + * details. + * + * @return the enableFips value. + */ + Boolean enableFips(); + + /** + * Gets the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + * + * @return the gpuInstanceProfile value. + */ + GpuInstanceProfile gpuInstanceProfile(); + + /** + * Gets the creationData property: CreationData to be used to specify the source Snapshot ID if the node pool will + * be created/upgraded using a snapshot. + * + * @return the creationData value. + */ + CreationData creationData(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner object. + * + * @return the inner object. + */ + AgentPoolInner innerModel(); + + /** The entirety of the AgentPool definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AgentPool definition stages. */ + interface DefinitionStages { + /** The first stage of the AgentPool definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AgentPool definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @return the next definition stage. + */ + WithCreate withExistingManagedCluster(String resourceGroupName, String resourceName); + } + /** + * The stage of the AgentPool 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.WithCount, + DefinitionStages.WithVmSize, + DefinitionStages.WithOsDiskSizeGB, + DefinitionStages.WithOsDiskType, + DefinitionStages.WithKubeletDiskType, + DefinitionStages.WithVnetSubnetId, + DefinitionStages.WithPodSubnetId, + DefinitionStages.WithMaxPods, + DefinitionStages.WithOsType, + DefinitionStages.WithOsSku, + DefinitionStages.WithMaxCount, + DefinitionStages.WithMinCount, + DefinitionStages.WithEnableAutoScaling, + DefinitionStages.WithScaleDownMode, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithMode, + DefinitionStages.WithOrchestratorVersion, + DefinitionStages.WithUpgradeSettings, + DefinitionStages.WithAvailabilityZones, + DefinitionStages.WithEnableNodePublicIp, + DefinitionStages.WithNodePublicIpPrefixId, + DefinitionStages.WithScaleSetPriority, + DefinitionStages.WithScaleSetEvictionPolicy, + DefinitionStages.WithSpotMaxPrice, + DefinitionStages.WithNodeLabels, + DefinitionStages.WithNodeTaints, + DefinitionStages.WithProximityPlacementGroupId, + DefinitionStages.WithKubeletConfig, + DefinitionStages.WithLinuxOSConfig, + DefinitionStages.WithEnableEncryptionAtHost, + DefinitionStages.WithEnableUltraSsd, + DefinitionStages.WithEnableFips, + DefinitionStages.WithGpuInstanceProfile, + DefinitionStages.WithCreationData { + /** + * Executes the create request. + * + * @return the created resource. + */ + AgentPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AgentPool create(Context context); + } + /** The stage of the AgentPool definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags to be persisted on the agent pool virtual machine scale set.. + * + * @param tags The tags to be persisted on the agent pool virtual machine scale set. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the AgentPool definition allowing to specify count. */ + interface WithCount { + /** + * Specifies the count property: Number of agents (VMs) to host docker containers. Allowed values must be in + * the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system + * pools. The default value is 1.. + * + * @param count Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 + * to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The + * default value is 1. + * @return the next definition stage. + */ + WithCreate withCount(Integer count); + } + /** The stage of the AgentPool definition allowing to specify vmSize. */ + interface WithVmSize { + /** + * Specifies the vmSize property: The size of the agent pool VMs. VM size availability varies by region. If + * a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For + * more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + * + * @param vmSize The size of the agent pool VMs. VM size availability varies by region. If a node contains + * insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details + * on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + * @return the next definition stage. + */ + WithCreate withVmSize(String vmSize); + } + /** The stage of the AgentPool definition allowing to specify osDiskSizeGB. */ + interface WithOsDiskSizeGB { + /** + * Specifies the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every + * machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + * the vmSize specified.. + * + * @param osDiskSizeGB OS Disk Size in GB to be used to specify the disk size for every machine in the + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize + * specified. + * @return the next definition stage. + */ + WithCreate withOsDiskSizeGB(Integer osDiskSizeGB); + } + /** The stage of the AgentPool definition allowing to specify osDiskType. */ + interface WithOsDiskType { + /** + * Specifies the osDiskType property: The OS disk type to be used for machines in the agent pool. The + * default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. + * Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).. + * + * @param osDiskType The OS disk type to be used for machines in the agent pool. The default is 'Ephemeral' + * if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + * defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + * @return the next definition stage. + */ + WithCreate withOsDiskType(OSDiskType osDiskType); + } + /** The stage of the AgentPool definition allowing to specify kubeletDiskType. */ + interface WithKubeletDiskType { + /** + * Specifies the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime + * data root, and Kubelet ephemeral storage.. + * + * @param kubeletDiskType Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * @return the next definition stage. + */ + WithCreate withKubeletDiskType(KubeletDiskType kubeletDiskType); + } + /** The stage of the AgentPool definition allowing to specify vnetSubnetId. */ + interface WithVnetSubnetId { + /** + * Specifies the vnetSubnetId property: The ID of the subnet which agent pool nodes and optionally pods will + * join on startup. If this is not specified, a VNET and subnet will be generated and used. If no + * podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of + * the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @param vnetSubnetId The ID of the subnet which agent pool nodes and optionally pods will join on startup. + * If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is + * specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * @return the next definition stage. + */ + WithCreate withVnetSubnetId(String vnetSubnetId); + } + /** The stage of the AgentPool definition allowing to specify podSubnetId. */ + interface WithPodSubnetId { + /** + * Specifies the podSubnetId property: The ID of the subnet which pods will join when launched. If omitted, + * pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @param podSubnetId The ID of the subnet which pods will join when launched. If omitted, pod IPs are + * statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * @return the next definition stage. + */ + WithCreate withPodSubnetId(String podSubnetId); + } + /** The stage of the AgentPool definition allowing to specify maxPods. */ + interface WithMaxPods { + /** + * Specifies the maxPods property: The maximum number of pods that can run on a node.. + * + * @param maxPods The maximum number of pods that can run on a node. + * @return the next definition stage. + */ + WithCreate withMaxPods(Integer maxPods); + } + /** The stage of the AgentPool definition allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: OsType to be used to specify os type. Choose from Linux and Windows. + * Default to Linux.. + * + * @param osType OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * @return the next definition stage. + */ + WithCreate withOsType(OSType osType); + } + /** The stage of the AgentPool definition allowing to specify osSku. */ + interface WithOsSku { + /** + * Specifies the osSku property: Specifies an OS SKU. This value must not be specified if OSType is + * Windows.. + * + * @param osSku Specifies an OS SKU. This value must not be specified if OSType is Windows. + * @return the next definition stage. + */ + WithCreate withOsSku(Ossku osSku); + } + /** The stage of the AgentPool definition allowing to specify maxCount. */ + interface WithMaxCount { + /** + * Specifies the maxCount property: The maximum number of nodes for auto-scaling. + * + * @param maxCount The maximum number of nodes for auto-scaling. + * @return the next definition stage. + */ + WithCreate withMaxCount(Integer maxCount); + } + /** The stage of the AgentPool definition allowing to specify minCount. */ + interface WithMinCount { + /** + * Specifies the minCount property: The minimum number of nodes for auto-scaling. + * + * @param minCount The minimum number of nodes for auto-scaling. + * @return the next definition stage. + */ + WithCreate withMinCount(Integer minCount); + } + /** The stage of the AgentPool definition allowing to specify enableAutoScaling. */ + interface WithEnableAutoScaling { + /** + * Specifies the enableAutoScaling property: Whether to enable auto-scaler. + * + * @param enableAutoScaling Whether to enable auto-scaler. + * @return the next definition stage. + */ + WithCreate withEnableAutoScaling(Boolean enableAutoScaling); + } + /** The stage of the AgentPool definition allowing to specify scaleDownMode. */ + interface WithScaleDownMode { + /** + * Specifies the scaleDownMode property: This also effects the cluster autoscaler behavior. If not + * specified, it defaults to Delete.. + * + * @param scaleDownMode This also effects the cluster autoscaler behavior. If not specified, it defaults to + * Delete. + * @return the next definition stage. + */ + WithCreate withScaleDownMode(ScaleDownMode scaleDownMode); + } + /** The stage of the AgentPool definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of Agent Pool.. + * + * @param typePropertiesType The type of Agent Pool. + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(AgentPoolType typePropertiesType); + } + /** The stage of the AgentPool definition allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The mode of an agent pool. A cluster must have at least one 'System' Agent + * Pool at all times. For additional information on agent pool restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools. + * + * @param mode The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at all times. + * For additional information on agent pool restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools. + * @return the next definition stage. + */ + WithCreate withMode(AgentPoolMode mode); + } + /** The stage of the AgentPool definition allowing to specify orchestratorVersion. */ + interface WithOrchestratorVersion { + /** + * Specifies the orchestratorVersion property: The version of Kubernetes running on the Agent Pool. As a + * best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The + * node pool version must have the same major version as the control plane. The node pool minor version must + * be within two minor versions of the control plane version. The node pool version cannot be greater than + * the control plane version. For more information see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).. + * + * @param orchestratorVersion The version of Kubernetes running on the Agent Pool. As a best practice, you + * should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version + * must have the same major version as the control plane. The node pool minor version must be within two + * minor versions of the control plane version. The node pool version cannot be greater than the control + * plane version. For more information see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + * @return the next definition stage. + */ + WithCreate withOrchestratorVersion(String orchestratorVersion); + } + /** The stage of the AgentPool definition allowing to specify upgradeSettings. */ + interface WithUpgradeSettings { + /** + * Specifies the upgradeSettings property: Settings for upgrading the agentpool. + * + * @param upgradeSettings Settings for upgrading the agentpool. + * @return the next definition stage. + */ + WithCreate withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings); + } + /** The stage of the AgentPool definition allowing to specify availabilityZones. */ + interface WithAvailabilityZones { + /** + * Specifies the availabilityZones property: The list of Availability zones to use for nodes. This can only + * be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.. + * + * @param availabilityZones The list of Availability zones to use for nodes. This can only be specified if + * the AgentPoolType property is 'VirtualMachineScaleSets'. + * @return the next definition stage. + */ + WithCreate withAvailabilityZones(List availabilityZones); + } + /** The stage of the AgentPool definition allowing to specify enableNodePublicIp. */ + interface WithEnableNodePublicIp { + /** + * Specifies the enableNodePublicIp property: Whether each node is allocated its own public IP. Some + * scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common + * scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual + * machine to minimize hops. For more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false.. + * + * @param enableNodePublicIp Whether each node is allocated its own public IP. Some scenarios may require + * nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for + * gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to + * minimize hops. For more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false. + * @return the next definition stage. + */ + WithCreate withEnableNodePublicIp(Boolean enableNodePublicIp); + } + /** The stage of the AgentPool definition allowing to specify nodePublicIpPrefixId. */ + interface WithNodePublicIpPrefixId { + /** + * Specifies the nodePublicIpPrefixId property: The public IP prefix ID which VM nodes should use IPs from. + * This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @param nodePublicIpPrefixId The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * @return the next definition stage. + */ + WithCreate withNodePublicIpPrefixId(String nodePublicIpPrefixId); + } + /** The stage of the AgentPool definition allowing to specify scaleSetPriority. */ + interface WithScaleSetPriority { + /** + * Specifies the scaleSetPriority property: The Virtual Machine Scale Set priority. If not specified, the + * default is 'Regular'.. + * + * @param scaleSetPriority The Virtual Machine Scale Set priority. If not specified, the default is + * 'Regular'. + * @return the next definition stage. + */ + WithCreate withScaleSetPriority(ScaleSetPriority scaleSetPriority); + } + /** The stage of the AgentPool definition allowing to specify scaleSetEvictionPolicy. */ + interface WithScaleSetEvictionPolicy { + /** + * Specifies the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. This cannot + * be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.. + * + * @param scaleSetEvictionPolicy The Virtual Machine Scale Set eviction policy. This cannot be specified + * unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + * @return the next definition stage. + */ + WithCreate withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy); + } + /** The stage of the AgentPool definition allowing to specify spotMaxPrice. */ + interface WithSpotMaxPrice { + /** + * Specifies the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot + * instances. Possible values are any decimal value greater than zero or -1 which indicates default price to + * be up-to on-demand. Possible values are any decimal value greater than zero or -1 which indicates the + * willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + * + * @param spotMaxPrice The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to + * on-demand. Possible values are any decimal value greater than zero or -1 which indicates the + * willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + * @return the next definition stage. + */ + WithCreate withSpotMaxPrice(Float spotMaxPrice); + } + /** The stage of the AgentPool definition allowing to specify nodeLabels. */ + interface WithNodeLabels { + /** + * Specifies the nodeLabels property: The node labels to be persisted across all nodes in agent pool.. + * + * @param nodeLabels The node labels to be persisted across all nodes in agent pool. + * @return the next definition stage. + */ + WithCreate withNodeLabels(Map nodeLabels); + } + /** The stage of the AgentPool definition allowing to specify nodeTaints. */ + interface WithNodeTaints { + /** + * Specifies the nodeTaints property: The taints added to new nodes during node pool create and scale. For + * example, key=value:NoSchedule.. + * + * @param nodeTaints The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * @return the next definition stage. + */ + WithCreate withNodeTaints(List nodeTaints); + } + /** The stage of the AgentPool definition allowing to specify proximityPlacementGroupId. */ + interface WithProximityPlacementGroupId { + /** + * Specifies the proximityPlacementGroupId property: The ID for Proximity Placement Group.. + * + * @param proximityPlacementGroupId The ID for Proximity Placement Group. + * @return the next definition stage. + */ + WithCreate withProximityPlacementGroupId(String proximityPlacementGroupId); + } + /** The stage of the AgentPool definition allowing to specify kubeletConfig. */ + interface WithKubeletConfig { + /** + * Specifies the kubeletConfig property: Kubelet configurations of agent nodes. The Kubelet configuration on + * the agent pool nodes.. + * + * @param kubeletConfig Kubelet configurations of agent nodes. The Kubelet configuration on the agent pool + * nodes. + * @return the next definition stage. + */ + WithCreate withKubeletConfig(KubeletConfig kubeletConfig); + } + /** The stage of the AgentPool definition allowing to specify linuxOSConfig. */ + interface WithLinuxOSConfig { + /** + * Specifies the linuxOSConfig property: OS configurations of Linux agent nodes. The OS configuration of + * Linux agent nodes.. + * + * @param linuxOSConfig OS configurations of Linux agent nodes. The OS configuration of Linux agent nodes. + * @return the next definition stage. + */ + WithCreate withLinuxOSConfig(LinuxOSConfig linuxOSConfig); + } + /** The stage of the AgentPool definition allowing to specify enableEncryptionAtHost. */ + interface WithEnableEncryptionAtHost { + /** + * Specifies the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. + * This is only supported on certain VM sizes and in certain Azure regions. For more information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption. + * + * @param enableEncryptionAtHost Whether to enable host based OS and data drive encryption. This is only + * supported on certain VM sizes and in certain Azure regions. For more information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption. + * @return the next definition stage. + */ + WithCreate withEnableEncryptionAtHost(Boolean enableEncryptionAtHost); + } + /** The stage of the AgentPool definition allowing to specify enableUltraSsd. */ + interface WithEnableUltraSsd { + /** + * Specifies the enableUltraSsd property: Whether to enable UltraSSD. + * + * @param enableUltraSsd Whether to enable UltraSSD. + * @return the next definition stage. + */ + WithCreate withEnableUltraSsd(Boolean enableUltraSsd); + } + /** The stage of the AgentPool definition allowing to specify enableFips. */ + interface WithEnableFips { + /** + * Specifies the enableFips property: Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + * for more details.. + * + * @param enableFips Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + * for more details. + * @return the next definition stage. + */ + WithCreate withEnableFips(Boolean enableFips); + } + /** The stage of the AgentPool definition allowing to specify gpuInstanceProfile. */ + interface WithGpuInstanceProfile { + /** + * Specifies the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance + * profile for supported GPU VM SKU.. + * + * @param gpuInstanceProfile GPUInstanceProfile to be used to specify GPU MIG instance profile for supported + * GPU VM SKU. + * @return the next definition stage. + */ + WithCreate withGpuInstanceProfile(GpuInstanceProfile gpuInstanceProfile); + } + /** The stage of the AgentPool definition allowing to specify creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: CreationData to be used to specify the source Snapshot ID if the + * node pool will be created/upgraded using a snapshot.. + * + * @param creationData CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * @return the next definition stage. + */ + WithCreate withCreationData(CreationData creationData); + } + } + /** + * Begins update for the AgentPool resource. + * + * @return the stage of resource update. + */ + AgentPool.Update update(); + + /** The template for AgentPool update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithCount, + UpdateStages.WithVmSize, + UpdateStages.WithOsDiskSizeGB, + UpdateStages.WithOsDiskType, + UpdateStages.WithKubeletDiskType, + UpdateStages.WithVnetSubnetId, + UpdateStages.WithPodSubnetId, + UpdateStages.WithMaxPods, + UpdateStages.WithOsType, + UpdateStages.WithOsSku, + UpdateStages.WithMaxCount, + UpdateStages.WithMinCount, + UpdateStages.WithEnableAutoScaling, + UpdateStages.WithScaleDownMode, + UpdateStages.WithTypePropertiesType, + UpdateStages.WithMode, + UpdateStages.WithOrchestratorVersion, + UpdateStages.WithUpgradeSettings, + UpdateStages.WithAvailabilityZones, + UpdateStages.WithEnableNodePublicIp, + UpdateStages.WithNodePublicIpPrefixId, + UpdateStages.WithScaleSetPriority, + UpdateStages.WithScaleSetEvictionPolicy, + UpdateStages.WithSpotMaxPrice, + UpdateStages.WithNodeLabels, + UpdateStages.WithNodeTaints, + UpdateStages.WithProximityPlacementGroupId, + UpdateStages.WithKubeletConfig, + UpdateStages.WithLinuxOSConfig, + UpdateStages.WithEnableEncryptionAtHost, + UpdateStages.WithEnableUltraSsd, + UpdateStages.WithEnableFips, + UpdateStages.WithGpuInstanceProfile, + UpdateStages.WithCreationData { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AgentPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AgentPool apply(Context context); + } + /** The AgentPool update stages. */ + interface UpdateStages { + /** The stage of the AgentPool update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags to be persisted on the agent pool virtual machine scale set.. + * + * @param tags The tags to be persisted on the agent pool virtual machine scale set. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the AgentPool update allowing to specify count. */ + interface WithCount { + /** + * Specifies the count property: Number of agents (VMs) to host docker containers. Allowed values must be in + * the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system + * pools. The default value is 1.. + * + * @param count Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 + * to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The + * default value is 1. + * @return the next definition stage. + */ + Update withCount(Integer count); + } + /** The stage of the AgentPool update allowing to specify vmSize. */ + interface WithVmSize { + /** + * Specifies the vmSize property: The size of the agent pool VMs. VM size availability varies by region. If + * a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For + * more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + * + * @param vmSize The size of the agent pool VMs. VM size availability varies by region. If a node contains + * insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details + * on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + * @return the next definition stage. + */ + Update withVmSize(String vmSize); + } + /** The stage of the AgentPool update allowing to specify osDiskSizeGB. */ + interface WithOsDiskSizeGB { + /** + * Specifies the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every + * machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to + * the vmSize specified.. + * + * @param osDiskSizeGB OS Disk Size in GB to be used to specify the disk size for every machine in the + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize + * specified. + * @return the next definition stage. + */ + Update withOsDiskSizeGB(Integer osDiskSizeGB); + } + /** The stage of the AgentPool update allowing to specify osDiskType. */ + interface WithOsDiskType { + /** + * Specifies the osDiskType property: The OS disk type to be used for machines in the agent pool. The + * default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. + * Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).. + * + * @param osDiskType The OS disk type to be used for machines in the agent pool. The default is 'Ephemeral' + * if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + * defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + * @return the next definition stage. + */ + Update withOsDiskType(OSDiskType osDiskType); + } + /** The stage of the AgentPool update allowing to specify kubeletDiskType. */ + interface WithKubeletDiskType { + /** + * Specifies the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime + * data root, and Kubelet ephemeral storage.. + * + * @param kubeletDiskType Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * @return the next definition stage. + */ + Update withKubeletDiskType(KubeletDiskType kubeletDiskType); + } + /** The stage of the AgentPool update allowing to specify vnetSubnetId. */ + interface WithVnetSubnetId { + /** + * Specifies the vnetSubnetId property: The ID of the subnet which agent pool nodes and optionally pods will + * join on startup. If this is not specified, a VNET and subnet will be generated and used. If no + * podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of + * the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @param vnetSubnetId The ID of the subnet which agent pool nodes and optionally pods will join on startup. + * If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is + * specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * @return the next definition stage. + */ + Update withVnetSubnetId(String vnetSubnetId); + } + /** The stage of the AgentPool update allowing to specify podSubnetId. */ + interface WithPodSubnetId { + /** + * Specifies the podSubnetId property: The ID of the subnet which pods will join when launched. If omitted, + * pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @param podSubnetId The ID of the subnet which pods will join when launched. If omitted, pod IPs are + * statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * @return the next definition stage. + */ + Update withPodSubnetId(String podSubnetId); + } + /** The stage of the AgentPool update allowing to specify maxPods. */ + interface WithMaxPods { + /** + * Specifies the maxPods property: The maximum number of pods that can run on a node.. + * + * @param maxPods The maximum number of pods that can run on a node. + * @return the next definition stage. + */ + Update withMaxPods(Integer maxPods); + } + /** The stage of the AgentPool update allowing to specify osType. */ + interface WithOsType { + /** + * Specifies the osType property: OsType to be used to specify os type. Choose from Linux and Windows. + * Default to Linux.. + * + * @param osType OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * @return the next definition stage. + */ + Update withOsType(OSType osType); + } + /** The stage of the AgentPool update allowing to specify osSku. */ + interface WithOsSku { + /** + * Specifies the osSku property: Specifies an OS SKU. This value must not be specified if OSType is + * Windows.. + * + * @param osSku Specifies an OS SKU. This value must not be specified if OSType is Windows. + * @return the next definition stage. + */ + Update withOsSku(Ossku osSku); + } + /** The stage of the AgentPool update allowing to specify maxCount. */ + interface WithMaxCount { + /** + * Specifies the maxCount property: The maximum number of nodes for auto-scaling. + * + * @param maxCount The maximum number of nodes for auto-scaling. + * @return the next definition stage. + */ + Update withMaxCount(Integer maxCount); + } + /** The stage of the AgentPool update allowing to specify minCount. */ + interface WithMinCount { + /** + * Specifies the minCount property: The minimum number of nodes for auto-scaling. + * + * @param minCount The minimum number of nodes for auto-scaling. + * @return the next definition stage. + */ + Update withMinCount(Integer minCount); + } + /** The stage of the AgentPool update allowing to specify enableAutoScaling. */ + interface WithEnableAutoScaling { + /** + * Specifies the enableAutoScaling property: Whether to enable auto-scaler. + * + * @param enableAutoScaling Whether to enable auto-scaler. + * @return the next definition stage. + */ + Update withEnableAutoScaling(Boolean enableAutoScaling); + } + /** The stage of the AgentPool update allowing to specify scaleDownMode. */ + interface WithScaleDownMode { + /** + * Specifies the scaleDownMode property: This also effects the cluster autoscaler behavior. If not + * specified, it defaults to Delete.. + * + * @param scaleDownMode This also effects the cluster autoscaler behavior. If not specified, it defaults to + * Delete. + * @return the next definition stage. + */ + Update withScaleDownMode(ScaleDownMode scaleDownMode); + } + /** The stage of the AgentPool update allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: The type of Agent Pool.. + * + * @param typePropertiesType The type of Agent Pool. + * @return the next definition stage. + */ + Update withTypePropertiesType(AgentPoolType typePropertiesType); + } + /** The stage of the AgentPool update allowing to specify mode. */ + interface WithMode { + /** + * Specifies the mode property: The mode of an agent pool. A cluster must have at least one 'System' Agent + * Pool at all times. For additional information on agent pool restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools. + * + * @param mode The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at all times. + * For additional information on agent pool restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools. + * @return the next definition stage. + */ + Update withMode(AgentPoolMode mode); + } + /** The stage of the AgentPool update allowing to specify orchestratorVersion. */ + interface WithOrchestratorVersion { + /** + * Specifies the orchestratorVersion property: The version of Kubernetes running on the Agent Pool. As a + * best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The + * node pool version must have the same major version as the control plane. The node pool minor version must + * be within two minor versions of the control plane version. The node pool version cannot be greater than + * the control plane version. For more information see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).. + * + * @param orchestratorVersion The version of Kubernetes running on the Agent Pool. As a best practice, you + * should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version + * must have the same major version as the control plane. The node pool minor version must be within two + * minor versions of the control plane version. The node pool version cannot be greater than the control + * plane version. For more information see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + * @return the next definition stage. + */ + Update withOrchestratorVersion(String orchestratorVersion); + } + /** The stage of the AgentPool update allowing to specify upgradeSettings. */ + interface WithUpgradeSettings { + /** + * Specifies the upgradeSettings property: Settings for upgrading the agentpool. + * + * @param upgradeSettings Settings for upgrading the agentpool. + * @return the next definition stage. + */ + Update withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings); + } + /** The stage of the AgentPool update allowing to specify availabilityZones. */ + interface WithAvailabilityZones { + /** + * Specifies the availabilityZones property: The list of Availability zones to use for nodes. This can only + * be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.. + * + * @param availabilityZones The list of Availability zones to use for nodes. This can only be specified if + * the AgentPoolType property is 'VirtualMachineScaleSets'. + * @return the next definition stage. + */ + Update withAvailabilityZones(List availabilityZones); + } + /** The stage of the AgentPool update allowing to specify enableNodePublicIp. */ + interface WithEnableNodePublicIp { + /** + * Specifies the enableNodePublicIp property: Whether each node is allocated its own public IP. Some + * scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common + * scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual + * machine to minimize hops. For more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false.. + * + * @param enableNodePublicIp Whether each node is allocated its own public IP. Some scenarios may require + * nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for + * gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to + * minimize hops. For more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false. + * @return the next definition stage. + */ + Update withEnableNodePublicIp(Boolean enableNodePublicIp); + } + /** The stage of the AgentPool update allowing to specify nodePublicIpPrefixId. */ + interface WithNodePublicIpPrefixId { + /** + * Specifies the nodePublicIpPrefixId property: The public IP prefix ID which VM nodes should use IPs from. + * This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @param nodePublicIpPrefixId The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * @return the next definition stage. + */ + Update withNodePublicIpPrefixId(String nodePublicIpPrefixId); + } + /** The stage of the AgentPool update allowing to specify scaleSetPriority. */ + interface WithScaleSetPriority { + /** + * Specifies the scaleSetPriority property: The Virtual Machine Scale Set priority. If not specified, the + * default is 'Regular'.. + * + * @param scaleSetPriority The Virtual Machine Scale Set priority. If not specified, the default is + * 'Regular'. + * @return the next definition stage. + */ + Update withScaleSetPriority(ScaleSetPriority scaleSetPriority); + } + /** The stage of the AgentPool update allowing to specify scaleSetEvictionPolicy. */ + interface WithScaleSetEvictionPolicy { + /** + * Specifies the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. This cannot + * be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.. + * + * @param scaleSetEvictionPolicy The Virtual Machine Scale Set eviction policy. This cannot be specified + * unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + * @return the next definition stage. + */ + Update withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy); + } + /** The stage of the AgentPool update allowing to specify spotMaxPrice. */ + interface WithSpotMaxPrice { + /** + * Specifies the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot + * instances. Possible values are any decimal value greater than zero or -1 which indicates default price to + * be up-to on-demand. Possible values are any decimal value greater than zero or -1 which indicates the + * willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + * + * @param spotMaxPrice The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to + * on-demand. Possible values are any decimal value greater than zero or -1 which indicates the + * willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + * @return the next definition stage. + */ + Update withSpotMaxPrice(Float spotMaxPrice); + } + /** The stage of the AgentPool update allowing to specify nodeLabels. */ + interface WithNodeLabels { + /** + * Specifies the nodeLabels property: The node labels to be persisted across all nodes in agent pool.. + * + * @param nodeLabels The node labels to be persisted across all nodes in agent pool. + * @return the next definition stage. + */ + Update withNodeLabels(Map nodeLabels); + } + /** The stage of the AgentPool update allowing to specify nodeTaints. */ + interface WithNodeTaints { + /** + * Specifies the nodeTaints property: The taints added to new nodes during node pool create and scale. For + * example, key=value:NoSchedule.. + * + * @param nodeTaints The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * @return the next definition stage. + */ + Update withNodeTaints(List nodeTaints); + } + /** The stage of the AgentPool update allowing to specify proximityPlacementGroupId. */ + interface WithProximityPlacementGroupId { + /** + * Specifies the proximityPlacementGroupId property: The ID for Proximity Placement Group.. + * + * @param proximityPlacementGroupId The ID for Proximity Placement Group. + * @return the next definition stage. + */ + Update withProximityPlacementGroupId(String proximityPlacementGroupId); + } + /** The stage of the AgentPool update allowing to specify kubeletConfig. */ + interface WithKubeletConfig { + /** + * Specifies the kubeletConfig property: Kubelet configurations of agent nodes. The Kubelet configuration on + * the agent pool nodes.. + * + * @param kubeletConfig Kubelet configurations of agent nodes. The Kubelet configuration on the agent pool + * nodes. + * @return the next definition stage. + */ + Update withKubeletConfig(KubeletConfig kubeletConfig); + } + /** The stage of the AgentPool update allowing to specify linuxOSConfig. */ + interface WithLinuxOSConfig { + /** + * Specifies the linuxOSConfig property: OS configurations of Linux agent nodes. The OS configuration of + * Linux agent nodes.. + * + * @param linuxOSConfig OS configurations of Linux agent nodes. The OS configuration of Linux agent nodes. + * @return the next definition stage. + */ + Update withLinuxOSConfig(LinuxOSConfig linuxOSConfig); + } + /** The stage of the AgentPool update allowing to specify enableEncryptionAtHost. */ + interface WithEnableEncryptionAtHost { + /** + * Specifies the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. + * This is only supported on certain VM sizes and in certain Azure regions. For more information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption. + * + * @param enableEncryptionAtHost Whether to enable host based OS and data drive encryption. This is only + * supported on certain VM sizes and in certain Azure regions. For more information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption. + * @return the next definition stage. + */ + Update withEnableEncryptionAtHost(Boolean enableEncryptionAtHost); + } + /** The stage of the AgentPool update allowing to specify enableUltraSsd. */ + interface WithEnableUltraSsd { + /** + * Specifies the enableUltraSsd property: Whether to enable UltraSSD. + * + * @param enableUltraSsd Whether to enable UltraSSD. + * @return the next definition stage. + */ + Update withEnableUltraSsd(Boolean enableUltraSsd); + } + /** The stage of the AgentPool update allowing to specify enableFips. */ + interface WithEnableFips { + /** + * Specifies the enableFips property: Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + * for more details.. + * + * @param enableFips Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + * for more details. + * @return the next definition stage. + */ + Update withEnableFips(Boolean enableFips); + } + /** The stage of the AgentPool update allowing to specify gpuInstanceProfile. */ + interface WithGpuInstanceProfile { + /** + * Specifies the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance + * profile for supported GPU VM SKU.. + * + * @param gpuInstanceProfile GPUInstanceProfile to be used to specify GPU MIG instance profile for supported + * GPU VM SKU. + * @return the next definition stage. + */ + Update withGpuInstanceProfile(GpuInstanceProfile gpuInstanceProfile); + } + /** The stage of the AgentPool update allowing to specify creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: CreationData to be used to specify the source Snapshot ID if the + * node pool will be created/upgraded using a snapshot.. + * + * @param creationData CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * @return the next definition stage. + */ + Update withCreationData(CreationData creationData); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AgentPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AgentPool refresh(Context context); + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @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 response. + */ + AgentPool upgradeNodeImageVersion(); + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @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 response. + */ + AgentPool upgradeNodeImageVersion(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersions.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersions.java new file mode 100644 index 0000000000000..fb757a78a22af --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersions.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner; +import java.util.List; + +/** An immutable client-side representation of AgentPoolAvailableVersions. */ +public interface AgentPoolAvailableVersions { + /** + * Gets the id property: The ID of the agent pool version list. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the agent pool version list. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Type of the agent pool version list. + * + * @return the type value. + */ + String type(); + + /** + * Gets the agentPoolVersions property: List of versions available for agent pool. + * + * @return the agentPoolVersions value. + */ + List agentPoolVersions(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolAvailableVersionsInner + * object. + * + * @return the inner object. + */ + AgentPoolAvailableVersionsInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java new file mode 100644 index 0000000000000..22c97a78f0294 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem model. */ +@Fluent +public final class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.class); + + /* + * Whether this version is the default agent pool version. + */ + @JsonProperty(value = "default") + private Boolean defaultProperty; + + /* + * The Kubernetes version (major.minor.patch). + */ + @JsonProperty(value = "kubernetesVersion") + private String kubernetesVersion; + + /* + * Whether Kubernetes version is currently in preview. + */ + @JsonProperty(value = "isPreview") + private Boolean isPreview; + + /** + * Get the defaultProperty property: Whether this version is the default agent pool version. + * + * @return the defaultProperty value. + */ + public Boolean defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Whether this version is the default agent pool version. + * + * @param defaultProperty the defaultProperty value to set. + * @return the AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem object itself. + */ + public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem withDefaultProperty(Boolean defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Set the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @param kubernetesVersion the kubernetesVersion value to set. + * @return the AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem object itself. + */ + public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem withKubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + return this; + } + + /** + * Get the isPreview property: Whether Kubernetes version is currently in preview. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Whether Kubernetes version is currently in preview. + * + * @param isPreview the isPreview value to set. + * @return the AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem object itself. + */ + public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem withIsPreview(Boolean isPreview) { + this.isPreview = isPreview; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolListResult.java new file mode 100644 index 0000000000000..ac65997da26e9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Agent Pools operation. */ +@Fluent +public final class AgentPoolListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolListResult.class); + + /* + * The list of agent pools. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of agent pool results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of agent pools. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of agent pools. + * + * @param value the value value to set. + * @return the AgentPoolListResult object itself. + */ + public AgentPoolListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of agent pool results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolMode.java new file mode 100644 index 0000000000000..be15302c9af63 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolMode.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AgentPoolMode. */ +public final class AgentPoolMode extends ExpandableStringEnum { + /** Static value System for AgentPoolMode. */ + public static final AgentPoolMode SYSTEM = fromString("System"); + + /** Static value User for AgentPoolMode. */ + public static final AgentPoolMode USER = fromString("User"); + + /** + * Creates or finds a AgentPoolMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentPoolMode. + */ + @JsonCreator + public static AgentPoolMode fromString(String name) { + return fromString(name, AgentPoolMode.class); + } + + /** @return known AgentPoolMode values. */ + public static Collection values() { + return values(AgentPoolMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolType.java new file mode 100644 index 0000000000000..5f0828d31a15a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolType.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AgentPoolType. */ +public final class AgentPoolType extends ExpandableStringEnum { + /** Static value VirtualMachineScaleSets for AgentPoolType. */ + public static final AgentPoolType VIRTUAL_MACHINE_SCALE_SETS = fromString("VirtualMachineScaleSets"); + + /** Static value AvailabilitySet for AgentPoolType. */ + public static final AgentPoolType AVAILABILITY_SET = fromString("AvailabilitySet"); + + /** + * Creates or finds a AgentPoolType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentPoolType. + */ + @JsonCreator + public static AgentPoolType fromString(String name) { + return fromString(name, AgentPoolType.class); + } + + /** @return known AgentPoolType values. */ + public static Collection values() { + return values(AgentPoolType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfile.java new file mode 100644 index 0000000000000..96697651c0ceb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfile.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner; +import java.util.List; + +/** An immutable client-side representation of AgentPoolUpgradeProfile. */ +public interface AgentPoolUpgradeProfile { + /** + * Gets the id property: The ID of the agent pool upgrade profile. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the agent pool upgrade profile. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the agent pool upgrade profile. + * + * @return the type value. + */ + String type(); + + /** + * Gets the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + String kubernetesVersion(); + + /** + * Gets the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @return the osType value. + */ + OSType osType(); + + /** + * Gets the upgrades property: List of orchestrator types and versions available for upgrade. + * + * @return the upgrades value. + */ + List upgrades(); + + /** + * Gets the latestNodeImageVersion property: The latest AKS supported node image version. + * + * @return the latestNodeImageVersion value. + */ + String latestNodeImageVersion(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolUpgradeProfileInner + * object. + * + * @return the inner object. + */ + AgentPoolUpgradeProfileInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java new file mode 100644 index 0000000000000..70f75150170cf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 AgentPoolUpgradeProfilePropertiesUpgradesItem model. */ +@Fluent +public final class AgentPoolUpgradeProfilePropertiesUpgradesItem { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(AgentPoolUpgradeProfilePropertiesUpgradesItem.class); + + /* + * The Kubernetes version (major.minor.patch). + */ + @JsonProperty(value = "kubernetesVersion") + private String kubernetesVersion; + + /* + * Whether the Kubernetes version is currently in preview. + */ + @JsonProperty(value = "isPreview") + private Boolean isPreview; + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Set the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @param kubernetesVersion the kubernetesVersion value to set. + * @return the AgentPoolUpgradeProfilePropertiesUpgradesItem object itself. + */ + public AgentPoolUpgradeProfilePropertiesUpgradesItem withKubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + return this; + } + + /** + * Get the isPreview property: Whether the Kubernetes version is currently in preview. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Whether the Kubernetes version is currently in preview. + * + * @param isPreview the isPreview value to set. + * @return the AgentPoolUpgradeProfilePropertiesUpgradesItem object itself. + */ + public AgentPoolUpgradeProfilePropertiesUpgradesItem withIsPreview(Boolean isPreview) { + this.isPreview = isPreview; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeSettings.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeSettings.java new file mode 100644 index 0000000000000..01aace4707f61 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeSettings.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Settings for upgrading an agentpool. */ +@Fluent +public final class AgentPoolUpgradeSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AgentPoolUpgradeSettings.class); + + /* + * The maximum number or percentage of nodes that are surged during + * upgrade. This can either be set to an integer (e.g. '5') or a percentage + * (e.g. '50%'). If a percentage is specified, it is the percentage of the + * total agent pool size at the time of the upgrade. For percentages, + * fractional nodes are rounded up. If not specified, the default is 1. For + * more information, including best practices, see: + * https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade + */ + @JsonProperty(value = "maxSurge") + private String maxSurge; + + /** + * Get the maxSurge property: The maximum number or percentage of nodes that are surged during upgrade. This can + * either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the + * percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded + * up. If not specified, the default is 1. For more information, including best practices, see: + * https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + * + * @return the maxSurge value. + */ + public String maxSurge() { + return this.maxSurge; + } + + /** + * Set the maxSurge property: The maximum number or percentage of nodes that are surged during upgrade. This can + * either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the + * percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded + * up. If not specified, the default is 1. For more information, including best practices, see: + * https://docs.microsoft.com/azure/aks/upgrade-cluster#customize-node-surge-upgrade. + * + * @param maxSurge the maxSurge value to set. + * @return the AgentPoolUpgradeSettings object itself. + */ + public AgentPoolUpgradeSettings withMaxSurge(String maxSurge) { + this.maxSurge = maxSurge; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPools.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPools.java new file mode 100644 index 0000000000000..3bc3252dd7920 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPools.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 AgentPools. */ +public interface AgentPools { + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of agent pools in the specified managed cluster. + */ + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Gets a list of agent pools in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of agent pools in the specified managed cluster. + */ + PagedIterable list(String resourceGroupName, String resourceName, Context context); + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 specified managed cluster agent pool. + */ + AgentPool get(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 specified managed cluster agent pool. + */ + Response getWithResponse( + String resourceGroupName, String resourceName, String agentPoolName, Context context); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 resourceName, String agentPoolName, Context context); + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 upgrade profile for an agent pool. + */ + AgentPoolUpgradeProfile getUpgradeProfile(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 upgrade profile for an agent pool. + */ + Response getUpgradeProfileWithResponse( + String resourceGroupName, String resourceName, String agentPoolName, Context context); + + /** + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of available versions for an agent pool. + */ + AgentPoolAvailableVersions getAvailableAgentPoolVersions(String resourceGroupName, String resourceName); + + /** + * See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more + * details about the version lifecycle. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of available versions for an agent pool. + */ + Response getAvailableAgentPoolVersionsWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + AgentPool upgradeNodeImageVersion(String resourceGroupName, String resourceName, String agentPoolName); + + /** + * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS + * provides one new image per week with the latest updates. For more details on node image versions, see: + * https://docs.microsoft.com/azure/aks/node-image-upgrade. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @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 response. + */ + AgentPool upgradeNodeImageVersion( + String resourceGroupName, String resourceName, String agentPoolName, Context context); + + /** + * Gets the specified managed cluster agent pool. + * + * @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 the specified managed cluster agent pool. + */ + AgentPool getById(String id); + + /** + * Gets the specified managed cluster agent pool. + * + * @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 the specified managed cluster agent pool. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an agent pool in the specified 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); + + /** + * Deletes an agent pool in the specified 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 AgentPool resource. + * + * @param name resource name. + * @return the first stage of the new AgentPool definition. + */ + AgentPool.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Code.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Code.java new file mode 100644 index 0000000000000..c15308f62babd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Code.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Code. */ +public final class Code extends ExpandableStringEnum { + /** Static value Running for Code. */ + public static final Code RUNNING = fromString("Running"); + + /** Static value Stopped for Code. */ + public static final Code STOPPED = fromString("Stopped"); + + /** + * Creates or finds a Code from its string representation. + * + * @param name a name to look for. + * @return the corresponding Code. + */ + @JsonCreator + public static Code fromString(String name) { + return fromString(name, Code.class); + } + + /** @return known Code values. */ + public static Collection values() { + return values(Code.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ConnectionStatus.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ConnectionStatus.java new file mode 100644 index 0000000000000..5be4dd2c34afa --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ConnectionStatus.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionStatus. */ +public final class ConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for ConnectionStatus. */ + public static final ConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for ConnectionStatus. */ + public static final ConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for ConnectionStatus. */ + public static final ConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for ConnectionStatus. */ + public static final ConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a ConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionStatus. + */ + @JsonCreator + public static ConnectionStatus fromString(String name) { + return fromString(name, ConnectionStatus.class); + } + + /** @return known ConnectionStatus values. */ + public static Collection values() { + return values(ConnectionStatus.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerService.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerService.java new file mode 100644 index 0000000000000..4286a3a3339ac --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerService.java @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ContainerServiceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ContainerService. */ +public interface ContainerService { + /** + * 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 provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the orchestratorProfile property: Profile for the container service orchestrator. + * + * @return the orchestratorProfile value. + */ + ContainerServiceOrchestratorProfile orchestratorProfile(); + + /** + * Gets the customProfile property: Properties to configure a custom container service cluster. + * + * @return the customProfile value. + */ + ContainerServiceCustomProfile customProfile(); + + /** + * Gets the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. + * + * @return the servicePrincipalProfile value. + */ + ContainerServicePrincipalProfile servicePrincipalProfile(); + + /** + * Gets the masterProfile property: Profile for the container service master. + * + * @return the masterProfile value. + */ + ContainerServiceMasterProfile masterProfile(); + + /** + * Gets the agentPoolProfiles property: Properties of the agent pool. + * + * @return the agentPoolProfiles value. + */ + List agentPoolProfiles(); + + /** + * Gets the windowsProfile property: Profile for Windows VMs in the container service cluster. + * + * @return the windowsProfile value. + */ + ContainerServiceWindowsProfile windowsProfile(); + + /** + * Gets the linuxProfile property: Profile for Linux VMs in the container service cluster. + * + * @return the linuxProfile value. + */ + ContainerServiceLinuxProfile linuxProfile(); + + /** + * Gets the diagnosticsProfile property: Profile for diagnostics in the container service cluster. + * + * @return the diagnosticsProfile value. + */ + ContainerServiceDiagnosticsProfile diagnosticsProfile(); + + /** + * 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.containerservice.generated.fluent.models.ContainerServiceInner object. + * + * @return the inner object. + */ + ContainerServiceInner innerModel(); + + /** The entirety of the ContainerService definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ContainerService definition stages. */ + interface DefinitionStages { + /** The first stage of the ContainerService definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ContainerService 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 ContainerService 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 ContainerService 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.WithOrchestratorProfile, + DefinitionStages.WithCustomProfile, + DefinitionStages.WithServicePrincipalProfile, + DefinitionStages.WithMasterProfile, + DefinitionStages.WithAgentPoolProfiles, + DefinitionStages.WithWindowsProfile, + DefinitionStages.WithLinuxProfile, + DefinitionStages.WithDiagnosticsProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + ContainerService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ContainerService create(Context context); + } + /** The stage of the ContainerService 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 ContainerService definition allowing to specify orchestratorProfile. */ + interface WithOrchestratorProfile { + /** + * Specifies the orchestratorProfile property: Profile for the container service orchestrator.. + * + * @param orchestratorProfile Profile for the container service orchestrator. + * @return the next definition stage. + */ + WithCreate withOrchestratorProfile(ContainerServiceOrchestratorProfile orchestratorProfile); + } + /** The stage of the ContainerService definition allowing to specify customProfile. */ + interface WithCustomProfile { + /** + * Specifies the customProfile property: Properties to configure a custom container service cluster.. + * + * @param customProfile Properties to configure a custom container service cluster. + * @return the next definition stage. + */ + WithCreate withCustomProfile(ContainerServiceCustomProfile customProfile); + } + /** The stage of the ContainerService definition allowing to specify servicePrincipalProfile. */ + interface WithServicePrincipalProfile { + /** + * Specifies the servicePrincipalProfile property: Information about a service principal identity for the + * cluster to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be + * specified.. + * + * @param servicePrincipalProfile Information about a service principal identity for the cluster to use for + * manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. + * @return the next definition stage. + */ + WithCreate withServicePrincipalProfile(ContainerServicePrincipalProfile servicePrincipalProfile); + } + /** The stage of the ContainerService definition allowing to specify masterProfile. */ + interface WithMasterProfile { + /** + * Specifies the masterProfile property: Profile for the container service master.. + * + * @param masterProfile Profile for the container service master. + * @return the next definition stage. + */ + WithCreate withMasterProfile(ContainerServiceMasterProfile masterProfile); + } + /** The stage of the ContainerService definition allowing to specify agentPoolProfiles. */ + interface WithAgentPoolProfiles { + /** + * Specifies the agentPoolProfiles property: Properties of the agent pool.. + * + * @param agentPoolProfiles Properties of the agent pool. + * @return the next definition stage. + */ + WithCreate withAgentPoolProfiles(List agentPoolProfiles); + } + /** The stage of the ContainerService definition allowing to specify windowsProfile. */ + interface WithWindowsProfile { + /** + * Specifies the windowsProfile property: Profile for Windows VMs in the container service cluster.. + * + * @param windowsProfile Profile for Windows VMs in the container service cluster. + * @return the next definition stage. + */ + WithCreate withWindowsProfile(ContainerServiceWindowsProfile windowsProfile); + } + /** The stage of the ContainerService definition allowing to specify linuxProfile. */ + interface WithLinuxProfile { + /** + * Specifies the linuxProfile property: Profile for Linux VMs in the container service cluster.. + * + * @param linuxProfile Profile for Linux VMs in the container service cluster. + * @return the next definition stage. + */ + WithCreate withLinuxProfile(ContainerServiceLinuxProfile linuxProfile); + } + /** The stage of the ContainerService definition allowing to specify diagnosticsProfile. */ + interface WithDiagnosticsProfile { + /** + * Specifies the diagnosticsProfile property: Profile for diagnostics in the container service cluster.. + * + * @param diagnosticsProfile Profile for diagnostics in the container service cluster. + * @return the next definition stage. + */ + WithCreate withDiagnosticsProfile(ContainerServiceDiagnosticsProfile diagnosticsProfile); + } + } + /** + * Begins update for the ContainerService resource. + * + * @return the stage of resource update. + */ + ContainerService.Update update(); + + /** The template for ContainerService update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithOrchestratorProfile, + UpdateStages.WithCustomProfile, + UpdateStages.WithServicePrincipalProfile, + UpdateStages.WithMasterProfile, + UpdateStages.WithAgentPoolProfiles, + UpdateStages.WithWindowsProfile, + UpdateStages.WithLinuxProfile, + UpdateStages.WithDiagnosticsProfile { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ContainerService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ContainerService apply(Context context); + } + /** The ContainerService update stages. */ + interface UpdateStages { + /** The stage of the ContainerService update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ContainerService update allowing to specify orchestratorProfile. */ + interface WithOrchestratorProfile { + /** + * Specifies the orchestratorProfile property: Profile for the container service orchestrator.. + * + * @param orchestratorProfile Profile for the container service orchestrator. + * @return the next definition stage. + */ + Update withOrchestratorProfile(ContainerServiceOrchestratorProfile orchestratorProfile); + } + /** The stage of the ContainerService update allowing to specify customProfile. */ + interface WithCustomProfile { + /** + * Specifies the customProfile property: Properties to configure a custom container service cluster.. + * + * @param customProfile Properties to configure a custom container service cluster. + * @return the next definition stage. + */ + Update withCustomProfile(ContainerServiceCustomProfile customProfile); + } + /** The stage of the ContainerService update allowing to specify servicePrincipalProfile. */ + interface WithServicePrincipalProfile { + /** + * Specifies the servicePrincipalProfile property: Information about a service principal identity for the + * cluster to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be + * specified.. + * + * @param servicePrincipalProfile Information about a service principal identity for the cluster to use for + * manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. + * @return the next definition stage. + */ + Update withServicePrincipalProfile(ContainerServicePrincipalProfile servicePrincipalProfile); + } + /** The stage of the ContainerService update allowing to specify masterProfile. */ + interface WithMasterProfile { + /** + * Specifies the masterProfile property: Profile for the container service master.. + * + * @param masterProfile Profile for the container service master. + * @return the next definition stage. + */ + Update withMasterProfile(ContainerServiceMasterProfile masterProfile); + } + /** The stage of the ContainerService update allowing to specify agentPoolProfiles. */ + interface WithAgentPoolProfiles { + /** + * Specifies the agentPoolProfiles property: Properties of the agent pool.. + * + * @param agentPoolProfiles Properties of the agent pool. + * @return the next definition stage. + */ + Update withAgentPoolProfiles(List agentPoolProfiles); + } + /** The stage of the ContainerService update allowing to specify windowsProfile. */ + interface WithWindowsProfile { + /** + * Specifies the windowsProfile property: Profile for Windows VMs in the container service cluster.. + * + * @param windowsProfile Profile for Windows VMs in the container service cluster. + * @return the next definition stage. + */ + Update withWindowsProfile(ContainerServiceWindowsProfile windowsProfile); + } + /** The stage of the ContainerService update allowing to specify linuxProfile. */ + interface WithLinuxProfile { + /** + * Specifies the linuxProfile property: Profile for Linux VMs in the container service cluster.. + * + * @param linuxProfile Profile for Linux VMs in the container service cluster. + * @return the next definition stage. + */ + Update withLinuxProfile(ContainerServiceLinuxProfile linuxProfile); + } + /** The stage of the ContainerService update allowing to specify diagnosticsProfile. */ + interface WithDiagnosticsProfile { + /** + * Specifies the diagnosticsProfile property: Profile for diagnostics in the container service cluster.. + * + * @param diagnosticsProfile Profile for diagnostics in the container service cluster. + * @return the next definition stage. + */ + Update withDiagnosticsProfile(ContainerServiceDiagnosticsProfile diagnosticsProfile); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ContainerService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ContainerService refresh(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceAgentPoolProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceAgentPoolProfile.java new file mode 100644 index 0000000000000..b41b1240f3d89 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceAgentPoolProfile.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Profile for the container service agent pool. */ +@Fluent +public final class ContainerServiceAgentPoolProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceAgentPoolProfile.class); + + /* + * Unique name of the agent pool profile in the context of the subscription + * and resource group. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Number of agents (VMs) to host docker containers. Allowed values must be + * in the range of 1 to 100 (inclusive). The default value is 1. + */ + @JsonProperty(value = "count") + private Integer count; + + /* + * Size of agent VMs. + */ + @JsonProperty(value = "vmSize", required = true) + private ContainerServiceVMSizeTypes vmSize; + + /* + * OS Disk Size in GB to be used to specify the disk size for every machine + * in this master/agent pool. If you specify 0, it will apply the default + * osDisk size according to the vmSize specified. + */ + @JsonProperty(value = "osDiskSizeGB") + private Integer osDiskSizeGB; + + /* + * DNS prefix to be used to create the FQDN for the agent pool. + */ + @JsonProperty(value = "dnsPrefix") + private String dnsPrefix; + + /* + * FQDN for the agent pool. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * Ports number array used to expose on this agent pool. The default opened + * ports are different based on your choice of orchestrator. + */ + @JsonProperty(value = "ports") + private List ports; + + /* + * Storage profile specifies what kind of storage used. Choose from + * StorageAccount and ManagedDisks. Leave it empty, we will choose for you + * based on the orchestrator choice. + */ + @JsonProperty(value = "storageProfile") + private ContainerServiceStorageProfileTypes storageProfile; + + /* + * VNet SubnetID specifies the VNet's subnet identifier. + */ + @JsonProperty(value = "vnetSubnetID") + private String vnetSubnetId; + + /* + * OsType to be used to specify os type. Choose from Linux and Windows. + * Default to Linux. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * Get the name property: Unique name of the agent pool profile in the context of the subscription and resource + * group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Unique name of the agent pool profile in the context of the subscription and resource + * group. + * + * @param name the name value to set. + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of + * 1 to 100 (inclusive). The default value is 1. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of + * 1 to 100 (inclusive). The default value is 1. + * + * @param count the count value to set. + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the vmSize property: Size of agent VMs. + * + * @return the vmSize value. + */ + public ContainerServiceVMSizeTypes vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: Size of agent VMs. + * + * @param vmSize the vmSize value to set. + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withVmSize(ContainerServiceVMSizeTypes vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + * + * @return the osDiskSizeGB value. + */ + public Integer osDiskSizeGB() { + return this.osDiskSizeGB; + } + + /** + * Set the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + * + * @param osDiskSizeGB the osDiskSizeGB value to set. + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withOsDiskSizeGB(Integer osDiskSizeGB) { + this.osDiskSizeGB = osDiskSizeGB; + return this; + } + + /** + * Get the dnsPrefix property: DNS prefix to be used to create the FQDN for the agent pool. + * + * @return the dnsPrefix value. + */ + public String dnsPrefix() { + return this.dnsPrefix; + } + + /** + * Set the dnsPrefix property: DNS prefix to be used to create the FQDN for the agent pool. + * + * @param dnsPrefix the dnsPrefix value to set. + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withDnsPrefix(String dnsPrefix) { + this.dnsPrefix = dnsPrefix; + return this; + } + + /** + * Get the fqdn property: FQDN for the agent pool. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the ports property: Ports number array used to expose on this agent pool. The default opened ports are + * different based on your choice of orchestrator. + * + * @return the ports value. + */ + public List ports() { + return this.ports; + } + + /** + * Set the ports property: Ports number array used to expose on this agent pool. The default opened ports are + * different based on your choice of orchestrator. + * + * @param ports the ports value to set. + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the storageProfile property: Storage profile specifies what kind of storage used. Choose from StorageAccount + * and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. + * + * @return the storageProfile value. + */ + public ContainerServiceStorageProfileTypes storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Storage profile specifies what kind of storage used. Choose from StorageAccount + * and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. + * + * @param storageProfile the storageProfile value to set. + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withStorageProfile(ContainerServiceStorageProfileTypes storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier. + * + * @return the vnetSubnetId value. + */ + public String vnetSubnetId() { + return this.vnetSubnetId; + } + + /** + * Set the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier. + * + * @param vnetSubnetId the vnetSubnetId value to set. + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withVnetSubnetId(String vnetSubnetId) { + this.vnetSubnetId = vnetSubnetId; + return this; + } + + /** + * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @param osType the osType value to set. + * @return the ContainerServiceAgentPoolProfile object itself. + */ + public ContainerServiceAgentPoolProfile withOsType(OSType osType) { + this.osType = osType; + 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 ContainerServiceAgentPoolProfile")); + } + if (vmSize() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmSize in model ContainerServiceAgentPoolProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceCustomProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceCustomProfile.java new file mode 100644 index 0000000000000..4b4c550c79cd3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceCustomProfile.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Properties to configure a custom container service cluster. */ +@Fluent +public final class ContainerServiceCustomProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceCustomProfile.class); + + /* + * The name of the custom orchestrator to use. + */ + @JsonProperty(value = "orchestrator", required = true) + private String orchestrator; + + /** + * Get the orchestrator property: The name of the custom orchestrator to use. + * + * @return the orchestrator value. + */ + public String orchestrator() { + return this.orchestrator; + } + + /** + * Set the orchestrator property: The name of the custom orchestrator to use. + * + * @param orchestrator the orchestrator value to set. + * @return the ContainerServiceCustomProfile object itself. + */ + public ContainerServiceCustomProfile withOrchestrator(String orchestrator) { + this.orchestrator = orchestrator; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (orchestrator() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property orchestrator in model ContainerServiceCustomProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceDiagnosticsProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceDiagnosticsProfile.java new file mode 100644 index 0000000000000..70de8ffa4ada2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceDiagnosticsProfile.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.containerservice.generated.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; + +/** Profile for diagnostics on the container service cluster. */ +@Fluent +public final class ContainerServiceDiagnosticsProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceDiagnosticsProfile.class); + + /* + * Profile for diagnostics on the container service VMs. + */ + @JsonProperty(value = "vmDiagnostics", required = true) + private ContainerServiceVMDiagnostics vmDiagnostics; + + /** + * Get the vmDiagnostics property: Profile for diagnostics on the container service VMs. + * + * @return the vmDiagnostics value. + */ + public ContainerServiceVMDiagnostics vmDiagnostics() { + return this.vmDiagnostics; + } + + /** + * Set the vmDiagnostics property: Profile for diagnostics on the container service VMs. + * + * @param vmDiagnostics the vmDiagnostics value to set. + * @return the ContainerServiceDiagnosticsProfile object itself. + */ + public ContainerServiceDiagnosticsProfile withVmDiagnostics(ContainerServiceVMDiagnostics vmDiagnostics) { + this.vmDiagnostics = vmDiagnostics; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmDiagnostics() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmDiagnostics in model ContainerServiceDiagnosticsProfile")); + } else { + vmDiagnostics().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfile.java new file mode 100644 index 0000000000000..1552cd4661f06 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfile.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Profile for Linux VMs in the container service cluster. */ +@Fluent +public final class ContainerServiceLinuxProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceLinuxProfile.class); + + /* + * The administrator username to use for Linux VMs. + */ + @JsonProperty(value = "adminUsername", required = true) + private String adminUsername; + + /* + * SSH configuration for Linux-based VMs running on Azure. + */ + @JsonProperty(value = "ssh", required = true) + private ContainerServiceSshConfiguration ssh; + + /** + * Get the adminUsername property: The administrator username to use for Linux VMs. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: The administrator username to use for Linux VMs. + * + * @param adminUsername the adminUsername value to set. + * @return the ContainerServiceLinuxProfile object itself. + */ + public ContainerServiceLinuxProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the ssh property: SSH configuration for Linux-based VMs running on Azure. + * + * @return the ssh value. + */ + public ContainerServiceSshConfiguration ssh() { + return this.ssh; + } + + /** + * Set the ssh property: SSH configuration for Linux-based VMs running on Azure. + * + * @param ssh the ssh value to set. + * @return the ContainerServiceLinuxProfile object itself. + */ + public ContainerServiceLinuxProfile withSsh(ContainerServiceSshConfiguration ssh) { + this.ssh = ssh; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (adminUsername() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adminUsername in model ContainerServiceLinuxProfile")); + } + if (ssh() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ssh in model ContainerServiceLinuxProfile")); + } else { + ssh().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfileAutoGenerated.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfileAutoGenerated.java new file mode 100644 index 0000000000000..12c7da49b3bae --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfileAutoGenerated.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Profile for Linux VMs in the container service cluster. */ +@Fluent +public final class ContainerServiceLinuxProfileAutoGenerated { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceLinuxProfileAutoGenerated.class); + + /* + * The administrator username to use for Linux VMs. + */ + @JsonProperty(value = "adminUsername", required = true) + private String adminUsername; + + /* + * The SSH configuration for Linux-based VMs running on Azure. + */ + @JsonProperty(value = "ssh", required = true) + private ContainerServiceSshConfigurationAutoGenerated ssh; + + /** + * Get the adminUsername property: The administrator username to use for Linux VMs. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: The administrator username to use for Linux VMs. + * + * @param adminUsername the adminUsername value to set. + * @return the ContainerServiceLinuxProfileAutoGenerated object itself. + */ + public ContainerServiceLinuxProfileAutoGenerated withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the ssh property: The SSH configuration for Linux-based VMs running on Azure. + * + * @return the ssh value. + */ + public ContainerServiceSshConfigurationAutoGenerated ssh() { + return this.ssh; + } + + /** + * Set the ssh property: The SSH configuration for Linux-based VMs running on Azure. + * + * @param ssh the ssh value to set. + * @return the ContainerServiceLinuxProfileAutoGenerated object itself. + */ + public ContainerServiceLinuxProfileAutoGenerated withSsh(ContainerServiceSshConfigurationAutoGenerated ssh) { + this.ssh = ssh; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (adminUsername() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adminUsername in model ContainerServiceLinuxProfileAutoGenerated")); + } + if (ssh() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property ssh in model ContainerServiceLinuxProfileAutoGenerated")); + } else { + ssh().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceListResult.java new file mode 100644 index 0000000000000..0fd2f3775a955 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ContainerServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Container Services operation. */ +@Fluent +public final class ContainerServiceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceListResult.class); + + /* + * The list of container services. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of container service results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of container services. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of container services. + * + * @param value the value value to set. + * @return the ContainerServiceListResult object itself. + */ + public ContainerServiceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of container service results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceMasterProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceMasterProfile.java new file mode 100644 index 0000000000000..feee9072219a9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceMasterProfile.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Profile for the container service master. */ +@Fluent +public final class ContainerServiceMasterProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceMasterProfile.class); + + /* + * Number of masters (VMs) in the container service cluster. Allowed values + * are 1, 3, and 5. The default value is 1. + */ + @JsonProperty(value = "count") + private Count count; + + /* + * DNS prefix to be used to create the FQDN for the master pool. + */ + @JsonProperty(value = "dnsPrefix", required = true) + private String dnsPrefix; + + /* + * Size of agent VMs. + */ + @JsonProperty(value = "vmSize", required = true) + private ContainerServiceVMSizeTypes vmSize; + + /* + * OS Disk Size in GB to be used to specify the disk size for every machine + * in this master/agent pool. If you specify 0, it will apply the default + * osDisk size according to the vmSize specified. + */ + @JsonProperty(value = "osDiskSizeGB") + private Integer osDiskSizeGB; + + /* + * VNet SubnetID specifies the VNet's subnet identifier. + */ + @JsonProperty(value = "vnetSubnetID") + private String vnetSubnetId; + + /* + * FirstConsecutiveStaticIP used to specify the first static ip of masters. + */ + @JsonProperty(value = "firstConsecutiveStaticIP") + private String firstConsecutiveStaticIp; + + /* + * Storage profile specifies what kind of storage used. Choose from + * StorageAccount and ManagedDisks. Leave it empty, we will choose for you + * based on the orchestrator choice. + */ + @JsonProperty(value = "storageProfile") + private ContainerServiceStorageProfileTypes storageProfile; + + /* + * FQDN for the master pool. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * Get the count property: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. + * The default value is 1. + * + * @return the count value. + */ + public Count count() { + return this.count; + } + + /** + * Set the count property: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. + * The default value is 1. + * + * @param count the count value to set. + * @return the ContainerServiceMasterProfile object itself. + */ + public ContainerServiceMasterProfile withCount(Count count) { + this.count = count; + return this; + } + + /** + * Get the dnsPrefix property: DNS prefix to be used to create the FQDN for the master pool. + * + * @return the dnsPrefix value. + */ + public String dnsPrefix() { + return this.dnsPrefix; + } + + /** + * Set the dnsPrefix property: DNS prefix to be used to create the FQDN for the master pool. + * + * @param dnsPrefix the dnsPrefix value to set. + * @return the ContainerServiceMasterProfile object itself. + */ + public ContainerServiceMasterProfile withDnsPrefix(String dnsPrefix) { + this.dnsPrefix = dnsPrefix; + return this; + } + + /** + * Get the vmSize property: Size of agent VMs. + * + * @return the vmSize value. + */ + public ContainerServiceVMSizeTypes vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: Size of agent VMs. + * + * @param vmSize the vmSize value to set. + * @return the ContainerServiceMasterProfile object itself. + */ + public ContainerServiceMasterProfile withVmSize(ContainerServiceVMSizeTypes vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + * + * @return the osDiskSizeGB value. + */ + public Integer osDiskSizeGB() { + return this.osDiskSizeGB; + } + + /** + * Set the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in this + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + * + * @param osDiskSizeGB the osDiskSizeGB value to set. + * @return the ContainerServiceMasterProfile object itself. + */ + public ContainerServiceMasterProfile withOsDiskSizeGB(Integer osDiskSizeGB) { + this.osDiskSizeGB = osDiskSizeGB; + return this; + } + + /** + * Get the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier. + * + * @return the vnetSubnetId value. + */ + public String vnetSubnetId() { + return this.vnetSubnetId; + } + + /** + * Set the vnetSubnetId property: VNet SubnetID specifies the VNet's subnet identifier. + * + * @param vnetSubnetId the vnetSubnetId value to set. + * @return the ContainerServiceMasterProfile object itself. + */ + public ContainerServiceMasterProfile withVnetSubnetId(String vnetSubnetId) { + this.vnetSubnetId = vnetSubnetId; + return this; + } + + /** + * Get the firstConsecutiveStaticIp property: FirstConsecutiveStaticIP used to specify the first static ip of + * masters. + * + * @return the firstConsecutiveStaticIp value. + */ + public String firstConsecutiveStaticIp() { + return this.firstConsecutiveStaticIp; + } + + /** + * Set the firstConsecutiveStaticIp property: FirstConsecutiveStaticIP used to specify the first static ip of + * masters. + * + * @param firstConsecutiveStaticIp the firstConsecutiveStaticIp value to set. + * @return the ContainerServiceMasterProfile object itself. + */ + public ContainerServiceMasterProfile withFirstConsecutiveStaticIp(String firstConsecutiveStaticIp) { + this.firstConsecutiveStaticIp = firstConsecutiveStaticIp; + return this; + } + + /** + * Get the storageProfile property: Storage profile specifies what kind of storage used. Choose from StorageAccount + * and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. + * + * @return the storageProfile value. + */ + public ContainerServiceStorageProfileTypes storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: Storage profile specifies what kind of storage used. Choose from StorageAccount + * and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. + * + * @param storageProfile the storageProfile value to set. + * @return the ContainerServiceMasterProfile object itself. + */ + public ContainerServiceMasterProfile withStorageProfile(ContainerServiceStorageProfileTypes storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the fqdn property: FQDN for the master pool. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dnsPrefix() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dnsPrefix in model ContainerServiceMasterProfile")); + } + if (vmSize() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmSize in model ContainerServiceMasterProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceNetworkProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceNetworkProfile.java new file mode 100644 index 0000000000000..c382cf7c8b0e2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceNetworkProfile.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Profile of network configuration. */ +@Fluent +public final class ContainerServiceNetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceNetworkProfile.class); + + /* + * Network plugin used for building the Kubernetes network. + */ + @JsonProperty(value = "networkPlugin") + private NetworkPlugin networkPlugin; + + /* + * Network policy used for building the Kubernetes network. + */ + @JsonProperty(value = "networkPolicy") + private NetworkPolicy networkPolicy; + + /* + * The network mode Azure CNI is configured with. This cannot be specified + * if networkPlugin is anything other than 'azure'. + */ + @JsonProperty(value = "networkMode") + private NetworkMode networkMode; + + /* + * A CIDR notation IP range from which to assign pod IPs when kubenet is + * used. + */ + @JsonProperty(value = "podCidr") + private String podCidr; + + /* + * A CIDR notation IP range from which to assign service cluster IPs. It + * must not overlap with any Subnet IP ranges. + */ + @JsonProperty(value = "serviceCidr") + private String serviceCidr; + + /* + * An IP address assigned to the Kubernetes DNS service. It must be within + * the Kubernetes service address range specified in serviceCidr. + */ + @JsonProperty(value = "dnsServiceIP") + private String dnsServiceIp; + + /* + * A CIDR notation IP range assigned to the Docker bridge network. It must + * not overlap with any Subnet IP ranges or the Kubernetes service address + * range. + */ + @JsonProperty(value = "dockerBridgeCidr") + private String dockerBridgeCidr; + + /* + * The outbound (egress) routing method. This can only be set at cluster + * creation time and cannot be changed later. For more information see + * [egress outbound + * type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + */ + @JsonProperty(value = "outboundType") + private OutboundType outboundType; + + /* + * The load balancer sku for the managed cluster. The default is + * 'standard'. See [Azure Load Balancer + * SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more + * information about the differences between load balancer SKUs. + */ + @JsonProperty(value = "loadBalancerSku") + private LoadBalancerSku loadBalancerSku; + + /* + * Profile of the cluster load balancer. + */ + @JsonProperty(value = "loadBalancerProfile") + private ManagedClusterLoadBalancerProfile loadBalancerProfile; + + /* + * Profile of the cluster NAT gateway. + */ + @JsonProperty(value = "natGatewayProfile") + private ManagedClusterNatGatewayProfile natGatewayProfile; + + /** + * Get the networkPlugin property: Network plugin used for building the Kubernetes network. + * + * @return the networkPlugin value. + */ + public NetworkPlugin networkPlugin() { + return this.networkPlugin; + } + + /** + * Set the networkPlugin property: Network plugin used for building the Kubernetes network. + * + * @param networkPlugin the networkPlugin value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withNetworkPlugin(NetworkPlugin networkPlugin) { + this.networkPlugin = networkPlugin; + return this; + } + + /** + * Get the networkPolicy property: Network policy used for building the Kubernetes network. + * + * @return the networkPolicy value. + */ + public NetworkPolicy networkPolicy() { + return this.networkPolicy; + } + + /** + * Set the networkPolicy property: Network policy used for building the Kubernetes network. + * + * @param networkPolicy the networkPolicy value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withNetworkPolicy(NetworkPolicy networkPolicy) { + this.networkPolicy = networkPolicy; + return this; + } + + /** + * Get the networkMode property: The network mode Azure CNI is configured with. This cannot be specified if + * networkPlugin is anything other than 'azure'. + * + * @return the networkMode value. + */ + public NetworkMode networkMode() { + return this.networkMode; + } + + /** + * Set the networkMode property: The network mode Azure CNI is configured with. This cannot be specified if + * networkPlugin is anything other than 'azure'. + * + * @param networkMode the networkMode value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withNetworkMode(NetworkMode networkMode) { + this.networkMode = networkMode; + return this; + } + + /** + * Get the podCidr property: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + * + * @return the podCidr value. + */ + public String podCidr() { + return this.podCidr; + } + + /** + * Set the podCidr property: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + * + * @param podCidr the podCidr value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withPodCidr(String podCidr) { + this.podCidr = podCidr; + return this; + } + + /** + * Get the serviceCidr property: A CIDR notation IP range from which to assign service cluster IPs. It must not + * overlap with any Subnet IP ranges. + * + * @return the serviceCidr value. + */ + public String serviceCidr() { + return this.serviceCidr; + } + + /** + * Set the serviceCidr property: A CIDR notation IP range from which to assign service cluster IPs. It must not + * overlap with any Subnet IP ranges. + * + * @param serviceCidr the serviceCidr value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withServiceCidr(String serviceCidr) { + this.serviceCidr = serviceCidr; + return this; + } + + /** + * Get the dnsServiceIp property: An IP address assigned to the Kubernetes DNS service. It must be within the + * Kubernetes service address range specified in serviceCidr. + * + * @return the dnsServiceIp value. + */ + public String dnsServiceIp() { + return this.dnsServiceIp; + } + + /** + * Set the dnsServiceIp property: An IP address assigned to the Kubernetes DNS service. It must be within the + * Kubernetes service address range specified in serviceCidr. + * + * @param dnsServiceIp the dnsServiceIp value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withDnsServiceIp(String dnsServiceIp) { + this.dnsServiceIp = dnsServiceIp; + return this; + } + + /** + * Get the dockerBridgeCidr property: A CIDR notation IP range assigned to the Docker bridge network. It must not + * overlap with any Subnet IP ranges or the Kubernetes service address range. + * + * @return the dockerBridgeCidr value. + */ + public String dockerBridgeCidr() { + return this.dockerBridgeCidr; + } + + /** + * Set the dockerBridgeCidr property: A CIDR notation IP range assigned to the Docker bridge network. It must not + * overlap with any Subnet IP ranges or the Kubernetes service address range. + * + * @param dockerBridgeCidr the dockerBridgeCidr value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withDockerBridgeCidr(String dockerBridgeCidr) { + this.dockerBridgeCidr = dockerBridgeCidr; + return this; + } + + /** + * Get the outboundType property: The outbound (egress) routing method. This can only be set at cluster creation + * time and cannot be changed later. For more information see [egress outbound + * type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + * + * @return the outboundType value. + */ + public OutboundType outboundType() { + return this.outboundType; + } + + /** + * Set the outboundType property: The outbound (egress) routing method. This can only be set at cluster creation + * time and cannot be changed later. For more information see [egress outbound + * type](https://docs.microsoft.com/azure/aks/egress-outboundtype). + * + * @param outboundType the outboundType value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withOutboundType(OutboundType outboundType) { + this.outboundType = outboundType; + return this; + } + + /** + * Get the loadBalancerSku property: The load balancer sku for the managed cluster. The default is 'standard'. See + * [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the + * differences between load balancer SKUs. + * + * @return the loadBalancerSku value. + */ + public LoadBalancerSku loadBalancerSku() { + return this.loadBalancerSku; + } + + /** + * Set the loadBalancerSku property: The load balancer sku for the managed cluster. The default is 'standard'. See + * [Azure Load Balancer SKUs](https://docs.microsoft.com/azure/load-balancer/skus) for more information about the + * differences between load balancer SKUs. + * + * @param loadBalancerSku the loadBalancerSku value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withLoadBalancerSku(LoadBalancerSku loadBalancerSku) { + this.loadBalancerSku = loadBalancerSku; + return this; + } + + /** + * Get the loadBalancerProfile property: Profile of the cluster load balancer. + * + * @return the loadBalancerProfile value. + */ + public ManagedClusterLoadBalancerProfile loadBalancerProfile() { + return this.loadBalancerProfile; + } + + /** + * Set the loadBalancerProfile property: Profile of the cluster load balancer. + * + * @param loadBalancerProfile the loadBalancerProfile value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withLoadBalancerProfile( + ManagedClusterLoadBalancerProfile loadBalancerProfile) { + this.loadBalancerProfile = loadBalancerProfile; + return this; + } + + /** + * Get the natGatewayProfile property: Profile of the cluster NAT gateway. + * + * @return the natGatewayProfile value. + */ + public ManagedClusterNatGatewayProfile natGatewayProfile() { + return this.natGatewayProfile; + } + + /** + * Set the natGatewayProfile property: Profile of the cluster NAT gateway. + * + * @param natGatewayProfile the natGatewayProfile value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withNatGatewayProfile(ManagedClusterNatGatewayProfile natGatewayProfile) { + this.natGatewayProfile = natGatewayProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancerProfile() != null) { + loadBalancerProfile().validate(); + } + if (natGatewayProfile() != null) { + natGatewayProfile().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceOrchestratorProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceOrchestratorProfile.java new file mode 100644 index 0000000000000..cefa71d5a74f7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceOrchestratorProfile.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Profile for the container service orchestrator. */ +@Fluent +public final class ContainerServiceOrchestratorProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceOrchestratorProfile.class); + + /* + * The orchestrator to use to manage container service cluster resources. + * Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. + */ + @JsonProperty(value = "orchestratorType", required = true) + private ContainerServiceOrchestratorTypes orchestratorType; + + /* + * The version of the orchestrator to use. You can specify the + * major.minor.patch part of the actual version.For example, you can + * specify version as "1.6.11". + */ + @JsonProperty(value = "orchestratorVersion") + private String orchestratorVersion; + + /** + * Get the orchestratorType property: The orchestrator to use to manage container service cluster resources. Valid + * values are Kubernetes, Swarm, DCOS, DockerCE and Custom. + * + * @return the orchestratorType value. + */ + public ContainerServiceOrchestratorTypes orchestratorType() { + return this.orchestratorType; + } + + /** + * Set the orchestratorType property: The orchestrator to use to manage container service cluster resources. Valid + * values are Kubernetes, Swarm, DCOS, DockerCE and Custom. + * + * @param orchestratorType the orchestratorType value to set. + * @return the ContainerServiceOrchestratorProfile object itself. + */ + public ContainerServiceOrchestratorProfile withOrchestratorType( + ContainerServiceOrchestratorTypes orchestratorType) { + this.orchestratorType = orchestratorType; + return this; + } + + /** + * Get the orchestratorVersion property: The version of the orchestrator to use. You can specify the + * major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". + * + * @return the orchestratorVersion value. + */ + public String orchestratorVersion() { + return this.orchestratorVersion; + } + + /** + * Set the orchestratorVersion property: The version of the orchestrator to use. You can specify the + * major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". + * + * @param orchestratorVersion the orchestratorVersion value to set. + * @return the ContainerServiceOrchestratorProfile object itself. + */ + public ContainerServiceOrchestratorProfile withOrchestratorVersion(String orchestratorVersion) { + this.orchestratorVersion = orchestratorVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (orchestratorType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property orchestratorType in model ContainerServiceOrchestratorProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceOrchestratorTypes.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceOrchestratorTypes.java new file mode 100644 index 0000000000000..2582ed0047556 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceOrchestratorTypes.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerServiceOrchestratorTypes. */ +public final class ContainerServiceOrchestratorTypes extends ExpandableStringEnum { + /** Static value Kubernetes for ContainerServiceOrchestratorTypes. */ + public static final ContainerServiceOrchestratorTypes KUBERNETES = fromString("Kubernetes"); + + /** Static value Swarm for ContainerServiceOrchestratorTypes. */ + public static final ContainerServiceOrchestratorTypes SWARM = fromString("Swarm"); + + /** Static value DCOS for ContainerServiceOrchestratorTypes. */ + public static final ContainerServiceOrchestratorTypes DCOS = fromString("DCOS"); + + /** Static value DockerCE for ContainerServiceOrchestratorTypes. */ + public static final ContainerServiceOrchestratorTypes DOCKER_CE = fromString("DockerCE"); + + /** Static value Custom for ContainerServiceOrchestratorTypes. */ + public static final ContainerServiceOrchestratorTypes CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ContainerServiceOrchestratorTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerServiceOrchestratorTypes. + */ + @JsonCreator + public static ContainerServiceOrchestratorTypes fromString(String name) { + return fromString(name, ContainerServiceOrchestratorTypes.class); + } + + /** @return known ContainerServiceOrchestratorTypes values. */ + public static Collection values() { + return values(ContainerServiceOrchestratorTypes.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServicePrincipalProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServicePrincipalProfile.java new file mode 100644 index 0000000000000..ccb0593e1a283 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServicePrincipalProfile.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** + * Information about a service principal identity for the cluster to use for manipulating Azure APIs. Either secret or + * keyVaultSecretRef must be specified. + */ +@Fluent +public final class ContainerServicePrincipalProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServicePrincipalProfile.class); + + /* + * The ID for the service principal. + */ + @JsonProperty(value = "clientId", required = true) + private String clientId; + + /* + * The secret password associated with the service principal in plain text. + */ + @JsonProperty(value = "secret") + private String secret; + + /* + * Reference to a secret stored in Azure Key Vault. + */ + @JsonProperty(value = "keyVaultSecretRef") + private KeyVaultSecretRef keyVaultSecretRef; + + /** + * Get the clientId property: The ID for the service principal. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The ID for the service principal. + * + * @param clientId the clientId value to set. + * @return the ContainerServicePrincipalProfile object itself. + */ + public ContainerServicePrincipalProfile withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the secret property: The secret password associated with the service principal in plain text. + * + * @return the secret value. + */ + public String secret() { + return this.secret; + } + + /** + * Set the secret property: The secret password associated with the service principal in plain text. + * + * @param secret the secret value to set. + * @return the ContainerServicePrincipalProfile object itself. + */ + public ContainerServicePrincipalProfile withSecret(String secret) { + this.secret = secret; + return this; + } + + /** + * Get the keyVaultSecretRef property: Reference to a secret stored in Azure Key Vault. + * + * @return the keyVaultSecretRef value. + */ + public KeyVaultSecretRef keyVaultSecretRef() { + return this.keyVaultSecretRef; + } + + /** + * Set the keyVaultSecretRef property: Reference to a secret stored in Azure Key Vault. + * + * @param keyVaultSecretRef the keyVaultSecretRef value to set. + * @return the ContainerServicePrincipalProfile object itself. + */ + public ContainerServicePrincipalProfile withKeyVaultSecretRef(KeyVaultSecretRef keyVaultSecretRef) { + this.keyVaultSecretRef = keyVaultSecretRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clientId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clientId in model ContainerServicePrincipalProfile")); + } + if (keyVaultSecretRef() != null) { + keyVaultSecretRef().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfiguration.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfiguration.java new file mode 100644 index 0000000000000..9228e07862566 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfiguration.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** SSH configuration for Linux-based VMs running on Azure. */ +@Fluent +public final class ContainerServiceSshConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceSshConfiguration.class); + + /* + * The list of SSH public keys used to authenticate with Linux-based VMs. + * Only expect one key specified. + */ + @JsonProperty(value = "publicKeys", required = true) + private List publicKeys; + + /** + * Get the publicKeys property: The list of SSH public keys used to authenticate with Linux-based VMs. Only expect + * one key specified. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: The list of SSH public keys used to authenticate with Linux-based VMs. Only expect + * one key specified. + * + * @param publicKeys the publicKeys value to set. + * @return the ContainerServiceSshConfiguration object itself. + */ + public ContainerServiceSshConfiguration withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publicKeys in model ContainerServiceSshConfiguration")); + } else { + publicKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfigurationAutoGenerated.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfigurationAutoGenerated.java new file mode 100644 index 0000000000000..0a7d2900118da --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfigurationAutoGenerated.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** SSH configuration for Linux-based VMs running on Azure. */ +@Fluent +public final class ContainerServiceSshConfigurationAutoGenerated { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ContainerServiceSshConfigurationAutoGenerated.class); + + /* + * The list of SSH public keys used to authenticate with Linux-based VMs. A + * maximum of 1 key may be specified. + */ + @JsonProperty(value = "publicKeys", required = true) + private List publicKeys; + + /** + * Get the publicKeys property: The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of + * 1 key may be specified. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of + * 1 key may be specified. + * + * @param publicKeys the publicKeys value to set. + * @return the ContainerServiceSshConfigurationAutoGenerated object itself. + */ + public ContainerServiceSshConfigurationAutoGenerated withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property publicKeys in model ContainerServiceSshConfigurationAutoGenerated")); + } else { + publicKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshPublicKey.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshPublicKey.java new file mode 100644 index 0000000000000..dedfc5385b455 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshPublicKey.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Contains information about SSH certificate public key data. */ +@Fluent +public final class ContainerServiceSshPublicKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceSshPublicKey.class); + + /* + * Certificate public key used to authenticate with VMs through SSH. The + * certificate must be in PEM format with or without headers. + */ + @JsonProperty(value = "keyData", required = true) + private String keyData; + + /** + * Get the keyData property: Certificate public key used to authenticate with VMs through SSH. The certificate must + * be in PEM format with or without headers. + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: Certificate public key used to authenticate with VMs through SSH. The certificate must + * be in PEM format with or without headers. + * + * @param keyData the keyData value to set. + * @return the ContainerServiceSshPublicKey object itself. + */ + public ContainerServiceSshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyData() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyData in model ContainerServiceSshPublicKey")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceStorageProfileTypes.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceStorageProfileTypes.java new file mode 100644 index 0000000000000..0ee43842982fa --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceStorageProfileTypes.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerServiceStorageProfileTypes. */ +public final class ContainerServiceStorageProfileTypes + extends ExpandableStringEnum { + /** Static value StorageAccount for ContainerServiceStorageProfileTypes. */ + public static final ContainerServiceStorageProfileTypes STORAGE_ACCOUNT = fromString("StorageAccount"); + + /** Static value ManagedDisks for ContainerServiceStorageProfileTypes. */ + public static final ContainerServiceStorageProfileTypes MANAGED_DISKS = fromString("ManagedDisks"); + + /** + * Creates or finds a ContainerServiceStorageProfileTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerServiceStorageProfileTypes. + */ + @JsonCreator + public static ContainerServiceStorageProfileTypes fromString(String name) { + return fromString(name, ContainerServiceStorageProfileTypes.class); + } + + /** @return known ContainerServiceStorageProfileTypes values. */ + public static Collection values() { + return values(ContainerServiceStorageProfileTypes.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceVMDiagnostics.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceVMDiagnostics.java new file mode 100644 index 0000000000000..cc02227ee0e30 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceVMDiagnostics.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Profile for diagnostics on the container service VMs. */ +@Fluent +public final class ContainerServiceVMDiagnostics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceVMDiagnostics.class); + + /* + * Whether the VM diagnostic agent is provisioned on the VM. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * The URI of the storage account where diagnostics are stored. + */ + @JsonProperty(value = "storageUri", access = JsonProperty.Access.WRITE_ONLY) + private String storageUri; + + /** + * Get the enabled property: Whether the VM diagnostic agent is provisioned on the VM. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the VM diagnostic agent is provisioned on the VM. + * + * @param enabled the enabled value to set. + * @return the ContainerServiceVMDiagnostics object itself. + */ + public ContainerServiceVMDiagnostics withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the storageUri property: The URI of the storage account where diagnostics are stored. + * + * @return the storageUri value. + */ + public String storageUri() { + return this.storageUri; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceVMSizeTypes.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceVMSizeTypes.java new file mode 100644 index 0000000000000..100e73022f1b4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceVMSizeTypes.java @@ -0,0 +1,550 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerServiceVMSizeTypes. */ +public final class ContainerServiceVMSizeTypes extends ExpandableStringEnum { + /** Static value Standard_A1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A1 = fromString("Standard_A1"); + + /** Static value Standard_A10 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A10 = fromString("Standard_A10"); + + /** Static value Standard_A11 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A11 = fromString("Standard_A11"); + + /** Static value Standard_A1_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A1_V2 = fromString("Standard_A1_v2"); + + /** Static value Standard_A2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A2 = fromString("Standard_A2"); + + /** Static value Standard_A2_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A2_V2 = fromString("Standard_A2_v2"); + + /** Static value Standard_A2m_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A2M_V2 = fromString("Standard_A2m_v2"); + + /** Static value Standard_A3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A3 = fromString("Standard_A3"); + + /** Static value Standard_A4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A4 = fromString("Standard_A4"); + + /** Static value Standard_A4_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A4_V2 = fromString("Standard_A4_v2"); + + /** Static value Standard_A4m_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A4M_V2 = fromString("Standard_A4m_v2"); + + /** Static value Standard_A5 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A5 = fromString("Standard_A5"); + + /** Static value Standard_A6 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A6 = fromString("Standard_A6"); + + /** Static value Standard_A7 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A7 = fromString("Standard_A7"); + + /** Static value Standard_A8 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A8 = fromString("Standard_A8"); + + /** Static value Standard_A8_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A8_V2 = fromString("Standard_A8_v2"); + + /** Static value Standard_A8m_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A8M_V2 = fromString("Standard_A8m_v2"); + + /** Static value Standard_A9 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_A9 = fromString("Standard_A9"); + + /** Static value Standard_B2ms for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_B2MS = fromString("Standard_B2ms"); + + /** Static value Standard_B2s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_B2S = fromString("Standard_B2s"); + + /** Static value Standard_B4ms for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_B4MS = fromString("Standard_B4ms"); + + /** Static value Standard_B8ms for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_B8MS = fromString("Standard_B8ms"); + + /** Static value Standard_D1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D1 = fromString("Standard_D1"); + + /** Static value Standard_D11 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D11 = fromString("Standard_D11"); + + /** Static value Standard_D11_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D11_V2 = fromString("Standard_D11_v2"); + + /** Static value Standard_D11_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D11_V2_PROMO = fromString("Standard_D11_v2_Promo"); + + /** Static value Standard_D12 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D12 = fromString("Standard_D12"); + + /** Static value Standard_D12_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D12_V2 = fromString("Standard_D12_v2"); + + /** Static value Standard_D12_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D12_V2_PROMO = fromString("Standard_D12_v2_Promo"); + + /** Static value Standard_D13 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D13 = fromString("Standard_D13"); + + /** Static value Standard_D13_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D13_V2 = fromString("Standard_D13_v2"); + + /** Static value Standard_D13_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D13_V2_PROMO = fromString("Standard_D13_v2_Promo"); + + /** Static value Standard_D14 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D14 = fromString("Standard_D14"); + + /** Static value Standard_D14_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D14_V2 = fromString("Standard_D14_v2"); + + /** Static value Standard_D14_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D14_V2_PROMO = fromString("Standard_D14_v2_Promo"); + + /** Static value Standard_D15_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D15_V2 = fromString("Standard_D15_v2"); + + /** Static value Standard_D16_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D16_V3 = fromString("Standard_D16_v3"); + + /** Static value Standard_D16s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D16S_V3 = fromString("Standard_D16s_v3"); + + /** Static value Standard_D1_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D1_V2 = fromString("Standard_D1_v2"); + + /** Static value Standard_D2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D2 = fromString("Standard_D2"); + + /** Static value Standard_D2_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D2_V2 = fromString("Standard_D2_v2"); + + /** Static value Standard_D2_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D2_V2_PROMO = fromString("Standard_D2_v2_Promo"); + + /** Static value Standard_D2_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D2_V3 = fromString("Standard_D2_v3"); + + /** Static value Standard_D2s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D2S_V3 = fromString("Standard_D2s_v3"); + + /** Static value Standard_D3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D3 = fromString("Standard_D3"); + + /** Static value Standard_D32_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D32_V3 = fromString("Standard_D32_v3"); + + /** Static value Standard_D32s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D32S_V3 = fromString("Standard_D32s_v3"); + + /** Static value Standard_D3_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D3_V2 = fromString("Standard_D3_v2"); + + /** Static value Standard_D3_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D3_V2_PROMO = fromString("Standard_D3_v2_Promo"); + + /** Static value Standard_D4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D4 = fromString("Standard_D4"); + + /** Static value Standard_D4_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D4_V2 = fromString("Standard_D4_v2"); + + /** Static value Standard_D4_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D4_V2_PROMO = fromString("Standard_D4_v2_Promo"); + + /** Static value Standard_D4_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D4_V3 = fromString("Standard_D4_v3"); + + /** Static value Standard_D4s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D4S_V3 = fromString("Standard_D4s_v3"); + + /** Static value Standard_D5_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D5_V2 = fromString("Standard_D5_v2"); + + /** Static value Standard_D5_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D5_V2_PROMO = fromString("Standard_D5_v2_Promo"); + + /** Static value Standard_D64_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D64_V3 = fromString("Standard_D64_v3"); + + /** Static value Standard_D64s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D64S_V3 = fromString("Standard_D64s_v3"); + + /** Static value Standard_D8_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D8_V3 = fromString("Standard_D8_v3"); + + /** Static value Standard_D8s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_D8S_V3 = fromString("Standard_D8s_v3"); + + /** Static value Standard_DS1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS1 = fromString("Standard_DS1"); + + /** Static value Standard_DS11 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS11 = fromString("Standard_DS11"); + + /** Static value Standard_DS11_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS11_V2 = fromString("Standard_DS11_v2"); + + /** Static value Standard_DS11_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS11_V2_PROMO = fromString("Standard_DS11_v2_Promo"); + + /** Static value Standard_DS12 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS12 = fromString("Standard_DS12"); + + /** Static value Standard_DS12_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS12_V2 = fromString("Standard_DS12_v2"); + + /** Static value Standard_DS12_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS12_V2_PROMO = fromString("Standard_DS12_v2_Promo"); + + /** Static value Standard_DS13 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS13 = fromString("Standard_DS13"); + + /** Static value Standard_DS13-2_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS13_2_V2 = fromString("Standard_DS13-2_v2"); + + /** Static value Standard_DS13-4_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS13_4_V2 = fromString("Standard_DS13-4_v2"); + + /** Static value Standard_DS13_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); + + /** Static value Standard_DS13_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS13_V2_PROMO = fromString("Standard_DS13_v2_Promo"); + + /** Static value Standard_DS14 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS14 = fromString("Standard_DS14"); + + /** Static value Standard_DS14-4_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS14_4_V2 = fromString("Standard_DS14-4_v2"); + + /** Static value Standard_DS14-8_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS14_8_V2 = fromString("Standard_DS14-8_v2"); + + /** Static value Standard_DS14_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS14_V2 = fromString("Standard_DS14_v2"); + + /** Static value Standard_DS14_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS14_V2_PROMO = fromString("Standard_DS14_v2_Promo"); + + /** Static value Standard_DS15_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS15_V2 = fromString("Standard_DS15_v2"); + + /** Static value Standard_DS1_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS1_V2 = fromString("Standard_DS1_v2"); + + /** Static value Standard_DS2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS2 = fromString("Standard_DS2"); + + /** Static value Standard_DS2_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS2_V2 = fromString("Standard_DS2_v2"); + + /** Static value Standard_DS2_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS2_V2_PROMO = fromString("Standard_DS2_v2_Promo"); + + /** Static value Standard_DS3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS3 = fromString("Standard_DS3"); + + /** Static value Standard_DS3_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS3_V2 = fromString("Standard_DS3_v2"); + + /** Static value Standard_DS3_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS3_V2_PROMO = fromString("Standard_DS3_v2_Promo"); + + /** Static value Standard_DS4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS4 = fromString("Standard_DS4"); + + /** Static value Standard_DS4_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); + + /** Static value Standard_DS4_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS4_V2_PROMO = fromString("Standard_DS4_v2_Promo"); + + /** Static value Standard_DS5_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); + + /** Static value Standard_DS5_v2_Promo for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_DS5_V2_PROMO = fromString("Standard_DS5_v2_Promo"); + + /** Static value Standard_E16_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E16_V3 = fromString("Standard_E16_v3"); + + /** Static value Standard_E16s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E16S_V3 = fromString("Standard_E16s_v3"); + + /** Static value Standard_E2_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E2_V3 = fromString("Standard_E2_v3"); + + /** Static value Standard_E2s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E2S_V3 = fromString("Standard_E2s_v3"); + + /** Static value Standard_E32-16s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E32_16S_V3 = fromString("Standard_E32-16s_v3"); + + /** Static value Standard_E32-8s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E32_8S_V3 = fromString("Standard_E32-8s_v3"); + + /** Static value Standard_E32_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E32_V3 = fromString("Standard_E32_v3"); + + /** Static value Standard_E32s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E32S_V3 = fromString("Standard_E32s_v3"); + + /** Static value Standard_E4_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E4_V3 = fromString("Standard_E4_v3"); + + /** Static value Standard_E4s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E4S_V3 = fromString("Standard_E4s_v3"); + + /** Static value Standard_E64-16s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E64_16S_V3 = fromString("Standard_E64-16s_v3"); + + /** Static value Standard_E64-32s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E64_32S_V3 = fromString("Standard_E64-32s_v3"); + + /** Static value Standard_E64_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E64_V3 = fromString("Standard_E64_v3"); + + /** Static value Standard_E64s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E64S_V3 = fromString("Standard_E64s_v3"); + + /** Static value Standard_E8_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E8_V3 = fromString("Standard_E8_v3"); + + /** Static value Standard_E8s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_E8S_V3 = fromString("Standard_E8s_v3"); + + /** Static value Standard_F1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F1 = fromString("Standard_F1"); + + /** Static value Standard_F16 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F16 = fromString("Standard_F16"); + + /** Static value Standard_F16s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F16S = fromString("Standard_F16s"); + + /** Static value Standard_F16s_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F16S_V2 = fromString("Standard_F16s_v2"); + + /** Static value Standard_F1s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F1S = fromString("Standard_F1s"); + + /** Static value Standard_F2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F2 = fromString("Standard_F2"); + + /** Static value Standard_F2s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F2S = fromString("Standard_F2s"); + + /** Static value Standard_F2s_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F2S_V2 = fromString("Standard_F2s_v2"); + + /** Static value Standard_F32s_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F32S_V2 = fromString("Standard_F32s_v2"); + + /** Static value Standard_F4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F4 = fromString("Standard_F4"); + + /** Static value Standard_F4s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F4S = fromString("Standard_F4s"); + + /** Static value Standard_F4s_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F4S_V2 = fromString("Standard_F4s_v2"); + + /** Static value Standard_F64s_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F64S_V2 = fromString("Standard_F64s_v2"); + + /** Static value Standard_F72s_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F72S_V2 = fromString("Standard_F72s_v2"); + + /** Static value Standard_F8 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F8 = fromString("Standard_F8"); + + /** Static value Standard_F8s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F8S = fromString("Standard_F8s"); + + /** Static value Standard_F8s_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_F8S_V2 = fromString("Standard_F8s_v2"); + + /** Static value Standard_G1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_G1 = fromString("Standard_G1"); + + /** Static value Standard_G2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_G2 = fromString("Standard_G2"); + + /** Static value Standard_G3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_G3 = fromString("Standard_G3"); + + /** Static value Standard_G4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_G4 = fromString("Standard_G4"); + + /** Static value Standard_G5 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_G5 = fromString("Standard_G5"); + + /** Static value Standard_GS1 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS1 = fromString("Standard_GS1"); + + /** Static value Standard_GS2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS2 = fromString("Standard_GS2"); + + /** Static value Standard_GS3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS3 = fromString("Standard_GS3"); + + /** Static value Standard_GS4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS4 = fromString("Standard_GS4"); + + /** Static value Standard_GS4-4 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS4_4 = fromString("Standard_GS4-4"); + + /** Static value Standard_GS4-8 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS4_8 = fromString("Standard_GS4-8"); + + /** Static value Standard_GS5 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS5 = fromString("Standard_GS5"); + + /** Static value Standard_GS5-16 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS5_16 = fromString("Standard_GS5-16"); + + /** Static value Standard_GS5-8 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_GS5_8 = fromString("Standard_GS5-8"); + + /** Static value Standard_H16 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_H16 = fromString("Standard_H16"); + + /** Static value Standard_H16m for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_H16M = fromString("Standard_H16m"); + + /** Static value Standard_H16mr for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_H16MR = fromString("Standard_H16mr"); + + /** Static value Standard_H16r for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_H16R = fromString("Standard_H16r"); + + /** Static value Standard_H8 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_H8 = fromString("Standard_H8"); + + /** Static value Standard_H8m for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_H8M = fromString("Standard_H8m"); + + /** Static value Standard_L16s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_L16S = fromString("Standard_L16s"); + + /** Static value Standard_L32s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_L32S = fromString("Standard_L32s"); + + /** Static value Standard_L4s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_L4S = fromString("Standard_L4s"); + + /** Static value Standard_L8s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_L8S = fromString("Standard_L8s"); + + /** Static value Standard_M128-32ms for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_M128_32MS = fromString("Standard_M128-32ms"); + + /** Static value Standard_M128-64ms for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_M128_64MS = fromString("Standard_M128-64ms"); + + /** Static value Standard_M128ms for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_M128MS = fromString("Standard_M128ms"); + + /** Static value Standard_M128s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_M128S = fromString("Standard_M128s"); + + /** Static value Standard_M64-16ms for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_M64_16MS = fromString("Standard_M64-16ms"); + + /** Static value Standard_M64-32ms for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_M64_32MS = fromString("Standard_M64-32ms"); + + /** Static value Standard_M64ms for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_M64MS = fromString("Standard_M64ms"); + + /** Static value Standard_M64s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_M64S = fromString("Standard_M64s"); + + /** Static value Standard_NC12 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC12 = fromString("Standard_NC12"); + + /** Static value Standard_NC12s_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC12S_V2 = fromString("Standard_NC12s_v2"); + + /** Static value Standard_NC12s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC12S_V3 = fromString("Standard_NC12s_v3"); + + /** Static value Standard_NC24 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC24 = fromString("Standard_NC24"); + + /** Static value Standard_NC24r for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC24R = fromString("Standard_NC24r"); + + /** Static value Standard_NC24rs_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC24RS_V2 = fromString("Standard_NC24rs_v2"); + + /** Static value Standard_NC24rs_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC24RS_V3 = fromString("Standard_NC24rs_v3"); + + /** Static value Standard_NC24s_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC24S_V2 = fromString("Standard_NC24s_v2"); + + /** Static value Standard_NC24s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC24S_V3 = fromString("Standard_NC24s_v3"); + + /** Static value Standard_NC6 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC6 = fromString("Standard_NC6"); + + /** Static value Standard_NC6s_v2 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC6S_V2 = fromString("Standard_NC6s_v2"); + + /** Static value Standard_NC6s_v3 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NC6S_V3 = fromString("Standard_NC6s_v3"); + + /** Static value Standard_ND12s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_ND12S = fromString("Standard_ND12s"); + + /** Static value Standard_ND24rs for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_ND24RS = fromString("Standard_ND24rs"); + + /** Static value Standard_ND24s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_ND24S = fromString("Standard_ND24s"); + + /** Static value Standard_ND6s for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_ND6S = fromString("Standard_ND6s"); + + /** Static value Standard_NV12 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NV12 = fromString("Standard_NV12"); + + /** Static value Standard_NV24 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NV24 = fromString("Standard_NV24"); + + /** Static value Standard_NV6 for ContainerServiceVMSizeTypes. */ + public static final ContainerServiceVMSizeTypes STANDARD_NV6 = fromString("Standard_NV6"); + + /** + * Creates or finds a ContainerServiceVMSizeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerServiceVMSizeTypes. + */ + @JsonCreator + public static ContainerServiceVMSizeTypes fromString(String name) { + return fromString(name, ContainerServiceVMSizeTypes.class); + } + + /** @return known ContainerServiceVMSizeTypes values. */ + public static Collection values() { + return values(ContainerServiceVMSizeTypes.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceWindowsProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceWindowsProfile.java new file mode 100644 index 0000000000000..0d2821438f830 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceWindowsProfile.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.containerservice.generated.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; + +/** Profile for Windows VMs in the container service cluster. */ +@Fluent +public final class ContainerServiceWindowsProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerServiceWindowsProfile.class); + + /* + * The administrator username to use for Windows VMs. + */ + @JsonProperty(value = "adminUsername", required = true) + private String adminUsername; + + /* + * The administrator password to use for Windows VMs. + */ + @JsonProperty(value = "adminPassword", required = true) + private String adminPassword; + + /** + * Get the adminUsername property: The administrator username to use for Windows VMs. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: The administrator username to use for Windows VMs. + * + * @param adminUsername the adminUsername value to set. + * @return the ContainerServiceWindowsProfile object itself. + */ + public ContainerServiceWindowsProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: The administrator password to use for Windows VMs. + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: The administrator password to use for Windows VMs. + * + * @param adminPassword the adminPassword value to set. + * @return the ContainerServiceWindowsProfile object itself. + */ + public ContainerServiceWindowsProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (adminUsername() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adminUsername in model ContainerServiceWindowsProfile")); + } + if (adminPassword() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adminPassword in model ContainerServiceWindowsProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServices.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServices.java new file mode 100644 index 0000000000000..1c2b80edb4bac --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServices.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 ContainerServices. */ +public interface ContainerServices { + /** + * Gets a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 list of container services in the specified subscription. + */ + PagedIterable list(); + + /** + * Gets a list of container services in the specified subscription. The operation returns properties of each + * container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. + * + * @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 list of container services in the specified subscription. + */ + PagedIterable list(Context context); + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the properties of the specified container service in the specified subscription and resource group. + */ + ContainerService getByResourceGroup(String resourceGroupName, String containerServiceName); + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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 the properties of the specified container service in the specified subscription and resource group. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String containerServiceName, Context context); + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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. + */ + void deleteByResourceGroup(String resourceGroupName, String containerServiceName); + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @param resourceGroupName The name of the resource group. + * @param containerServiceName The name of the container service in the specified subscription and 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. + */ + void delete(String resourceGroupName, String containerServiceName, Context context); + + /** + * Gets a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 a list of container services in the specified subscription and resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of container services in the specified subscription and resource group. The operation returns + * properties of each container service including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 a list of container services in the specified subscription and resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each + * orchestrator including version, available upgrades and whether that version or upgrades are in preview. + * + * @param location The name of a supported Azure region. + * @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 list of supported orchestrators in the specified subscription. + */ + OrchestratorVersionProfileListResult listOrchestrators(String location); + + /** + * Gets a list of supported orchestrators in the specified subscription. The operation returns properties of each + * orchestrator including version, available upgrades and whether that version or upgrades are in preview. + * + * @param location The name of a supported Azure region. + * @param resourceType resource type for which the list of orchestrators needs to be returned. + * @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 list of supported orchestrators in the specified subscription. + */ + Response listOrchestratorsWithResponse( + String location, String resourceType, Context context); + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 the properties of the specified container service in the specified subscription and resource group. + */ + ContainerService getById(String id); + + /** + * Gets the properties of the specified container service in the specified subscription and resource group. The + * operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of + * masters and agents. + * + * @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 the properties of the specified container service in the specified subscription and resource group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @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); + + /** + * Deletes the specified container service in the specified subscription and resource group. The operation does not + * delete other resources created as part of creating a container service, including storage accounts, VMs, and + * availability sets. All the other resources created with the container service are part of the same resource group + * and can be deleted individually. + * + * @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 ContainerService resource. + * + * @param name resource name. + * @return the first stage of the new ContainerService definition. + */ + ContainerService.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Count.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Count.java new file mode 100644 index 0000000000000..b910750cc5e82 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Count.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.containerservice.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Count. */ +public enum Count { + /** Enum value 1. */ + ONE("1"), + + /** Enum value 3. */ + THREE("3"), + + /** Enum value 5. */ + FIVE("5"); + + /** The actual serialized value for a Count instance. */ + private final String value; + + Count(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Count instance. + * + * @param value the serialized value to parse. + * @return the parsed Count object, or null if unable to parse. + */ + @JsonCreator + public static Count fromString(String value) { + Count[] items = Count.values(); + for (Count item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CreationData.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CreationData.java new file mode 100644 index 0000000000000..a7e063ba69b3e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CreationData.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.containerservice.generated.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; + +/** Data used when creating a target resource from a source resource. */ +@Fluent +public final class CreationData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreationData.class); + + /* + * This is the ARM ID of the source object to be used to create the target + * object. + */ + @JsonProperty(value = "sourceResourceId") + private String sourceResourceId; + + /** + * Get the sourceResourceId property: This is the ARM ID of the source object to be used to create the target + * object. + * + * @return the sourceResourceId value. + */ + public String sourceResourceId() { + return this.sourceResourceId; + } + + /** + * Set the sourceResourceId property: This is the ARM ID of the source object to be used to create the target + * object. + * + * @param sourceResourceId the sourceResourceId value to set. + * @return the CreationData object itself. + */ + public CreationData withSourceResourceId(String sourceResourceId) { + this.sourceResourceId = sourceResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResult.java new file mode 100644 index 0000000000000..04a124abf3b3e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The credential result response. */ +@Immutable +public final class CredentialResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CredentialResult.class); + + /* + * The name of the credential. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Base64-encoded Kubernetes configuration file. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private byte[] value; + + /** + * Get the name property: The name of the credential. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: Base64-encoded Kubernetes configuration file. + * + * @return the value value. + */ + public byte[] value() { + return CoreUtils.clone(this.value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResults.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResults.java new file mode 100644 index 0000000000000..f9999261a1ba3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResults.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner; +import java.util.List; + +/** An immutable client-side representation of CredentialResults. */ +public interface CredentialResults { + /** + * Gets the kubeconfigs property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeconfigs value. + */ + List kubeconfigs(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.CredentialResultsInner object. + * + * @return the inner object. + */ + CredentialResultsInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDependency.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDependency.java new file mode 100644 index 0000000000000..95de44850a0d3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDependency.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** A domain name that AKS agent nodes are reaching at. */ +@Fluent +public final class EndpointDependency { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointDependency.class); + + /* + * The domain name of the dependency. + */ + @JsonProperty(value = "domainName") + private String domainName; + + /* + * The Ports and Protocols used when connecting to domainName. + */ + @JsonProperty(value = "endpointDetails") + private List endpointDetails; + + /** + * Get the domainName property: The domain name of the dependency. + * + * @return the domainName value. + */ + public String domainName() { + return this.domainName; + } + + /** + * Set the domainName property: The domain name of the dependency. + * + * @param domainName the domainName value to set. + * @return the EndpointDependency object itself. + */ + public EndpointDependency withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get the endpointDetails property: The Ports and Protocols used when connecting to domainName. + * + * @return the endpointDetails value. + */ + public List endpointDetails() { + return this.endpointDetails; + } + + /** + * Set the endpointDetails property: The Ports and Protocols used when connecting to domainName. + * + * @param endpointDetails the endpointDetails value to set. + * @return the EndpointDependency object itself. + */ + public EndpointDependency withEndpointDetails(List endpointDetails) { + this.endpointDetails = endpointDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpointDetails() != null) { + endpointDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDetail.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDetail.java new file mode 100644 index 0000000000000..6e64f4014a21e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDetail.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** connect information from the AKS agent nodes to a single endpoint. */ +@Fluent +public final class EndpointDetail { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EndpointDetail.class); + + /* + * An IP Address that Domain Name currently resolves to. + */ + @JsonProperty(value = "ipAddress") + private String ipAddress; + + /* + * The port an endpoint is connected to. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The protocol used for connection + */ + @JsonProperty(value = "protocol") + private String protocol; + + /* + * Description of the detail + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the ipAddress property: An IP Address that Domain Name currently resolves to. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Set the ipAddress property: An IP Address that Domain Name currently resolves to. + * + * @param ipAddress the ipAddress value to set. + * @return the EndpointDetail object itself. + */ + public EndpointDetail withIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the port property: The port an endpoint is connected to. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port an endpoint is connected to. + * + * @param port the port value to set. + * @return the EndpointDetail object itself. + */ + public EndpointDetail withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the protocol property: The protocol used for connection. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol used for connection. + * + * @param protocol the protocol value to set. + * @return the EndpointDetail object itself. + */ + public EndpointDetail withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the description property: Description of the detail. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the detail. + * + * @param description the description value to set. + * @return the EndpointDetail object itself. + */ + public EndpointDetail withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Expander.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Expander.java new file mode 100644 index 0000000000000..49c9bbb33f27f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Expander.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Expander. */ +public final class Expander extends ExpandableStringEnum { + /** Static value least-waste for Expander. */ + public static final Expander LEAST_WASTE = fromString("least-waste"); + + /** Static value most-pods for Expander. */ + public static final Expander MOST_PODS = fromString("most-pods"); + + /** Static value priority for Expander. */ + public static final Expander PRIORITY = fromString("priority"); + + /** Static value random for Expander. */ + public static final Expander RANDOM = fromString("random"); + + /** + * Creates or finds a Expander from its string representation. + * + * @param name a name to look for. + * @return the corresponding Expander. + */ + @JsonCreator + public static Expander fromString(String name) { + return fromString(name, Expander.class); + } + + /** @return known Expander values. */ + public static Collection values() { + return values(Expander.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocation.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocation.java new file mode 100644 index 0000000000000..09754a02d5be2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocation.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 complex type of the extended location. */ +@Fluent +public final class ExtendedLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedLocation.class); + + /* + * The name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type of the extended location. + */ + @JsonProperty(value = "type") + private ExtendedLocationTypes type; + + /** + * Get the name property: The name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of the extended location. + * + * @return the type value. + */ + public ExtendedLocationTypes type() { + return this.type; + } + + /** + * Set the type property: The type of the extended location. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationTypes type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocationTypes.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocationTypes.java new file mode 100644 index 0000000000000..1bfc34e4ce8a3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocationTypes.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ExtendedLocationTypes. */ +public final class ExtendedLocationTypes extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationTypes. */ + public static final ExtendedLocationTypes EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates or finds a ExtendedLocationTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationTypes. + */ + @JsonCreator + public static ExtendedLocationTypes fromString(String name) { + return fromString(name, ExtendedLocationTypes.class); + } + + /** @return known ExtendedLocationTypes values. */ + public static Collection values() { + return values(ExtendedLocationTypes.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GpuInstanceProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GpuInstanceProfile.java new file mode 100644 index 0000000000000..cec34d105b8f0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/GpuInstanceProfile.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GpuInstanceProfile. */ +public final class GpuInstanceProfile extends ExpandableStringEnum { + /** Static value MIG1g for GpuInstanceProfile. */ + public static final GpuInstanceProfile MIG1G = fromString("MIG1g"); + + /** Static value MIG2g for GpuInstanceProfile. */ + public static final GpuInstanceProfile MIG2G = fromString("MIG2g"); + + /** Static value MIG3g for GpuInstanceProfile. */ + public static final GpuInstanceProfile MIG3G = fromString("MIG3g"); + + /** Static value MIG4g for GpuInstanceProfile. */ + public static final GpuInstanceProfile MIG4G = fromString("MIG4g"); + + /** Static value MIG7g for GpuInstanceProfile. */ + public static final GpuInstanceProfile MIG7G = fromString("MIG7g"); + + /** + * Creates or finds a GpuInstanceProfile from its string representation. + * + * @param name a name to look for. + * @return the corresponding GpuInstanceProfile. + */ + @JsonCreator + public static GpuInstanceProfile fromString(String name) { + return fromString(name, GpuInstanceProfile.class); + } + + /** @return known GpuInstanceProfile values. */ + public static Collection values() { + return values(GpuInstanceProfile.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KeyVaultSecretRef.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KeyVaultSecretRef.java new file mode 100644 index 0000000000000..a19319a7f7635 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KeyVaultSecretRef.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Reference to a secret stored in Azure Key Vault. */ +@Fluent +public final class KeyVaultSecretRef { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultSecretRef.class); + + /* + * Key vault identifier. + */ + @JsonProperty(value = "vaultID", required = true) + private String vaultId; + + /* + * The secret name. + */ + @JsonProperty(value = "secretName", required = true) + private String secretName; + + /* + * The secret version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the vaultId property: Key vault identifier. + * + * @return the vaultId value. + */ + public String vaultId() { + return this.vaultId; + } + + /** + * Set the vaultId property: Key vault identifier. + * + * @param vaultId the vaultId value to set. + * @return the KeyVaultSecretRef object itself. + */ + public KeyVaultSecretRef withVaultId(String vaultId) { + this.vaultId = vaultId; + return this; + } + + /** + * Get the secretName property: The secret name. + * + * @return the secretName value. + */ + public String secretName() { + return this.secretName; + } + + /** + * Set the secretName property: The secret name. + * + * @param secretName the secretName value to set. + * @return the KeyVaultSecretRef object itself. + */ + public KeyVaultSecretRef withSecretName(String secretName) { + this.secretName = secretName; + return this; + } + + /** + * Get the version property: The secret version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The secret version. + * + * @param version the version value to set. + * @return the KeyVaultSecretRef object itself. + */ + public KeyVaultSecretRef withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vaultId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property vaultId in model KeyVaultSecretRef")); + } + if (secretName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property secretName in model KeyVaultSecretRef")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletConfig.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletConfig.java new file mode 100644 index 0000000000000..3b509f6c22730 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletConfig.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** + * See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + */ +@Fluent +public final class KubeletConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KubeletConfig.class); + + /* + * The CPU Manager policy to use. The default is 'none'. See [Kubernetes + * CPU management + * policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + * for more information. Allowed values are 'none' and 'static'. + */ + @JsonProperty(value = "cpuManagerPolicy") + private String cpuManagerPolicy; + + /* + * If CPU CFS quota enforcement is enabled for containers that specify CPU + * limits. The default is true. + */ + @JsonProperty(value = "cpuCfsQuota") + private Boolean cpuCfsQuota; + + /* + * The CPU CFS quota period value. The default is '100ms.' Valid values are + * a sequence of decimal numbers with an optional fraction and a unit + * suffix. For example: '300ms', '2h45m'. Supported units are 'ns', 'us', + * 'ms', 's', 'm', and 'h'. + */ + @JsonProperty(value = "cpuCfsQuotaPeriod") + private String cpuCfsQuotaPeriod; + + /* + * The percent of disk usage after which image garbage collection is always + * run. To disable image garbage collection, set to 100. The default is 85% + */ + @JsonProperty(value = "imageGcHighThreshold") + private Integer imageGcHighThreshold; + + /* + * The percent of disk usage before which image garbage collection is never + * run. This cannot be set higher than imageGcHighThreshold. The default is + * 80% + */ + @JsonProperty(value = "imageGcLowThreshold") + private Integer imageGcLowThreshold; + + /* + * The Topology Manager policy to use. For more information see [Kubernetes + * Topology + * Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). + * The default is 'none'. Allowed values are 'none', 'best-effort', + * 'restricted', and 'single-numa-node'. + */ + @JsonProperty(value = "topologyManagerPolicy") + private String topologyManagerPolicy; + + /* + * Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in + * `*`). + */ + @JsonProperty(value = "allowedUnsafeSysctls") + private List allowedUnsafeSysctls; + + /* + * If set to true it will make the Kubelet fail to start if swap is enabled + * on the node. + */ + @JsonProperty(value = "failSwapOn") + private Boolean failSwapOn; + + /* + * The maximum size (e.g. 10Mi) of container log file before it is rotated. + */ + @JsonProperty(value = "containerLogMaxSizeMB") + private Integer containerLogMaxSizeMB; + + /* + * The maximum number of container log files that can be present for a + * container. The number must be ≥ 2. + */ + @JsonProperty(value = "containerLogMaxFiles") + private Integer containerLogMaxFiles; + + /* + * The maximum number of processes per pod. + */ + @JsonProperty(value = "podMaxPids") + private Integer podMaxPids; + + /** + * Get the cpuManagerPolicy property: The CPU Manager policy to use. The default is 'none'. See [Kubernetes CPU + * management + * policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + * for more information. Allowed values are 'none' and 'static'. + * + * @return the cpuManagerPolicy value. + */ + public String cpuManagerPolicy() { + return this.cpuManagerPolicy; + } + + /** + * Set the cpuManagerPolicy property: The CPU Manager policy to use. The default is 'none'. See [Kubernetes CPU + * management + * policies](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies) + * for more information. Allowed values are 'none' and 'static'. + * + * @param cpuManagerPolicy the cpuManagerPolicy value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withCpuManagerPolicy(String cpuManagerPolicy) { + this.cpuManagerPolicy = cpuManagerPolicy; + return this; + } + + /** + * Get the cpuCfsQuota property: If CPU CFS quota enforcement is enabled for containers that specify CPU limits. The + * default is true. + * + * @return the cpuCfsQuota value. + */ + public Boolean cpuCfsQuota() { + return this.cpuCfsQuota; + } + + /** + * Set the cpuCfsQuota property: If CPU CFS quota enforcement is enabled for containers that specify CPU limits. The + * default is true. + * + * @param cpuCfsQuota the cpuCfsQuota value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withCpuCfsQuota(Boolean cpuCfsQuota) { + this.cpuCfsQuota = cpuCfsQuota; + return this; + } + + /** + * Get the cpuCfsQuotaPeriod property: The CPU CFS quota period value. The default is '100ms.' Valid values are a + * sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + * units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + * + * @return the cpuCfsQuotaPeriod value. + */ + public String cpuCfsQuotaPeriod() { + return this.cpuCfsQuotaPeriod; + } + + /** + * Set the cpuCfsQuotaPeriod property: The CPU CFS quota period value. The default is '100ms.' Valid values are a + * sequence of decimal numbers with an optional fraction and a unit suffix. For example: '300ms', '2h45m'. Supported + * units are 'ns', 'us', 'ms', 's', 'm', and 'h'. + * + * @param cpuCfsQuotaPeriod the cpuCfsQuotaPeriod value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withCpuCfsQuotaPeriod(String cpuCfsQuotaPeriod) { + this.cpuCfsQuotaPeriod = cpuCfsQuotaPeriod; + return this; + } + + /** + * Get the imageGcHighThreshold property: The percent of disk usage after which image garbage collection is always + * run. To disable image garbage collection, set to 100. The default is 85%. + * + * @return the imageGcHighThreshold value. + */ + public Integer imageGcHighThreshold() { + return this.imageGcHighThreshold; + } + + /** + * Set the imageGcHighThreshold property: The percent of disk usage after which image garbage collection is always + * run. To disable image garbage collection, set to 100. The default is 85%. + * + * @param imageGcHighThreshold the imageGcHighThreshold value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withImageGcHighThreshold(Integer imageGcHighThreshold) { + this.imageGcHighThreshold = imageGcHighThreshold; + return this; + } + + /** + * Get the imageGcLowThreshold property: The percent of disk usage before which image garbage collection is never + * run. This cannot be set higher than imageGcHighThreshold. The default is 80%. + * + * @return the imageGcLowThreshold value. + */ + public Integer imageGcLowThreshold() { + return this.imageGcLowThreshold; + } + + /** + * Set the imageGcLowThreshold property: The percent of disk usage before which image garbage collection is never + * run. This cannot be set higher than imageGcHighThreshold. The default is 80%. + * + * @param imageGcLowThreshold the imageGcLowThreshold value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withImageGcLowThreshold(Integer imageGcLowThreshold) { + this.imageGcLowThreshold = imageGcLowThreshold; + return this; + } + + /** + * Get the topologyManagerPolicy property: The Topology Manager policy to use. For more information see [Kubernetes + * Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. + * Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + * + * @return the topologyManagerPolicy value. + */ + public String topologyManagerPolicy() { + return this.topologyManagerPolicy; + } + + /** + * Set the topologyManagerPolicy property: The Topology Manager policy to use. For more information see [Kubernetes + * Topology Manager](https://kubernetes.io/docs/tasks/administer-cluster/topology-manager). The default is 'none'. + * Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'. + * + * @param topologyManagerPolicy the topologyManagerPolicy value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withTopologyManagerPolicy(String topologyManagerPolicy) { + this.topologyManagerPolicy = topologyManagerPolicy; + return this; + } + + /** + * Get the allowedUnsafeSysctls property: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + * + * @return the allowedUnsafeSysctls value. + */ + public List allowedUnsafeSysctls() { + return this.allowedUnsafeSysctls; + } + + /** + * Set the allowedUnsafeSysctls property: Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in `*`). + * + * @param allowedUnsafeSysctls the allowedUnsafeSysctls value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withAllowedUnsafeSysctls(List allowedUnsafeSysctls) { + this.allowedUnsafeSysctls = allowedUnsafeSysctls; + return this; + } + + /** + * Get the failSwapOn property: If set to true it will make the Kubelet fail to start if swap is enabled on the + * node. + * + * @return the failSwapOn value. + */ + public Boolean failSwapOn() { + return this.failSwapOn; + } + + /** + * Set the failSwapOn property: If set to true it will make the Kubelet fail to start if swap is enabled on the + * node. + * + * @param failSwapOn the failSwapOn value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withFailSwapOn(Boolean failSwapOn) { + this.failSwapOn = failSwapOn; + return this; + } + + /** + * Get the containerLogMaxSizeMB property: The maximum size (e.g. 10Mi) of container log file before it is rotated. + * + * @return the containerLogMaxSizeMB value. + */ + public Integer containerLogMaxSizeMB() { + return this.containerLogMaxSizeMB; + } + + /** + * Set the containerLogMaxSizeMB property: The maximum size (e.g. 10Mi) of container log file before it is rotated. + * + * @param containerLogMaxSizeMB the containerLogMaxSizeMB value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withContainerLogMaxSizeMB(Integer containerLogMaxSizeMB) { + this.containerLogMaxSizeMB = containerLogMaxSizeMB; + return this; + } + + /** + * Get the containerLogMaxFiles property: The maximum number of container log files that can be present for a + * container. The number must be ≥ 2. + * + * @return the containerLogMaxFiles value. + */ + public Integer containerLogMaxFiles() { + return this.containerLogMaxFiles; + } + + /** + * Set the containerLogMaxFiles property: The maximum number of container log files that can be present for a + * container. The number must be ≥ 2. + * + * @param containerLogMaxFiles the containerLogMaxFiles value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withContainerLogMaxFiles(Integer containerLogMaxFiles) { + this.containerLogMaxFiles = containerLogMaxFiles; + return this; + } + + /** + * Get the podMaxPids property: The maximum number of processes per pod. + * + * @return the podMaxPids value. + */ + public Integer podMaxPids() { + return this.podMaxPids; + } + + /** + * Set the podMaxPids property: The maximum number of processes per pod. + * + * @param podMaxPids the podMaxPids value to set. + * @return the KubeletConfig object itself. + */ + public KubeletConfig withPodMaxPids(Integer podMaxPids) { + this.podMaxPids = podMaxPids; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletDiskType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletDiskType.java new file mode 100644 index 0000000000000..a46ad771173b4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletDiskType.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KubeletDiskType. */ +public final class KubeletDiskType extends ExpandableStringEnum { + /** Static value OS for KubeletDiskType. */ + public static final KubeletDiskType OS = fromString("OS"); + + /** Static value Temporary for KubeletDiskType. */ + public static final KubeletDiskType TEMPORARY = fromString("Temporary"); + + /** + * Creates or finds a KubeletDiskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KubeletDiskType. + */ + @JsonCreator + public static KubeletDiskType fromString(String name) { + return fromString(name, KubeletDiskType.class); + } + + /** @return known KubeletDiskType values. */ + public static Collection values() { + return values(KubeletDiskType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LicenseType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LicenseType.java new file mode 100644 index 0000000000000..71b26f8f1f3e2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LicenseType.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LicenseType. */ +public final class LicenseType extends ExpandableStringEnum { + /** Static value None for LicenseType. */ + public static final LicenseType NONE = fromString("None"); + + /** Static value Windows_Server for LicenseType. */ + public static final LicenseType WINDOWS_SERVER = fromString("Windows_Server"); + + /** + * Creates or finds a LicenseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LicenseType. + */ + @JsonCreator + public static LicenseType fromString(String name) { + return fromString(name, LicenseType.class); + } + + /** @return known LicenseType values. */ + public static Collection values() { + return values(LicenseType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LinuxOSConfig.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LinuxOSConfig.java new file mode 100644 index 0000000000000..d195be48c1eae --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LinuxOSConfig.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** + * See [AKS custom node configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + */ +@Fluent +public final class LinuxOSConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinuxOSConfig.class); + + /* + * Sysctl settings for Linux agent nodes. + */ + @JsonProperty(value = "sysctls") + private SysctlConfig sysctls; + + /* + * Whether transparent hugepages are enabled. Valid values are 'always', + * 'madvise', and 'never'. The default is 'always'. For more information + * see [Transparent + * Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + */ + @JsonProperty(value = "transparentHugePageEnabled") + private String transparentHugePageEnabled; + + /* + * Whether the kernel should make aggressive use of memory compaction to + * make more hugepages available. Valid values are 'always', 'defer', + * 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For + * more information see [Transparent + * Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + */ + @JsonProperty(value = "transparentHugePageDefrag") + private String transparentHugePageDefrag; + + /* + * The size in MB of a swap file that will be created on each node. + */ + @JsonProperty(value = "swapFileSizeMB") + private Integer swapFileSizeMB; + + /** + * Get the sysctls property: Sysctl settings for Linux agent nodes. + * + * @return the sysctls value. + */ + public SysctlConfig sysctls() { + return this.sysctls; + } + + /** + * Set the sysctls property: Sysctl settings for Linux agent nodes. + * + * @param sysctls the sysctls value to set. + * @return the LinuxOSConfig object itself. + */ + public LinuxOSConfig withSysctls(SysctlConfig sysctls) { + this.sysctls = sysctls; + return this; + } + + /** + * Get the transparentHugePageEnabled property: Whether transparent hugepages are enabled. Valid values are + * 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent + * Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + * + * @return the transparentHugePageEnabled value. + */ + public String transparentHugePageEnabled() { + return this.transparentHugePageEnabled; + } + + /** + * Set the transparentHugePageEnabled property: Whether transparent hugepages are enabled. Valid values are + * 'always', 'madvise', and 'never'. The default is 'always'. For more information see [Transparent + * Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + * + * @param transparentHugePageEnabled the transparentHugePageEnabled value to set. + * @return the LinuxOSConfig object itself. + */ + public LinuxOSConfig withTransparentHugePageEnabled(String transparentHugePageEnabled) { + this.transparentHugePageEnabled = transparentHugePageEnabled; + return this; + } + + /** + * Get the transparentHugePageDefrag property: Whether the kernel should make aggressive use of memory compaction to + * make more hugepages available. Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The + * default is 'madvise'. For more information see [Transparent + * Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + * + * @return the transparentHugePageDefrag value. + */ + public String transparentHugePageDefrag() { + return this.transparentHugePageDefrag; + } + + /** + * Set the transparentHugePageDefrag property: Whether the kernel should make aggressive use of memory compaction to + * make more hugepages available. Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The + * default is 'madvise'. For more information see [Transparent + * Hugepages](https://www.kernel.org/doc/html/latest/admin-guide/mm/transhuge.html#admin-guide-transhuge). + * + * @param transparentHugePageDefrag the transparentHugePageDefrag value to set. + * @return the LinuxOSConfig object itself. + */ + public LinuxOSConfig withTransparentHugePageDefrag(String transparentHugePageDefrag) { + this.transparentHugePageDefrag = transparentHugePageDefrag; + return this; + } + + /** + * Get the swapFileSizeMB property: The size in MB of a swap file that will be created on each node. + * + * @return the swapFileSizeMB value. + */ + public Integer swapFileSizeMB() { + return this.swapFileSizeMB; + } + + /** + * Set the swapFileSizeMB property: The size in MB of a swap file that will be created on each node. + * + * @param swapFileSizeMB the swapFileSizeMB value to set. + * @return the LinuxOSConfig object itself. + */ + public LinuxOSConfig withSwapFileSizeMB(Integer swapFileSizeMB) { + this.swapFileSizeMB = swapFileSizeMB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sysctls() != null) { + sysctls().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LoadBalancerSku.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LoadBalancerSku.java new file mode 100644 index 0000000000000..f0d0f739b312f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LoadBalancerSku.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LoadBalancerSku. */ +public final class LoadBalancerSku extends ExpandableStringEnum { + /** Static value standard for LoadBalancerSku. */ + public static final LoadBalancerSku STANDARD = fromString("standard"); + + /** Static value basic for LoadBalancerSku. */ + public static final LoadBalancerSku BASIC = fromString("basic"); + + /** + * Creates or finds a LoadBalancerSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding LoadBalancerSku. + */ + @JsonCreator + public static LoadBalancerSku fromString(String name) { + return fromString(name, LoadBalancerSku.class); + } + + /** @return known LoadBalancerSku values. */ + public static Collection values() { + return values(LoadBalancerSku.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfiguration.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfiguration.java new file mode 100644 index 0000000000000..66bda99c2783a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfiguration.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import java.util.List; + +/** An immutable client-side representation of MaintenanceConfiguration. */ +public interface MaintenanceConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the timeInWeek property: Time slots during the week when planned maintenance is allowed to proceed. If two + * array entries specify the same day of the week, the applied configuration is the union of times in both entries. + * + * @return the timeInWeek value. + */ + List timeInWeek(); + + /** + * Gets the notAllowedTime property: Time slots on which upgrade is not allowed. + * + * @return the notAllowedTime value. + */ + List notAllowedTime(); + + /** + * Gets the name property: The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner + * object. + * + * @return the inner object. + */ + MaintenanceConfigurationInner innerModel(); + + /** The entirety of the MaintenanceConfiguration definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The MaintenanceConfiguration definition stages. */ + interface DefinitionStages { + /** The first stage of the MaintenanceConfiguration definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the MaintenanceConfiguration definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @return the next definition stage. + */ + WithCreate withExistingManagedCluster(String resourceGroupName, String resourceName); + } + /** + * The stage of the MaintenanceConfiguration 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.WithTimeInWeek, DefinitionStages.WithNotAllowedTime { + /** + * Executes the create request. + * + * @return the created resource. + */ + MaintenanceConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + MaintenanceConfiguration create(Context context); + } + /** The stage of the MaintenanceConfiguration definition allowing to specify timeInWeek. */ + interface WithTimeInWeek { + /** + * Specifies the timeInWeek property: Time slots during the week when planned maintenance is allowed to + * proceed. If two array entries specify the same day of the week, the applied configuration is the union of + * times in both entries.. + * + * @param timeInWeek Time slots during the week when planned maintenance is allowed to proceed. If two array + * entries specify the same day of the week, the applied configuration is the union of times in both + * entries. + * @return the next definition stage. + */ + WithCreate withTimeInWeek(List timeInWeek); + } + /** The stage of the MaintenanceConfiguration definition allowing to specify notAllowedTime. */ + interface WithNotAllowedTime { + /** + * Specifies the notAllowedTime property: Time slots on which upgrade is not allowed.. + * + * @param notAllowedTime Time slots on which upgrade is not allowed. + * @return the next definition stage. + */ + WithCreate withNotAllowedTime(List notAllowedTime); + } + } + /** + * Begins update for the MaintenanceConfiguration resource. + * + * @return the stage of resource update. + */ + MaintenanceConfiguration.Update update(); + + /** The template for MaintenanceConfiguration update. */ + interface Update extends UpdateStages.WithTimeInWeek, UpdateStages.WithNotAllowedTime { + /** + * Executes the update request. + * + * @return the updated resource. + */ + MaintenanceConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + MaintenanceConfiguration apply(Context context); + } + /** The MaintenanceConfiguration update stages. */ + interface UpdateStages { + /** The stage of the MaintenanceConfiguration update allowing to specify timeInWeek. */ + interface WithTimeInWeek { + /** + * Specifies the timeInWeek property: Time slots during the week when planned maintenance is allowed to + * proceed. If two array entries specify the same day of the week, the applied configuration is the union of + * times in both entries.. + * + * @param timeInWeek Time slots during the week when planned maintenance is allowed to proceed. If two array + * entries specify the same day of the week, the applied configuration is the union of times in both + * entries. + * @return the next definition stage. + */ + Update withTimeInWeek(List timeInWeek); + } + /** The stage of the MaintenanceConfiguration update allowing to specify notAllowedTime. */ + interface WithNotAllowedTime { + /** + * Specifies the notAllowedTime property: Time slots on which upgrade is not allowed.. + * + * @param notAllowedTime Time slots on which upgrade is not allowed. + * @return the next definition stage. + */ + Update withNotAllowedTime(List notAllowedTime); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + MaintenanceConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + MaintenanceConfiguration refresh(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurationListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurationListResult.java new file mode 100644 index 0000000000000..90cbe17d80d10 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurationListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List maintenance configurations operation. */ +@Fluent +public final class MaintenanceConfigurationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MaintenanceConfigurationListResult.class); + + /* + * The list of maintenance configurations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of maintenance configuration results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of maintenance configurations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of maintenance configurations. + * + * @param value the value value to set. + * @return the MaintenanceConfigurationListResult object itself. + */ + public MaintenanceConfigurationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of maintenance configuration results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurations.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurations.java new file mode 100644 index 0000000000000..0dbfba36615a0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurations.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 MaintenanceConfigurations. */ +public interface MaintenanceConfigurations { + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of maintenance configurations in the specified managed cluster. + */ + PagedIterable listByManagedCluster(String resourceGroupName, String resourceName); + + /** + * Gets a list of maintenance configurations in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of maintenance configurations in the specified managed cluster. + */ + PagedIterable listByManagedCluster( + String resourceGroupName, String resourceName, Context context); + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 specified maintenance configuration of a managed cluster. + */ + MaintenanceConfiguration get(String resourceGroupName, String resourceName, String configName); + + /** + * Gets the specified maintenance configuration of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 specified maintenance configuration of a managed cluster. + */ + Response getWithResponse( + String resourceGroupName, String resourceName, String configName, Context context); + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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. + */ + void delete(String resourceGroupName, String resourceName, String configName); + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param configName The name of the maintenance 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 response. + */ + Response deleteWithResponse( + String resourceGroupName, String resourceName, String configName, Context context); + + /** + * Gets the specified maintenance configuration of a 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 the specified maintenance configuration of a managed cluster. + */ + MaintenanceConfiguration getById(String id); + + /** + * Gets the specified maintenance configuration of a 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 the specified maintenance configuration of a managed cluster. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a maintenance configuration. + * + * @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); + + /** + * Deletes a maintenance configuration. + * + * @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 the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new MaintenanceConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new MaintenanceConfiguration definition. + */ + MaintenanceConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedCluster.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedCluster.java new file mode 100644 index 0000000000000..aa5c71de7c9db --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedCluster.java @@ -0,0 +1,975 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +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 managed cluster SKU. + * + * @return the sku value. + */ + ManagedClusterSku sku(); + + /** + * Gets the extendedLocation property: The extended location of the Virtual Machine. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the identity property: The identity of the managed cluster, if configured. + * + * @return the identity value. + */ + ManagedClusterIdentity identity(); + + /** + * Gets the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the powerState property: The Power State of the cluster. + * + * @return the powerState value. + */ + PowerState powerState(); + + /** + * Gets the maxAgentPools property: The max number of agent pools for the managed cluster. + * + * @return the maxAgentPools value. + */ + Integer maxAgentPools(); + + /** + * Gets the kubernetesVersion property: The version of Kubernetes the Managed Cluster is running. When you upgrade a + * supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially + * by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, + * however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS + * cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. + * + * @return the kubernetesVersion value. + */ + String kubernetesVersion(); + + /** + * Gets the dnsPrefix property: The DNS prefix of the Managed Cluster. This cannot be updated once the Managed + * Cluster has been created. + * + * @return the dnsPrefix value. + */ + String dnsPrefix(); + + /** + * Gets the fqdnSubdomain property: The FQDN subdomain of the private cluster with custom private dns zone. This + * cannot be updated once the Managed Cluster has been created. + * + * @return the fqdnSubdomain value. + */ + String fqdnSubdomain(); + + /** + * Gets the fqdn property: The FQDN of the master pool. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the privateFqdn property: The FQDN of private cluster. + * + * @return the privateFqdn value. + */ + String privateFqdn(); + + /** + * Gets the azurePortalFqdn property: The special FQDN used by the Azure Portal to access the Managed Cluster. This + * FQDN is for use only by the Azure Portal and should not be used by other clients. The Azure Portal requires + * certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer + * doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly. + * + * @return the azurePortalFqdn value. + */ + String azurePortalFqdn(); + + /** + * Gets the agentPoolProfiles property: The agent pool properties. + * + * @return the agentPoolProfiles value. + */ + List agentPoolProfiles(); + + /** + * Gets the linuxProfile property: The profile for Linux VMs in the Managed Cluster. + * + * @return the linuxProfile value. + */ + ContainerServiceLinuxProfileAutoGenerated linuxProfile(); + + /** + * Gets the windowsProfile property: The profile for Windows VMs in the Managed Cluster. + * + * @return the windowsProfile value. + */ + ManagedClusterWindowsProfile windowsProfile(); + + /** + * Gets the servicePrincipalProfile property: Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. + * + * @return the servicePrincipalProfile value. + */ + ManagedClusterServicePrincipalProfile servicePrincipalProfile(); + + /** + * Gets the addonProfiles property: The profile of managed cluster add-on. + * + * @return the addonProfiles value. + */ + Map addonProfiles(); + + /** + * Gets the podIdentityProfile property: The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity + * integration. + * + * @return the podIdentityProfile value. + */ + ManagedClusterPodIdentityProfile podIdentityProfile(); + + /** + * Gets the nodeResourceGroup property: The name of the resource group containing agent pool nodes. + * + * @return the nodeResourceGroup value. + */ + String nodeResourceGroup(); + + /** + * Gets the enableRbac property: Whether to enable Kubernetes Role-Based Access Control. + * + * @return the enableRbac value. + */ + Boolean enableRbac(); + + /** + * Gets the enablePodSecurityPolicy property: (DEPRECATING) Whether to enable Kubernetes pod security policy + * (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. + * + * @return the enablePodSecurityPolicy value. + */ + Boolean enablePodSecurityPolicy(); + + /** + * Gets the networkProfile property: The network configuration profile. + * + * @return the networkProfile value. + */ + ContainerServiceNetworkProfile networkProfile(); + + /** + * Gets the aadProfile property: AADProfile specifies attributes for Azure Active Directory integration. The Azure + * Active Directory configuration. + * + * @return the aadProfile value. + */ + ManagedClusterAadProfile aadProfile(); + + /** + * Gets the autoUpgradeProfile property: The auto upgrade configuration. + * + * @return the autoUpgradeProfile value. + */ + ManagedClusterAutoUpgradeProfile autoUpgradeProfile(); + + /** + * Gets the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when enabled. + * + * @return the autoScalerProfile value. + */ + ManagedClusterPropertiesAutoScalerProfile autoScalerProfile(); + + /** + * Gets the apiServerAccessProfile property: The access profile for managed cluster API server. + * + * @return the apiServerAccessProfile value. + */ + ManagedClusterApiServerAccessProfile apiServerAccessProfile(); + + /** + * Gets the diskEncryptionSetId property: The Resource ID of the disk encryption set to use for enabling encryption + * at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * + * @return the diskEncryptionSetId value. + */ + String diskEncryptionSetId(); + + /** + * Gets the identityProfile property: Identities associated with the cluster. + * + * @return the identityProfile value. + */ + Map identityProfile(); + + /** + * Gets the privateLinkResources property: Private link resources associated with the cluster. + * + * @return the privateLinkResources value. + */ + List privateLinkResources(); + + /** + * Gets the disableLocalAccounts property: If local accounts should be disabled on the Managed Cluster. If set to + * true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters + * that are AAD enabled. For more details see [disable local + * accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + * + * @return the disableLocalAccounts value. + */ + Boolean disableLocalAccounts(); + + /** + * Gets the httpProxyConfig property: Configurations for provisioning the cluster with HTTP proxy servers. + * + * @return the httpProxyConfig value. + */ + ManagedClusterHttpProxyConfig httpProxyConfig(); + + /** + * Gets the securityProfile property: Security profile for the managed cluster. + * + * @return the securityProfile value. + */ + ManagedClusterSecurityProfile securityProfile(); + + /** + * Gets the publicNetworkAccess property: Whether the cluster can be accessed through public network or not Default + * value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private cluster. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * 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.containerservice.generated.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.WithExtendedLocation, + DefinitionStages.WithIdentity, + DefinitionStages.WithKubernetesVersion, + DefinitionStages.WithDnsPrefix, + DefinitionStages.WithFqdnSubdomain, + DefinitionStages.WithAgentPoolProfiles, + DefinitionStages.WithLinuxProfile, + DefinitionStages.WithWindowsProfile, + DefinitionStages.WithServicePrincipalProfile, + DefinitionStages.WithAddonProfiles, + DefinitionStages.WithPodIdentityProfile, + DefinitionStages.WithNodeResourceGroup, + DefinitionStages.WithEnableRbac, + DefinitionStages.WithEnablePodSecurityPolicy, + DefinitionStages.WithNetworkProfile, + DefinitionStages.WithAadProfile, + DefinitionStages.WithAutoUpgradeProfile, + DefinitionStages.WithAutoScalerProfile, + DefinitionStages.WithApiServerAccessProfile, + DefinitionStages.WithDiskEncryptionSetId, + DefinitionStages.WithIdentityProfile, + DefinitionStages.WithPrivateLinkResources, + DefinitionStages.WithDisableLocalAccounts, + DefinitionStages.WithHttpProxyConfig, + DefinitionStages.WithSecurityProfile, + DefinitionStages.WithPublicNetworkAccess { + /** + * 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 managed cluster SKU.. + * + * @param sku The managed cluster SKU. + * @return the next definition stage. + */ + WithCreate withSku(ManagedClusterSku sku); + } + /** The stage of the ManagedCluster definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: The extended location of the Virtual Machine.. + * + * @param extendedLocation The extended location of the Virtual Machine. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } + /** The stage of the ManagedCluster definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the managed cluster, if configured.. + * + * @param identity The identity of the managed cluster, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedClusterIdentity identity); + } + /** The stage of the ManagedCluster definition allowing to specify kubernetesVersion. */ + interface WithKubernetesVersion { + /** + * Specifies the kubernetesVersion property: The version of Kubernetes the Managed Cluster is running. When + * you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be + * performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or + * 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS + * cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details.. + * + * @param kubernetesVersion The version of Kubernetes the Managed Cluster is running. When you upgrade a + * supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed + * sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x + * -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS + * cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. + * @return the next definition stage. + */ + WithCreate withKubernetesVersion(String kubernetesVersion); + } + /** The stage of the ManagedCluster definition allowing to specify dnsPrefix. */ + interface WithDnsPrefix { + /** + * Specifies the dnsPrefix property: The DNS prefix of the Managed Cluster. This cannot be updated once the + * Managed Cluster has been created.. + * + * @param dnsPrefix The DNS prefix of the Managed Cluster. This cannot be updated once the Managed Cluster + * has been created. + * @return the next definition stage. + */ + WithCreate withDnsPrefix(String dnsPrefix); + } + /** The stage of the ManagedCluster definition allowing to specify fqdnSubdomain. */ + interface WithFqdnSubdomain { + /** + * Specifies the fqdnSubdomain property: The FQDN subdomain of the private cluster with custom private dns + * zone. This cannot be updated once the Managed Cluster has been created.. + * + * @param fqdnSubdomain The FQDN subdomain of the private cluster with custom private dns zone. This cannot + * be updated once the Managed Cluster has been created. + * @return the next definition stage. + */ + WithCreate withFqdnSubdomain(String fqdnSubdomain); + } + /** The stage of the ManagedCluster definition allowing to specify agentPoolProfiles. */ + interface WithAgentPoolProfiles { + /** + * Specifies the agentPoolProfiles property: The agent pool properties.. + * + * @param agentPoolProfiles The agent pool properties. + * @return the next definition stage. + */ + WithCreate withAgentPoolProfiles(List agentPoolProfiles); + } + /** The stage of the ManagedCluster definition allowing to specify linuxProfile. */ + interface WithLinuxProfile { + /** + * Specifies the linuxProfile property: The profile for Linux VMs in the Managed Cluster.. + * + * @param linuxProfile The profile for Linux VMs in the Managed Cluster. + * @return the next definition stage. + */ + WithCreate withLinuxProfile(ContainerServiceLinuxProfileAutoGenerated linuxProfile); + } + /** The stage of the ManagedCluster definition allowing to specify windowsProfile. */ + interface WithWindowsProfile { + /** + * Specifies the windowsProfile property: The profile for Windows VMs in the Managed Cluster.. + * + * @param windowsProfile The profile for Windows VMs in the Managed Cluster. + * @return the next definition stage. + */ + WithCreate withWindowsProfile(ManagedClusterWindowsProfile windowsProfile); + } + /** The stage of the ManagedCluster definition allowing to specify servicePrincipalProfile. */ + interface WithServicePrincipalProfile { + /** + * Specifies the servicePrincipalProfile property: Information about a service principal identity for the + * cluster to use for manipulating Azure APIs.. + * + * @param servicePrincipalProfile Information about a service principal identity for the cluster to use for + * manipulating Azure APIs. + * @return the next definition stage. + */ + WithCreate withServicePrincipalProfile(ManagedClusterServicePrincipalProfile servicePrincipalProfile); + } + /** The stage of the ManagedCluster definition allowing to specify addonProfiles. */ + interface WithAddonProfiles { + /** + * Specifies the addonProfiles property: The profile of managed cluster add-on.. + * + * @param addonProfiles The profile of managed cluster add-on. + * @return the next definition stage. + */ + WithCreate withAddonProfiles(Map addonProfiles); + } + /** The stage of the ManagedCluster definition allowing to specify podIdentityProfile. */ + interface WithPodIdentityProfile { + /** + * Specifies the podIdentityProfile property: The pod identity profile of the Managed Cluster. See [use AAD + * pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod + * identity integration.. + * + * @param podIdentityProfile The pod identity profile of the Managed Cluster. See [use AAD pod + * identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod + * identity integration. + * @return the next definition stage. + */ + WithCreate withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile); + } + /** The stage of the ManagedCluster definition allowing to specify nodeResourceGroup. */ + interface WithNodeResourceGroup { + /** + * Specifies the nodeResourceGroup property: The name of the resource group containing agent pool nodes.. + * + * @param nodeResourceGroup The name of the resource group containing agent pool nodes. + * @return the next definition stage. + */ + WithCreate withNodeResourceGroup(String nodeResourceGroup); + } + /** The stage of the ManagedCluster definition allowing to specify enableRbac. */ + interface WithEnableRbac { + /** + * Specifies the enableRbac property: Whether to enable Kubernetes Role-Based Access Control.. + * + * @param enableRbac Whether to enable Kubernetes Role-Based Access Control. + * @return the next definition stage. + */ + WithCreate withEnableRbac(Boolean enableRbac); + } + /** The stage of the ManagedCluster definition allowing to specify enablePodSecurityPolicy. */ + interface WithEnablePodSecurityPolicy { + /** + * Specifies the enablePodSecurityPolicy property: (DEPRECATING) Whether to enable Kubernetes pod security + * policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + * aka.ms/aks/azpodpolicy.. + * + * @param enablePodSecurityPolicy (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). + * This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. + * @return the next definition stage. + */ + WithCreate withEnablePodSecurityPolicy(Boolean enablePodSecurityPolicy); + } + /** The stage of the ManagedCluster definition allowing to specify networkProfile. */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: The network configuration profile.. + * + * @param networkProfile The network configuration profile. + * @return the next definition stage. + */ + WithCreate withNetworkProfile(ContainerServiceNetworkProfile networkProfile); + } + /** The stage of the ManagedCluster definition allowing to specify aadProfile. */ + interface WithAadProfile { + /** + * Specifies the aadProfile property: AADProfile specifies attributes for Azure Active Directory + * integration. The Azure Active Directory configuration.. + * + * @param aadProfile AADProfile specifies attributes for Azure Active Directory integration. The Azure + * Active Directory configuration. + * @return the next definition stage. + */ + WithCreate withAadProfile(ManagedClusterAadProfile aadProfile); + } + /** The stage of the ManagedCluster definition allowing to specify autoUpgradeProfile. */ + interface WithAutoUpgradeProfile { + /** + * Specifies the autoUpgradeProfile property: The auto upgrade configuration.. + * + * @param autoUpgradeProfile The auto upgrade configuration. + * @return the next definition stage. + */ + WithCreate withAutoUpgradeProfile(ManagedClusterAutoUpgradeProfile autoUpgradeProfile); + } + /** The stage of the ManagedCluster definition allowing to specify autoScalerProfile. */ + interface WithAutoScalerProfile { + /** + * Specifies the autoScalerProfile property: Parameters to be applied to the cluster-autoscaler when + * enabled. + * + * @param autoScalerProfile Parameters to be applied to the cluster-autoscaler when enabled. + * @return the next definition stage. + */ + WithCreate withAutoScalerProfile(ManagedClusterPropertiesAutoScalerProfile autoScalerProfile); + } + /** The stage of the ManagedCluster definition allowing to specify apiServerAccessProfile. */ + interface WithApiServerAccessProfile { + /** + * Specifies the apiServerAccessProfile property: The access profile for managed cluster API server.. + * + * @param apiServerAccessProfile The access profile for managed cluster API server. + * @return the next definition stage. + */ + WithCreate withApiServerAccessProfile(ManagedClusterApiServerAccessProfile apiServerAccessProfile); + } + /** The stage of the ManagedCluster definition allowing to specify diskEncryptionSetId. */ + interface WithDiskEncryptionSetId { + /** + * Specifies the diskEncryptionSetId property: The Resource ID of the disk encryption set to use for + * enabling encryption at rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * + * @param diskEncryptionSetId The Resource ID of the disk encryption set to use for enabling encryption at + * rest. This is of the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + * @return the next definition stage. + */ + WithCreate withDiskEncryptionSetId(String diskEncryptionSetId); + } + /** The stage of the ManagedCluster definition allowing to specify identityProfile. */ + interface WithIdentityProfile { + /** + * Specifies the identityProfile property: Identities associated with the cluster.. + * + * @param identityProfile Identities associated with the cluster. + * @return the next definition stage. + */ + WithCreate withIdentityProfile(Map identityProfile); + } + /** The stage of the ManagedCluster definition allowing to specify privateLinkResources. */ + interface WithPrivateLinkResources { + /** + * Specifies the privateLinkResources property: Private link resources associated with the cluster.. + * + * @param privateLinkResources Private link resources associated with the cluster. + * @return the next definition stage. + */ + WithCreate withPrivateLinkResources(List privateLinkResources); + } + /** The stage of the ManagedCluster definition allowing to specify disableLocalAccounts. */ + interface WithDisableLocalAccounts { + /** + * Specifies the disableLocalAccounts property: If local accounts should be disabled on the Managed Cluster. + * If set to true, getting static credentials will be disabled for this cluster. This must only be used on + * Managed Clusters that are AAD enabled. For more details see [disable local + * accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview).. + * + * @param disableLocalAccounts If local accounts should be disabled on the Managed Cluster. If set to true, + * getting static credentials will be disabled for this cluster. This must only be used on Managed + * Clusters that are AAD enabled. For more details see [disable local + * accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview). + * @return the next definition stage. + */ + WithCreate withDisableLocalAccounts(Boolean disableLocalAccounts); + } + /** The stage of the ManagedCluster definition allowing to specify httpProxyConfig. */ + interface WithHttpProxyConfig { + /** + * Specifies the httpProxyConfig property: Configurations for provisioning the cluster with HTTP proxy + * servers.. + * + * @param httpProxyConfig Configurations for provisioning the cluster with HTTP proxy servers. + * @return the next definition stage. + */ + WithCreate withHttpProxyConfig(ManagedClusterHttpProxyConfig httpProxyConfig); + } + /** The stage of the ManagedCluster definition allowing to specify securityProfile. */ + interface WithSecurityProfile { + /** + * Specifies the securityProfile property: Security profile for the managed cluster.. + * + * @param securityProfile Security profile for the managed cluster. + * @return the next definition stage. + */ + WithCreate withSecurityProfile(ManagedClusterSecurityProfile securityProfile); + } + /** The stage of the ManagedCluster definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Whether the cluster can be accessed through public network or + * not Default value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private cluster. + * + * @param publicNetworkAccess Whether the cluster can be accessed through public network or not Default + * value is 'Enabled' (case insensitive). Could be set to 'Disabled' to enable private cluster. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + } + /** + * 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 { + /** + * 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: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * 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); + + /** + * Lists the admin credentials of a managed cluster. + * + * @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 credential result response. + */ + CredentialResults listClusterAdminCredentials(); + + /** + * Lists the admin credentials of a managed cluster. + * + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + Response listClusterAdminCredentialsWithResponse(String serverFqdn, Context context); + + /** + * Lists the user credentials of a managed cluster. + * + * @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 credential result response. + */ + CredentialResults listClusterUserCredentials(); + + /** + * Lists the user credentials of a managed cluster. + * + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + Response listClusterUserCredentialsWithResponse(String serverFqdn, Context context); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @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 credential result response. + */ + CredentialResults listClusterMonitoringUserCredentials(); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + Response listClusterMonitoringUserCredentialsWithResponse(String serverFqdn, Context context); + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param parameters The service principal profile to set on the managed 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. + */ + void resetServicePrincipalProfile(ManagedClusterServicePrincipalProfile parameters); + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param parameters The service principal profile to set on the managed 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. + */ + void resetServicePrincipalProfile(ManagedClusterServicePrincipalProfile parameters, Context context); + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param parameters The AAD profile to set on the Managed 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. + */ + void resetAadProfile(ManagedClusterAadProfile parameters); + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param parameters The AAD profile to set on the Managed 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. + */ + void resetAadProfile(ManagedClusterAadProfile parameters, Context context); + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @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 rotateClusterCertificates(); + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @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 rotateClusterCertificates(Context context); + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @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 stop(); + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a 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. + */ + void stop(Context context); + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @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 start(); + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a 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. + */ + void start(Context context); + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param requestPayload The run command request. + * @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 run command result. + */ + RunCommandResult runCommand(RunCommandRequest requestPayload); + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param requestPayload The run command request. + * @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 run command result. + */ + RunCommandResult runCommand(RunCommandRequest requestPayload, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAadProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAadProfile.java new file mode 100644 index 0000000000000..386c7bc1ae2ca --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAadProfile.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** For more details see [managed AAD on AKS](https://docs.microsoft.com/azure/aks/managed-aad). */ +@Fluent +public final class ManagedClusterAadProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAadProfile.class); + + /* + * Whether to enable managed AAD. + */ + @JsonProperty(value = "managed") + private Boolean managed; + + /* + * Whether to enable Azure RBAC for Kubernetes authorization. + */ + @JsonProperty(value = "enableAzureRBAC") + private Boolean enableAzureRbac; + + /* + * The list of AAD group object IDs that will have admin role of the + * cluster. + */ + @JsonProperty(value = "adminGroupObjectIDs") + private List adminGroupObjectIDs; + + /* + * The client AAD application ID. + */ + @JsonProperty(value = "clientAppID") + private String clientAppId; + + /* + * The server AAD application ID. + */ + @JsonProperty(value = "serverAppID") + private String serverAppId; + + /* + * The server AAD application secret. + */ + @JsonProperty(value = "serverAppSecret") + private String serverAppSecret; + + /* + * The AAD tenant ID to use for authentication. If not specified, will use + * the tenant of the deployment subscription. + */ + @JsonProperty(value = "tenantID") + private String tenantId; + + /** + * Get the managed property: Whether to enable managed AAD. + * + * @return the managed value. + */ + public Boolean managed() { + return this.managed; + } + + /** + * Set the managed property: Whether to enable managed AAD. + * + * @param managed the managed value to set. + * @return the ManagedClusterAadProfile object itself. + */ + public ManagedClusterAadProfile withManaged(Boolean managed) { + this.managed = managed; + return this; + } + + /** + * Get the enableAzureRbac property: Whether to enable Azure RBAC for Kubernetes authorization. + * + * @return the enableAzureRbac value. + */ + public Boolean enableAzureRbac() { + return this.enableAzureRbac; + } + + /** + * Set the enableAzureRbac property: Whether to enable Azure RBAC for Kubernetes authorization. + * + * @param enableAzureRbac the enableAzureRbac value to set. + * @return the ManagedClusterAadProfile object itself. + */ + public ManagedClusterAadProfile withEnableAzureRbac(Boolean enableAzureRbac) { + this.enableAzureRbac = enableAzureRbac; + return this; + } + + /** + * Get the adminGroupObjectIDs property: The list of AAD group object IDs that will have admin role of the cluster. + * + * @return the adminGroupObjectIDs value. + */ + public List adminGroupObjectIDs() { + return this.adminGroupObjectIDs; + } + + /** + * Set the adminGroupObjectIDs property: The list of AAD group object IDs that will have admin role of the cluster. + * + * @param adminGroupObjectIDs the adminGroupObjectIDs value to set. + * @return the ManagedClusterAadProfile object itself. + */ + public ManagedClusterAadProfile withAdminGroupObjectIDs(List adminGroupObjectIDs) { + this.adminGroupObjectIDs = adminGroupObjectIDs; + return this; + } + + /** + * Get the clientAppId property: The client AAD application ID. + * + * @return the clientAppId value. + */ + public String clientAppId() { + return this.clientAppId; + } + + /** + * Set the clientAppId property: The client AAD application ID. + * + * @param clientAppId the clientAppId value to set. + * @return the ManagedClusterAadProfile object itself. + */ + public ManagedClusterAadProfile withClientAppId(String clientAppId) { + this.clientAppId = clientAppId; + return this; + } + + /** + * Get the serverAppId property: The server AAD application ID. + * + * @return the serverAppId value. + */ + public String serverAppId() { + return this.serverAppId; + } + + /** + * Set the serverAppId property: The server AAD application ID. + * + * @param serverAppId the serverAppId value to set. + * @return the ManagedClusterAadProfile object itself. + */ + public ManagedClusterAadProfile withServerAppId(String serverAppId) { + this.serverAppId = serverAppId; + return this; + } + + /** + * Get the serverAppSecret property: The server AAD application secret. + * + * @return the serverAppSecret value. + */ + public String serverAppSecret() { + return this.serverAppSecret; + } + + /** + * Set the serverAppSecret property: The server AAD application secret. + * + * @param serverAppSecret the serverAppSecret value to set. + * @return the ManagedClusterAadProfile object itself. + */ + public ManagedClusterAadProfile withServerAppSecret(String serverAppSecret) { + this.serverAppSecret = serverAppSecret; + return this; + } + + /** + * Get the tenantId property: The AAD tenant ID to use for authentication. If not specified, will use the tenant of + * the deployment subscription. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The AAD tenant ID to use for authentication. If not specified, will use the tenant of + * the deployment subscription. + * + * @param tenantId the tenantId value to set. + * @return the ManagedClusterAadProfile object itself. + */ + public ManagedClusterAadProfile withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAccessProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAccessProfile.java new file mode 100644 index 0000000000000..2150d61dfcafa --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAccessProfile.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner; +import java.util.Map; + +/** An immutable client-side representation of ManagedClusterAccessProfile. */ +public interface ManagedClusterAccessProfile { + /** + * 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 kubeConfig property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeConfig value. + */ + byte[] kubeConfig(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterAccessProfileInner object. + * + * @return the inner object. + */ + ManagedClusterAccessProfileInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfile.java new file mode 100644 index 0000000000000..8a983d49151ec --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfile.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** A Kubernetes add-on profile for a managed cluster. */ +@Fluent +public final class ManagedClusterAddonProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAddonProfile.class); + + /* + * Whether the add-on is enabled or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * Key-value pairs for configuring an add-on. + */ + @JsonProperty(value = "config") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map config; + + /* + * Information of user assigned identity used by this add-on. + */ + @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) + private ManagedClusterAddonProfileIdentity identity; + + /** + * Get the enabled property: Whether the add-on is enabled or not. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the add-on is enabled or not. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterAddonProfile object itself. + */ + public ManagedClusterAddonProfile withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the config property: Key-value pairs for configuring an add-on. + * + * @return the config value. + */ + public Map config() { + return this.config; + } + + /** + * Set the config property: Key-value pairs for configuring an add-on. + * + * @param config the config value to set. + * @return the ManagedClusterAddonProfile object itself. + */ + public ManagedClusterAddonProfile withConfig(Map config) { + this.config = config; + return this; + } + + /** + * Get the identity property: Information of user assigned identity used by this add-on. + * + * @return the identity value. + */ + public ManagedClusterAddonProfileIdentity identity() { + return this.identity; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfileIdentity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfileIdentity.java new file mode 100644 index 0000000000000..e14872de0797f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfileIdentity.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Information of user assigned identity used by this add-on. */ +@Fluent +public class ManagedClusterAddonProfileIdentity extends UserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAddonProfileIdentity.class); + + /** {@inheritDoc} */ + @Override + public ManagedClusterAddonProfileIdentity withResourceId(String resourceId) { + super.withResourceId(resourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAddonProfileIdentity withClientId(String clientId) { + super.withClientId(clientId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAddonProfileIdentity withObjectId(String objectId) { + super.withObjectId(objectId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfile.java new file mode 100644 index 0000000000000..cc027eb13e060 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfile.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; +import java.util.Map; + +/** Profile for the container service agent pool. */ +@Fluent +public final class ManagedClusterAgentPoolProfile extends ManagedClusterAgentPoolProfileProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAgentPoolProfile.class); + + /* + * Unique name of the agent pool profile in the context of the subscription + * and resource group. Windows agent pool names must be 6 characters or + * less. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: Unique name of the agent pool profile in the context of the subscription and resource + * group. Windows agent pool names must be 6 characters or less. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Unique name of the agent pool profile in the context of the subscription and resource + * group. Windows agent pool names must be 6 characters or less. + * + * @param name the name value to set. + * @return the ManagedClusterAgentPoolProfile object itself. + */ + public ManagedClusterAgentPoolProfile withName(String name) { + this.name = name; + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withCount(Integer count) { + super.withCount(count); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withVmSize(String vmSize) { + super.withVmSize(vmSize); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withOsDiskSizeGB(Integer osDiskSizeGB) { + super.withOsDiskSizeGB(osDiskSizeGB); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withOsDiskType(OSDiskType osDiskType) { + super.withOsDiskType(osDiskType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withKubeletDiskType(KubeletDiskType kubeletDiskType) { + super.withKubeletDiskType(kubeletDiskType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withVnetSubnetId(String vnetSubnetId) { + super.withVnetSubnetId(vnetSubnetId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withPodSubnetId(String podSubnetId) { + super.withPodSubnetId(podSubnetId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withMaxPods(Integer maxPods) { + super.withMaxPods(maxPods); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withOsType(OSType osType) { + super.withOsType(osType); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withOsSku(Ossku osSku) { + super.withOsSku(osSku); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withMaxCount(Integer maxCount) { + super.withMaxCount(maxCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withMinCount(Integer minCount) { + super.withMinCount(minCount); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withEnableAutoScaling(Boolean enableAutoScaling) { + super.withEnableAutoScaling(enableAutoScaling); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withScaleDownMode(ScaleDownMode scaleDownMode) { + super.withScaleDownMode(scaleDownMode); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withType(AgentPoolType type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withMode(AgentPoolMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withOrchestratorVersion(String orchestratorVersion) { + super.withOrchestratorVersion(orchestratorVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { + super.withUpgradeSettings(upgradeSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withAvailabilityZones(List availabilityZones) { + super.withAvailabilityZones(availabilityZones); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withEnableNodePublicIp(Boolean enableNodePublicIp) { + super.withEnableNodePublicIp(enableNodePublicIp); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withNodePublicIpPrefixId(String nodePublicIpPrefixId) { + super.withNodePublicIpPrefixId(nodePublicIpPrefixId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withScaleSetPriority(ScaleSetPriority scaleSetPriority) { + super.withScaleSetPriority(scaleSetPriority); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withScaleSetEvictionPolicy(ScaleSetEvictionPolicy scaleSetEvictionPolicy) { + super.withScaleSetEvictionPolicy(scaleSetEvictionPolicy); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withSpotMaxPrice(Float spotMaxPrice) { + super.withSpotMaxPrice(spotMaxPrice); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withNodeLabels(Map nodeLabels) { + super.withNodeLabels(nodeLabels); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withNodeTaints(List nodeTaints) { + super.withNodeTaints(nodeTaints); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withProximityPlacementGroupId(String proximityPlacementGroupId) { + super.withProximityPlacementGroupId(proximityPlacementGroupId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withKubeletConfig(KubeletConfig kubeletConfig) { + super.withKubeletConfig(kubeletConfig); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { + super.withLinuxOSConfig(linuxOSConfig); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withEnableEncryptionAtHost(Boolean enableEncryptionAtHost) { + super.withEnableEncryptionAtHost(enableEncryptionAtHost); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withEnableUltraSsd(Boolean enableUltraSsd) { + super.withEnableUltraSsd(enableUltraSsd); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withEnableFips(Boolean enableFips) { + super.withEnableFips(enableFips); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withGpuInstanceProfile(GpuInstanceProfile gpuInstanceProfile) { + super.withGpuInstanceProfile(gpuInstanceProfile); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withCreationData(CreationData creationData) { + super.withCreationData(creationData); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ManagedClusterAgentPoolProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfileProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfileProperties.java new file mode 100644 index 0000000000000..f8d33ab267925 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfileProperties.java @@ -0,0 +1,1149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.List; +import java.util.Map; + +/** Properties for the container service agent pool profile. */ +@Fluent +public class ManagedClusterAgentPoolProfileProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAgentPoolProfileProperties.class); + + /* + * Number of agents (VMs) to host docker containers. Allowed values must be + * in the range of 0 to 1000 (inclusive) for user pools and in the range of + * 1 to 1000 (inclusive) for system pools. The default value is 1. + */ + @JsonProperty(value = "count") + private Integer count; + + /* + * The size of the agent pool VMs. VM size availability varies by region. + * If a node contains insufficient compute resources (memory, cpu, etc) + * pods might fail to run correctly. For more details on restricted VM + * sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /* + * OS Disk Size in GB to be used to specify the disk size for every machine + * in the master/agent pool. If you specify 0, it will apply the default + * osDisk size according to the vmSize specified. + */ + @JsonProperty(value = "osDiskSizeGB") + private Integer osDiskSizeGB; + + /* + * The OS disk type to be used for machines in the agent pool. The default + * is 'Ephemeral' if the VM supports it and has a cache disk larger than + * the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be + * changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + */ + @JsonProperty(value = "osDiskType") + private OSDiskType osDiskType; + + /* + * Determines the placement of emptyDir volumes, container runtime data + * root, and Kubelet ephemeral storage. + */ + @JsonProperty(value = "kubeletDiskType") + private KubeletDiskType kubeletDiskType; + + /* + * The ID of the subnet which agent pool nodes and optionally pods will + * join on startup. If this is not specified, a VNET and subnet will be + * generated and used. If no podSubnetID is specified, this applies to + * nodes and pods, otherwise it applies to just nodes. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + */ + @JsonProperty(value = "vnetSubnetID") + private String vnetSubnetId; + + /* + * The ID of the subnet which pods will join when launched. If omitted, pod + * IPs are statically assigned on the node subnet (see vnetSubnetID for + * more details). This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} + */ + @JsonProperty(value = "podSubnetID") + private String podSubnetId; + + /* + * The maximum number of pods that can run on a node. + */ + @JsonProperty(value = "maxPods") + private Integer maxPods; + + /* + * OsType to be used to specify os type. Choose from Linux and Windows. + * Default to Linux. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /* + * Specifies an OS SKU. This value must not be specified if OSType is + * Windows. + */ + @JsonProperty(value = "osSKU") + private Ossku osSku; + + /* + * The maximum number of nodes for auto-scaling + */ + @JsonProperty(value = "maxCount") + private Integer maxCount; + + /* + * The minimum number of nodes for auto-scaling + */ + @JsonProperty(value = "minCount") + private Integer minCount; + + /* + * Whether to enable auto-scaler + */ + @JsonProperty(value = "enableAutoScaling") + private Boolean enableAutoScaling; + + /* + * This also effects the cluster autoscaler behavior. If not specified, it + * defaults to Delete. + */ + @JsonProperty(value = "scaleDownMode") + private ScaleDownMode scaleDownMode; + + /* + * The type of Agent Pool. + */ + @JsonProperty(value = "type") + private AgentPoolType type; + + /* + * The mode of an agent pool. A cluster must have at least one 'System' + * Agent Pool at all times. For additional information on agent pool + * restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools + */ + @JsonProperty(value = "mode") + private AgentPoolMode mode; + + /* + * The version of Kubernetes running on the Agent Pool. As a best practice, + * you should upgrade all node pools in an AKS cluster to the same + * Kubernetes version. The node pool version must have the same major + * version as the control plane. The node pool minor version must be within + * two minor versions of the control plane version. The node pool version + * cannot be greater than the control plane version. For more information + * see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + */ + @JsonProperty(value = "orchestratorVersion") + private String orchestratorVersion; + + /* + * The version of node image + */ + @JsonProperty(value = "nodeImageVersion", access = JsonProperty.Access.WRITE_ONLY) + private String nodeImageVersion; + + /* + * Settings for upgrading the agentpool + */ + @JsonProperty(value = "upgradeSettings") + private AgentPoolUpgradeSettings upgradeSettings; + + /* + * The current deployment or provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Describes whether the Agent Pool is Running or Stopped + */ + @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) + private PowerState powerState; + + /* + * The list of Availability zones to use for nodes. This can only be + * specified if the AgentPoolType property is 'VirtualMachineScaleSets'. + */ + @JsonProperty(value = "availabilityZones") + private List availabilityZones; + + /* + * Whether each node is allocated its own public IP. Some scenarios may + * require nodes in a node pool to receive their own dedicated public IP + * addresses. A common scenario is for gaming workloads, where a console + * needs to make a direct connection to a cloud virtual machine to minimize + * hops. For more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false. + */ + @JsonProperty(value = "enableNodePublicIP") + private Boolean enableNodePublicIp; + + /* + * The public IP prefix ID which VM nodes should use IPs from. This is of + * the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} + */ + @JsonProperty(value = "nodePublicIPPrefixID") + private String nodePublicIpPrefixId; + + /* + * The Virtual Machine Scale Set priority. If not specified, the default is + * 'Regular'. + */ + @JsonProperty(value = "scaleSetPriority") + private ScaleSetPriority scaleSetPriority; + + /* + * The Virtual Machine Scale Set eviction policy. This cannot be specified + * unless the scaleSetPriority is 'Spot'. If not specified, the default is + * 'Delete'. + */ + @JsonProperty(value = "scaleSetEvictionPolicy") + private ScaleSetEvictionPolicy scaleSetEvictionPolicy; + + /* + * The max price (in US Dollars) you are willing to pay for spot instances. + * Possible values are any decimal value greater than zero or -1 which + * indicates default price to be up-to on-demand. Possible values are any + * decimal value greater than zero or -1 which indicates the willingness to + * pay any on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) + */ + @JsonProperty(value = "spotMaxPrice") + private Float spotMaxPrice; + + /* + * The tags to be persisted on the agent pool virtual machine scale set. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The node labels to be persisted across all nodes in agent pool. + */ + @JsonProperty(value = "nodeLabels") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map nodeLabels; + + /* + * The taints added to new nodes during node pool create and scale. For + * example, key=value:NoSchedule. + */ + @JsonProperty(value = "nodeTaints") + private List nodeTaints; + + /* + * The ID for Proximity Placement Group. + */ + @JsonProperty(value = "proximityPlacementGroupID") + private String proximityPlacementGroupId; + + /* + * Kubelet configurations of agent nodes. The Kubelet configuration on the + * agent pool nodes. + */ + @JsonProperty(value = "kubeletConfig") + private KubeletConfig kubeletConfig; + + /* + * OS configurations of Linux agent nodes. The OS configuration of Linux + * agent nodes. + */ + @JsonProperty(value = "linuxOSConfig") + private LinuxOSConfig linuxOSConfig; + + /* + * Whether to enable host based OS and data drive encryption. This is only + * supported on certain VM sizes and in certain Azure regions. For more + * information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption + */ + @JsonProperty(value = "enableEncryptionAtHost") + private Boolean enableEncryptionAtHost; + + /* + * Whether to enable UltraSSD + */ + @JsonProperty(value = "enableUltraSSD") + private Boolean enableUltraSsd; + + /* + * Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) + * for more details. + */ + @JsonProperty(value = "enableFIPS") + private Boolean enableFips; + + /* + * GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + */ + @JsonProperty(value = "gpuInstanceProfile") + private GpuInstanceProfile gpuInstanceProfile; + + /* + * CreationData to be used to specify the source Snapshot ID if the node + * pool will be created/upgraded using a snapshot. + */ + @JsonProperty(value = "creationData") + private CreationData creationData; + + /** + * Get the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of + * 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default + * value is 1. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: Number of agents (VMs) to host docker containers. Allowed values must be in the range of + * 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default + * value is 1. + * + * @param count the count value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the vmSize property: The size of the agent pool VMs. VM size availability varies by region. If a node + * contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + * restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The size of the agent pool VMs. VM size availability varies by region. If a node + * contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on + * restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions. + * + * @param vmSize the vmSize value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in the + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + * + * @return the osDiskSizeGB value. + */ + public Integer osDiskSizeGB() { + return this.osDiskSizeGB; + } + + /** + * Set the osDiskSizeGB property: OS Disk Size in GB to be used to specify the disk size for every machine in the + * master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + * + * @param osDiskSizeGB the osDiskSizeGB value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withOsDiskSizeGB(Integer osDiskSizeGB) { + this.osDiskSizeGB = osDiskSizeGB; + return this; + } + + /** + * Get the osDiskType property: The OS disk type to be used for machines in the agent pool. The default is + * 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + * defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + * + * @return the osDiskType value. + */ + public OSDiskType osDiskType() { + return this.osDiskType; + } + + /** + * Set the osDiskType property: The OS disk type to be used for machines in the agent pool. The default is + * 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, + * defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral + * OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). + * + * @param osDiskType the osDiskType value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withOsDiskType(OSDiskType osDiskType) { + this.osDiskType = osDiskType; + return this; + } + + /** + * Get the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * + * @return the kubeletDiskType value. + */ + public KubeletDiskType kubeletDiskType() { + return this.kubeletDiskType; + } + + /** + * Set the kubeletDiskType property: Determines the placement of emptyDir volumes, container runtime data root, and + * Kubelet ephemeral storage. + * + * @param kubeletDiskType the kubeletDiskType value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withKubeletDiskType(KubeletDiskType kubeletDiskType) { + this.kubeletDiskType = kubeletDiskType; + return this; + } + + /** + * Get the vnetSubnetId property: The ID of the subnet which agent pool nodes and optionally pods will join on + * startup. If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, + * this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @return the vnetSubnetId value. + */ + public String vnetSubnetId() { + return this.vnetSubnetId; + } + + /** + * Set the vnetSubnetId property: The ID of the subnet which agent pool nodes and optionally pods will join on + * startup. If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, + * this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @param vnetSubnetId the vnetSubnetId value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withVnetSubnetId(String vnetSubnetId) { + this.vnetSubnetId = vnetSubnetId; + return this; + } + + /** + * Get the podSubnetId property: The ID of the subnet which pods will join when launched. If omitted, pod IPs are + * statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @return the podSubnetId value. + */ + public String podSubnetId() { + return this.podSubnetId; + } + + /** + * Set the podSubnetId property: The ID of the subnet which pods will join when launched. If omitted, pod IPs are + * statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @param podSubnetId the podSubnetId value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withPodSubnetId(String podSubnetId) { + this.podSubnetId = podSubnetId; + return this; + } + + /** + * Get the maxPods property: The maximum number of pods that can run on a node. + * + * @return the maxPods value. + */ + public Integer maxPods() { + return this.maxPods; + } + + /** + * Set the maxPods property: The maximum number of pods that can run on a node. + * + * @param maxPods the maxPods value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withMaxPods(Integer maxPods) { + this.maxPods = maxPods; + return this; + } + + /** + * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @param osType the osType value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the osSku property: Specifies an OS SKU. This value must not be specified if OSType is Windows. + * + * @return the osSku value. + */ + public Ossku osSku() { + return this.osSku; + } + + /** + * Set the osSku property: Specifies an OS SKU. This value must not be specified if OSType is Windows. + * + * @param osSku the osSku value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withOsSku(Ossku osSku) { + this.osSku = osSku; + return this; + } + + /** + * Get the maxCount property: The maximum number of nodes for auto-scaling. + * + * @return the maxCount value. + */ + public Integer maxCount() { + return this.maxCount; + } + + /** + * Set the maxCount property: The maximum number of nodes for auto-scaling. + * + * @param maxCount the maxCount value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withMaxCount(Integer maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * Get the minCount property: The minimum number of nodes for auto-scaling. + * + * @return the minCount value. + */ + public Integer minCount() { + return this.minCount; + } + + /** + * Set the minCount property: The minimum number of nodes for auto-scaling. + * + * @param minCount the minCount value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withMinCount(Integer minCount) { + this.minCount = minCount; + return this; + } + + /** + * Get the enableAutoScaling property: Whether to enable auto-scaler. + * + * @return the enableAutoScaling value. + */ + public Boolean enableAutoScaling() { + return this.enableAutoScaling; + } + + /** + * Set the enableAutoScaling property: Whether to enable auto-scaler. + * + * @param enableAutoScaling the enableAutoScaling value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withEnableAutoScaling(Boolean enableAutoScaling) { + this.enableAutoScaling = enableAutoScaling; + return this; + } + + /** + * Get the scaleDownMode property: This also effects the cluster autoscaler behavior. If not specified, it defaults + * to Delete. + * + * @return the scaleDownMode value. + */ + public ScaleDownMode scaleDownMode() { + return this.scaleDownMode; + } + + /** + * Set the scaleDownMode property: This also effects the cluster autoscaler behavior. If not specified, it defaults + * to Delete. + * + * @param scaleDownMode the scaleDownMode value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withScaleDownMode(ScaleDownMode scaleDownMode) { + this.scaleDownMode = scaleDownMode; + return this; + } + + /** + * Get the type property: The type of Agent Pool. + * + * @return the type value. + */ + public AgentPoolType type() { + return this.type; + } + + /** + * Set the type property: The type of Agent Pool. + * + * @param type the type value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withType(AgentPoolType type) { + this.type = type; + return this; + } + + /** + * Get the mode property: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at all + * times. For additional information on agent pool restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools. + * + * @return the mode value. + */ + public AgentPoolMode mode() { + return this.mode; + } + + /** + * Set the mode property: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at all + * times. For additional information on agent pool restrictions and best practices, see: + * https://docs.microsoft.com/azure/aks/use-system-pools. + * + * @param mode the mode value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withMode(AgentPoolMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the orchestratorVersion property: The version of Kubernetes running on the Agent Pool. As a best practice, + * you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must + * have the same major version as the control plane. The node pool minor version must be within two minor versions + * of the control plane version. The node pool version cannot be greater than the control plane version. For more + * information see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + * + * @return the orchestratorVersion value. + */ + public String orchestratorVersion() { + return this.orchestratorVersion; + } + + /** + * Set the orchestratorVersion property: The version of Kubernetes running on the Agent Pool. As a best practice, + * you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must + * have the same major version as the control plane. The node pool minor version must be within two minor versions + * of the control plane version. The node pool version cannot be greater than the control plane version. For more + * information see [upgrading a node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). + * + * @param orchestratorVersion the orchestratorVersion value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withOrchestratorVersion(String orchestratorVersion) { + this.orchestratorVersion = orchestratorVersion; + return this; + } + + /** + * Get the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + public String nodeImageVersion() { + return this.nodeImageVersion; + } + + /** + * Get the upgradeSettings property: Settings for upgrading the agentpool. + * + * @return the upgradeSettings value. + */ + public AgentPoolUpgradeSettings upgradeSettings() { + return this.upgradeSettings; + } + + /** + * Set the upgradeSettings property: Settings for upgrading the agentpool. + * + * @param upgradeSettings the upgradeSettings value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { + this.upgradeSettings = upgradeSettings; + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the powerState property: Describes whether the Agent Pool is Running or Stopped. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.powerState; + } + + /** + * Get the availabilityZones property: The list of Availability zones to use for nodes. This can only be specified + * if the AgentPoolType property is 'VirtualMachineScaleSets'. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: The list of Availability zones to use for nodes. This can only be specified + * if the AgentPoolType property is 'VirtualMachineScaleSets'. + * + * @param availabilityZones the availabilityZones value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the enableNodePublicIp property: Whether each node is allocated its own public IP. Some scenarios may require + * nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming + * workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For + * more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false. + * + * @return the enableNodePublicIp value. + */ + public Boolean enableNodePublicIp() { + return this.enableNodePublicIp; + } + + /** + * Set the enableNodePublicIp property: Whether each node is allocated its own public IP. Some scenarios may require + * nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming + * workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For + * more information see [assigning a public IP per + * node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). + * The default is false. + * + * @param enableNodePublicIp the enableNodePublicIp value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withEnableNodePublicIp(Boolean enableNodePublicIp) { + this.enableNodePublicIp = enableNodePublicIp; + return this; + } + + /** + * Get the nodePublicIpPrefixId property: The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @return the nodePublicIpPrefixId value. + */ + public String nodePublicIpPrefixId() { + return this.nodePublicIpPrefixId; + } + + /** + * Set the nodePublicIpPrefixId property: The public IP prefix ID which VM nodes should use IPs from. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + * + * @param nodePublicIpPrefixId the nodePublicIpPrefixId value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withNodePublicIpPrefixId(String nodePublicIpPrefixId) { + this.nodePublicIpPrefixId = nodePublicIpPrefixId; + return this; + } + + /** + * Get the scaleSetPriority property: The Virtual Machine Scale Set priority. If not specified, the default is + * 'Regular'. + * + * @return the scaleSetPriority value. + */ + public ScaleSetPriority scaleSetPriority() { + return this.scaleSetPriority; + } + + /** + * Set the scaleSetPriority property: The Virtual Machine Scale Set priority. If not specified, the default is + * 'Regular'. + * + * @param scaleSetPriority the scaleSetPriority value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withScaleSetPriority(ScaleSetPriority scaleSetPriority) { + this.scaleSetPriority = scaleSetPriority; + return this; + } + + /** + * Get the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. This cannot be specified + * unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + * + * @return the scaleSetEvictionPolicy value. + */ + public ScaleSetEvictionPolicy scaleSetEvictionPolicy() { + return this.scaleSetEvictionPolicy; + } + + /** + * Set the scaleSetEvictionPolicy property: The Virtual Machine Scale Set eviction policy. This cannot be specified + * unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. + * + * @param scaleSetEvictionPolicy the scaleSetEvictionPolicy value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withScaleSetEvictionPolicy( + ScaleSetEvictionPolicy scaleSetEvictionPolicy) { + this.scaleSetEvictionPolicy = scaleSetEvictionPolicy; + return this; + } + + /** + * Get the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any + * on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + * + * @return the spotMaxPrice value. + */ + public Float spotMaxPrice() { + return this.spotMaxPrice; + } + + /** + * Set the spotMaxPrice property: The max price (in US Dollars) you are willing to pay for spot instances. Possible + * values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + * Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any + * on-demand price. For more details on spot pricing, see [spot VMs + * pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing). + * + * @param spotMaxPrice the spotMaxPrice value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withSpotMaxPrice(Float spotMaxPrice) { + this.spotMaxPrice = spotMaxPrice; + return this; + } + + /** + * Get the tags property: The tags to be persisted on the agent pool virtual machine scale set. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags to be persisted on the agent pool virtual machine scale set. + * + * @param tags the tags value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the nodeLabels property: The node labels to be persisted across all nodes in agent pool. + * + * @return the nodeLabels value. + */ + public Map nodeLabels() { + return this.nodeLabels; + } + + /** + * Set the nodeLabels property: The node labels to be persisted across all nodes in agent pool. + * + * @param nodeLabels the nodeLabels value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withNodeLabels(Map nodeLabels) { + this.nodeLabels = nodeLabels; + return this; + } + + /** + * Get the nodeTaints property: The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * + * @return the nodeTaints value. + */ + public List nodeTaints() { + return this.nodeTaints; + } + + /** + * Set the nodeTaints property: The taints added to new nodes during node pool create and scale. For example, + * key=value:NoSchedule. + * + * @param nodeTaints the nodeTaints value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withNodeTaints(List nodeTaints) { + this.nodeTaints = nodeTaints; + return this; + } + + /** + * Get the proximityPlacementGroupId property: The ID for Proximity Placement Group. + * + * @return the proximityPlacementGroupId value. + */ + public String proximityPlacementGroupId() { + return this.proximityPlacementGroupId; + } + + /** + * Set the proximityPlacementGroupId property: The ID for Proximity Placement Group. + * + * @param proximityPlacementGroupId the proximityPlacementGroupId value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withProximityPlacementGroupId(String proximityPlacementGroupId) { + this.proximityPlacementGroupId = proximityPlacementGroupId; + return this; + } + + /** + * Get the kubeletConfig property: Kubelet configurations of agent nodes. The Kubelet configuration on the agent + * pool nodes. + * + * @return the kubeletConfig value. + */ + public KubeletConfig kubeletConfig() { + return this.kubeletConfig; + } + + /** + * Set the kubeletConfig property: Kubelet configurations of agent nodes. The Kubelet configuration on the agent + * pool nodes. + * + * @param kubeletConfig the kubeletConfig value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withKubeletConfig(KubeletConfig kubeletConfig) { + this.kubeletConfig = kubeletConfig; + return this; + } + + /** + * Get the linuxOSConfig property: OS configurations of Linux agent nodes. The OS configuration of Linux agent + * nodes. + * + * @return the linuxOSConfig value. + */ + public LinuxOSConfig linuxOSConfig() { + return this.linuxOSConfig; + } + + /** + * Set the linuxOSConfig property: OS configurations of Linux agent nodes. The OS configuration of Linux agent + * nodes. + * + * @param linuxOSConfig the linuxOSConfig value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withLinuxOSConfig(LinuxOSConfig linuxOSConfig) { + this.linuxOSConfig = linuxOSConfig; + return this; + } + + /** + * Get the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. This is only + * supported on certain VM sizes and in certain Azure regions. For more information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption. + * + * @return the enableEncryptionAtHost value. + */ + public Boolean enableEncryptionAtHost() { + return this.enableEncryptionAtHost; + } + + /** + * Set the enableEncryptionAtHost property: Whether to enable host based OS and data drive encryption. This is only + * supported on certain VM sizes and in certain Azure regions. For more information, see: + * https://docs.microsoft.com/azure/aks/enable-host-encryption. + * + * @param enableEncryptionAtHost the enableEncryptionAtHost value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withEnableEncryptionAtHost(Boolean enableEncryptionAtHost) { + this.enableEncryptionAtHost = enableEncryptionAtHost; + return this; + } + + /** + * Get the enableUltraSsd property: Whether to enable UltraSSD. + * + * @return the enableUltraSsd value. + */ + public Boolean enableUltraSsd() { + return this.enableUltraSsd; + } + + /** + * Set the enableUltraSsd property: Whether to enable UltraSSD. + * + * @param enableUltraSsd the enableUltraSsd value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withEnableUltraSsd(Boolean enableUltraSsd) { + this.enableUltraSsd = enableUltraSsd; + return this; + } + + /** + * Get the enableFips property: Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more + * details. + * + * @return the enableFips value. + */ + public Boolean enableFips() { + return this.enableFips; + } + + /** + * Set the enableFips property: Whether to use a FIPS-enabled OS. See [Add a FIPS-enabled node + * pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more + * details. + * + * @param enableFips the enableFips value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withEnableFips(Boolean enableFips) { + this.enableFips = enableFips; + return this; + } + + /** + * Get the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + * + * @return the gpuInstanceProfile value. + */ + public GpuInstanceProfile gpuInstanceProfile() { + return this.gpuInstanceProfile; + } + + /** + * Set the gpuInstanceProfile property: GPUInstanceProfile to be used to specify GPU MIG instance profile for + * supported GPU VM SKU. + * + * @param gpuInstanceProfile the gpuInstanceProfile value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withGpuInstanceProfile(GpuInstanceProfile gpuInstanceProfile) { + this.gpuInstanceProfile = gpuInstanceProfile; + return this; + } + + /** + * Get the creationData property: CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.creationData; + } + + /** + * Set the creationData property: CreationData to be used to specify the source Snapshot ID if the node pool will be + * created/upgraded using a snapshot. + * + * @param creationData the creationData value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withCreationData(CreationData creationData) { + this.creationData = creationData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (upgradeSettings() != null) { + upgradeSettings().validate(); + } + if (powerState() != null) { + powerState().validate(); + } + if (kubeletConfig() != null) { + kubeletConfig().validate(); + } + if (linuxOSConfig() != null) { + linuxOSConfig().validate(); + } + if (creationData() != null) { + creationData().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterApiServerAccessProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterApiServerAccessProfile.java new file mode 100644 index 0000000000000..bf0f42914855b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterApiServerAccessProfile.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Access profile for managed cluster API server. */ +@Fluent +public final class ManagedClusterApiServerAccessProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterApiServerAccessProfile.class); + + /* + * The IP ranges authorized to access the Kubernetes API server. IP ranges + * are specified in CIDR format, e.g. 137.117.106.88/29. This feature is + * not compatible with clusters that use Public IP Per Node, or clusters + * that are using a Basic Load Balancer. For more information see [API + * server authorized IP + * ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + */ + @JsonProperty(value = "authorizedIPRanges") + private List authorizedIpRanges; + + /* + * Whether to create the cluster as a private cluster or not. For more + * details, see [Creating a private AKS + * cluster](https://docs.microsoft.com/azure/aks/private-clusters). + */ + @JsonProperty(value = "enablePrivateCluster") + private Boolean enablePrivateCluster; + + /* + * The private DNS zone mode for the cluster. The default is System. For + * more details see [configure private DNS + * zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). + * Allowed values are 'system' and 'none'. + */ + @JsonProperty(value = "privateDNSZone") + private String privateDnsZone; + + /* + * Whether to create additional public FQDN for private cluster or not. + */ + @JsonProperty(value = "enablePrivateClusterPublicFQDN") + private Boolean enablePrivateClusterPublicFqdn; + + /* + * Whether to disable run command for the cluster or not. + */ + @JsonProperty(value = "disableRunCommand") + private Boolean disableRunCommand; + + /** + * Get the authorizedIpRanges property: The IP ranges authorized to access the Kubernetes API server. IP ranges are + * specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP + * Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP + * ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + * + * @return the authorizedIpRanges value. + */ + public List authorizedIpRanges() { + return this.authorizedIpRanges; + } + + /** + * Set the authorizedIpRanges property: The IP ranges authorized to access the Kubernetes API server. IP ranges are + * specified in CIDR format, e.g. 137.117.106.88/29. This feature is not compatible with clusters that use Public IP + * Per Node, or clusters that are using a Basic Load Balancer. For more information see [API server authorized IP + * ranges](https://docs.microsoft.com/azure/aks/api-server-authorized-ip-ranges). + * + * @param authorizedIpRanges the authorizedIpRanges value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withAuthorizedIpRanges(List authorizedIpRanges) { + this.authorizedIpRanges = authorizedIpRanges; + return this; + } + + /** + * Get the enablePrivateCluster property: Whether to create the cluster as a private cluster or not. For more + * details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + * + * @return the enablePrivateCluster value. + */ + public Boolean enablePrivateCluster() { + return this.enablePrivateCluster; + } + + /** + * Set the enablePrivateCluster property: Whether to create the cluster as a private cluster or not. For more + * details, see [Creating a private AKS cluster](https://docs.microsoft.com/azure/aks/private-clusters). + * + * @param enablePrivateCluster the enablePrivateCluster value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withEnablePrivateCluster(Boolean enablePrivateCluster) { + this.enablePrivateCluster = enablePrivateCluster; + return this; + } + + /** + * Get the privateDnsZone property: The private DNS zone mode for the cluster. The default is System. For more + * details see [configure private DNS + * zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are + * 'system' and 'none'. + * + * @return the privateDnsZone value. + */ + public String privateDnsZone() { + return this.privateDnsZone; + } + + /** + * Set the privateDnsZone property: The private DNS zone mode for the cluster. The default is System. For more + * details see [configure private DNS + * zone](https://docs.microsoft.com/azure/aks/private-clusters#configure-private-dns-zone). Allowed values are + * 'system' and 'none'. + * + * @param privateDnsZone the privateDnsZone value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withPrivateDnsZone(String privateDnsZone) { + this.privateDnsZone = privateDnsZone; + return this; + } + + /** + * Get the enablePrivateClusterPublicFqdn property: Whether to create additional public FQDN for private cluster or + * not. + * + * @return the enablePrivateClusterPublicFqdn value. + */ + public Boolean enablePrivateClusterPublicFqdn() { + return this.enablePrivateClusterPublicFqdn; + } + + /** + * Set the enablePrivateClusterPublicFqdn property: Whether to create additional public FQDN for private cluster or + * not. + * + * @param enablePrivateClusterPublicFqdn the enablePrivateClusterPublicFqdn value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withEnablePrivateClusterPublicFqdn( + Boolean enablePrivateClusterPublicFqdn) { + this.enablePrivateClusterPublicFqdn = enablePrivateClusterPublicFqdn; + return this; + } + + /** + * Get the disableRunCommand property: Whether to disable run command for the cluster or not. + * + * @return the disableRunCommand value. + */ + public Boolean disableRunCommand() { + return this.disableRunCommand; + } + + /** + * Set the disableRunCommand property: Whether to disable run command for the cluster or not. + * + * @param disableRunCommand the disableRunCommand value to set. + * @return the ManagedClusterApiServerAccessProfile object itself. + */ + public ManagedClusterApiServerAccessProfile withDisableRunCommand(Boolean disableRunCommand) { + this.disableRunCommand = disableRunCommand; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAutoUpgradeProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAutoUpgradeProfile.java new file mode 100644 index 0000000000000..c79a6d53c9b43 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAutoUpgradeProfile.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Auto upgrade profile for a managed cluster. */ +@Fluent +public final class ManagedClusterAutoUpgradeProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterAutoUpgradeProfile.class); + + /* + * The upgrade channel for auto upgrade. The default is 'none'. For more + * information see [setting the AKS cluster auto-upgrade + * channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + */ + @JsonProperty(value = "upgradeChannel") + private UpgradeChannel upgradeChannel; + + /** + * Get the upgradeChannel property: The upgrade channel for auto upgrade. The default is 'none'. For more + * information see [setting the AKS cluster auto-upgrade + * channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + * + * @return the upgradeChannel value. + */ + public UpgradeChannel upgradeChannel() { + return this.upgradeChannel; + } + + /** + * Set the upgradeChannel property: The upgrade channel for auto upgrade. The default is 'none'. For more + * information see [setting the AKS cluster auto-upgrade + * channel](https://docs.microsoft.com/azure/aks/upgrade-cluster#set-auto-upgrade-channel). + * + * @param upgradeChannel the upgradeChannel value to set. + * @return the ManagedClusterAutoUpgradeProfile object itself. + */ + public ManagedClusterAutoUpgradeProfile withUpgradeChannel(UpgradeChannel upgradeChannel) { + this.upgradeChannel = upgradeChannel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterHttpProxyConfig.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterHttpProxyConfig.java new file mode 100644 index 0000000000000..429c3da2e1f73 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterHttpProxyConfig.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.containerservice.generated.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; + +/** Cluster HTTP proxy configuration. */ +@Fluent +public final class ManagedClusterHttpProxyConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterHttpProxyConfig.class); + + /* + * The HTTP proxy server endpoint to use. + */ + @JsonProperty(value = "httpProxy") + private String httpProxy; + + /* + * The HTTPS proxy server endpoint to use. + */ + @JsonProperty(value = "httpsProxy") + private String httpsProxy; + + /* + * The endpoints that should not go through proxy. + */ + @JsonProperty(value = "noProxy") + private List noProxy; + + /* + * Alternative CA cert to use for connecting to proxy servers. + */ + @JsonProperty(value = "trustedCa") + private String trustedCa; + + /** + * Get the httpProxy property: The HTTP proxy server endpoint to use. + * + * @return the httpProxy value. + */ + public String httpProxy() { + return this.httpProxy; + } + + /** + * Set the httpProxy property: The HTTP proxy server endpoint to use. + * + * @param httpProxy the httpProxy value to set. + * @return the ManagedClusterHttpProxyConfig object itself. + */ + public ManagedClusterHttpProxyConfig withHttpProxy(String httpProxy) { + this.httpProxy = httpProxy; + return this; + } + + /** + * Get the httpsProxy property: The HTTPS proxy server endpoint to use. + * + * @return the httpsProxy value. + */ + public String httpsProxy() { + return this.httpsProxy; + } + + /** + * Set the httpsProxy property: The HTTPS proxy server endpoint to use. + * + * @param httpsProxy the httpsProxy value to set. + * @return the ManagedClusterHttpProxyConfig object itself. + */ + public ManagedClusterHttpProxyConfig withHttpsProxy(String httpsProxy) { + this.httpsProxy = httpsProxy; + return this; + } + + /** + * Get the noProxy property: The endpoints that should not go through proxy. + * + * @return the noProxy value. + */ + public List noProxy() { + return this.noProxy; + } + + /** + * Set the noProxy property: The endpoints that should not go through proxy. + * + * @param noProxy the noProxy value to set. + * @return the ManagedClusterHttpProxyConfig object itself. + */ + public ManagedClusterHttpProxyConfig withNoProxy(List noProxy) { + this.noProxy = noProxy; + return this; + } + + /** + * Get the trustedCa property: Alternative CA cert to use for connecting to proxy servers. + * + * @return the trustedCa value. + */ + public String trustedCa() { + return this.trustedCa; + } + + /** + * Set the trustedCa property: Alternative CA cert to use for connecting to proxy servers. + * + * @param trustedCa the trustedCa value to set. + * @return the ManagedClusterHttpProxyConfig object itself. + */ + public ManagedClusterHttpProxyConfig withTrustedCa(String trustedCa) { + this.trustedCa = trustedCa; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIdentity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIdentity.java new file mode 100644 index 0000000000000..4bd4c0a38800d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIdentity.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.containerservice.generated.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; + +/** Identity for the managed cluster. */ +@Fluent +public class ManagedClusterIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterIdentity.class); + + /* + * The principal id of the system assigned identity which is used by master + * components. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id of the system assigned identity which is used by master + * components. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of identity used for the managed cluster. For more information + * see [use managed identities in + * AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The keys must 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 system assigned identity which is used by master + * components. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id of the system assigned identity which is used by master components. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the managed cluster. For more information see [use managed + * identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the managed cluster. For more information see [use managed + * identities in AKS](https://docs.microsoft.com/azure/aks/use-managed-identity). + * + * @param type the type value to set. + * @return the ManagedClusterIdentity object itself. + */ + public ManagedClusterIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The keys must 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 keys must 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 ManagedClusterIdentity object itself. + */ + public ManagedClusterIdentity 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterListResult.java new file mode 100644 index 0000000000000..0a85fe47ef519 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Managed Clusters operation. */ +@Fluent +public final class ManagedClusterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterListResult.class); + + /* + * The list of managed clusters. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of managed cluster results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of managed clusters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of managed clusters. + * + * @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 get the next set of managed cluster results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfile.java new file mode 100644 index 0000000000000..f2f0d79f2691e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfile.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Profile of the managed cluster load balancer. */ +@Fluent +public final class ManagedClusterLoadBalancerProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterLoadBalancerProfile.class); + + /* + * Desired managed outbound IPs for the cluster load balancer. + */ + @JsonProperty(value = "managedOutboundIPs") + private ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs; + + /* + * Desired outbound IP Prefix resources for the cluster load balancer. + */ + @JsonProperty(value = "outboundIPPrefixes") + private ManagedClusterLoadBalancerProfileOutboundIpPrefixes outboundIpPrefixes; + + /* + * Desired outbound IP resources for the cluster load balancer. + */ + @JsonProperty(value = "outboundIPs") + private ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs; + + /* + * The effective outbound IP resources of the cluster load balancer. + */ + @JsonProperty(value = "effectiveOutboundIPs") + private List effectiveOutboundIPs; + + /* + * The desired number of allocated SNAT ports per VM. Allowed values are in + * the range of 0 to 64000 (inclusive). The default value is 0 which + * results in Azure dynamically allocating ports. + */ + @JsonProperty(value = "allocatedOutboundPorts") + private Integer allocatedOutboundPorts; + + /* + * Desired outbound flow idle timeout in minutes. Allowed values are in the + * range of 4 to 120 (inclusive). The default value is 30 minutes. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /* + * Enable multiple standard load balancers per AKS cluster or not. + */ + @JsonProperty(value = "enableMultipleStandardLoadBalancers") + private Boolean enableMultipleStandardLoadBalancers; + + /** + * Get the managedOutboundIPs property: Desired managed outbound IPs for the cluster load balancer. + * + * @return the managedOutboundIPs value. + */ + public ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs() { + return this.managedOutboundIPs; + } + + /** + * Set the managedOutboundIPs property: Desired managed outbound IPs for the cluster load balancer. + * + * @param managedOutboundIPs the managedOutboundIPs value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withManagedOutboundIPs( + ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs) { + this.managedOutboundIPs = managedOutboundIPs; + return this; + } + + /** + * Get the outboundIpPrefixes property: Desired outbound IP Prefix resources for the cluster load balancer. + * + * @return the outboundIpPrefixes value. + */ + public ManagedClusterLoadBalancerProfileOutboundIpPrefixes outboundIpPrefixes() { + return this.outboundIpPrefixes; + } + + /** + * Set the outboundIpPrefixes property: Desired outbound IP Prefix resources for the cluster load balancer. + * + * @param outboundIpPrefixes the outboundIpPrefixes value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withOutboundIpPrefixes( + ManagedClusterLoadBalancerProfileOutboundIpPrefixes outboundIpPrefixes) { + this.outboundIpPrefixes = outboundIpPrefixes; + return this; + } + + /** + * Get the outboundIPs property: Desired outbound IP resources for the cluster load balancer. + * + * @return the outboundIPs value. + */ + public ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs() { + return this.outboundIPs; + } + + /** + * Set the outboundIPs property: Desired outbound IP resources for the cluster load balancer. + * + * @param outboundIPs the outboundIPs value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withOutboundIPs(ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs) { + this.outboundIPs = outboundIPs; + return this; + } + + /** + * Get the effectiveOutboundIPs property: The effective outbound IP resources of the cluster load balancer. + * + * @return the effectiveOutboundIPs value. + */ + public List effectiveOutboundIPs() { + return this.effectiveOutboundIPs; + } + + /** + * Set the effectiveOutboundIPs property: The effective outbound IP resources of the cluster load balancer. + * + * @param effectiveOutboundIPs the effectiveOutboundIPs value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withEffectiveOutboundIPs(List effectiveOutboundIPs) { + this.effectiveOutboundIPs = effectiveOutboundIPs; + return this; + } + + /** + * Get the allocatedOutboundPorts property: The desired number of allocated SNAT ports per VM. Allowed values are in + * the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. + * + * @return the allocatedOutboundPorts value. + */ + public Integer allocatedOutboundPorts() { + return this.allocatedOutboundPorts; + } + + /** + * Set the allocatedOutboundPorts property: The desired number of allocated SNAT ports per VM. Allowed values are in + * the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. + * + * @param allocatedOutboundPorts the allocatedOutboundPorts value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withAllocatedOutboundPorts(Integer allocatedOutboundPorts) { + this.allocatedOutboundPorts = allocatedOutboundPorts; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: Desired outbound flow idle timeout in minutes. Allowed values are in the + * range of 4 to 120 (inclusive). The default value is 30 minutes. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: Desired outbound flow idle timeout in minutes. Allowed values are in the + * range of 4 to 120 (inclusive). The default value is 30 minutes. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Get the enableMultipleStandardLoadBalancers property: Enable multiple standard load balancers per AKS cluster or + * not. + * + * @return the enableMultipleStandardLoadBalancers value. + */ + public Boolean enableMultipleStandardLoadBalancers() { + return this.enableMultipleStandardLoadBalancers; + } + + /** + * Set the enableMultipleStandardLoadBalancers property: Enable multiple standard load balancers per AKS cluster or + * not. + * + * @param enableMultipleStandardLoadBalancers the enableMultipleStandardLoadBalancers value to set. + * @return the ManagedClusterLoadBalancerProfile object itself. + */ + public ManagedClusterLoadBalancerProfile withEnableMultipleStandardLoadBalancers( + Boolean enableMultipleStandardLoadBalancers) { + this.enableMultipleStandardLoadBalancers = enableMultipleStandardLoadBalancers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedOutboundIPs() != null) { + managedOutboundIPs().validate(); + } + if (outboundIpPrefixes() != null) { + outboundIpPrefixes().validate(); + } + if (outboundIPs() != null) { + outboundIPs().validate(); + } + if (effectiveOutboundIPs() != null) { + effectiveOutboundIPs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java new file mode 100644 index 0000000000000..a56011ec0a84c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Desired managed outbound IPs for the cluster load balancer. */ +@Fluent +public final class ManagedClusterLoadBalancerProfileManagedOutboundIPs { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ManagedClusterLoadBalancerProfileManagedOutboundIPs.class); + + /* + * The desired number of outbound IPs created/managed by Azure for the + * cluster load balancer. Allowed values must be in the range of 1 to 100 + * (inclusive). The default value is 1. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Get the count property: The desired number of outbound IPs created/managed by Azure for the cluster load + * balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: The desired number of outbound IPs created/managed by Azure for the cluster load + * balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + * + * @param count the count value to set. + * @return the ManagedClusterLoadBalancerProfileManagedOutboundIPs object itself. + */ + public ManagedClusterLoadBalancerProfileManagedOutboundIPs withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPs.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPs.java new file mode 100644 index 0000000000000..6767a74e80bb2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPs.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Desired outbound IP resources for the cluster load balancer. */ +@Fluent +public final class ManagedClusterLoadBalancerProfileOutboundIPs { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ManagedClusterLoadBalancerProfileOutboundIPs.class); + + /* + * A list of public IP resources. + */ + @JsonProperty(value = "publicIPs") + private List publicIPs; + + /** + * Get the publicIPs property: A list of public IP resources. + * + * @return the publicIPs value. + */ + public List publicIPs() { + return this.publicIPs; + } + + /** + * Set the publicIPs property: A list of public IP resources. + * + * @param publicIPs the publicIPs value to set. + * @return the ManagedClusterLoadBalancerProfileOutboundIPs object itself. + */ + public ManagedClusterLoadBalancerProfileOutboundIPs withPublicIPs(List publicIPs) { + this.publicIPs = publicIPs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicIPs() != null) { + publicIPs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIpPrefixes.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIpPrefixes.java new file mode 100644 index 0000000000000..d5b7ef2a5bf68 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIpPrefixes.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Desired outbound IP Prefix resources for the cluster load balancer. */ +@Fluent +public final class ManagedClusterLoadBalancerProfileOutboundIpPrefixes { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ManagedClusterLoadBalancerProfileOutboundIpPrefixes.class); + + /* + * A list of public IP prefix resources. + */ + @JsonProperty(value = "publicIPPrefixes") + private List publicIpPrefixes; + + /** + * Get the publicIpPrefixes property: A list of public IP prefix resources. + * + * @return the publicIpPrefixes value. + */ + public List publicIpPrefixes() { + return this.publicIpPrefixes; + } + + /** + * Set the publicIpPrefixes property: A list of public IP prefix resources. + * + * @param publicIpPrefixes the publicIpPrefixes value to set. + * @return the ManagedClusterLoadBalancerProfileOutboundIpPrefixes object itself. + */ + public ManagedClusterLoadBalancerProfileOutboundIpPrefixes withPublicIpPrefixes( + List publicIpPrefixes) { + this.publicIpPrefixes = publicIpPrefixes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicIpPrefixes() != null) { + publicIpPrefixes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterManagedOutboundIpProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterManagedOutboundIpProfile.java new file mode 100644 index 0000000000000..89d32ec85cfa9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterManagedOutboundIpProfile.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.containerservice.generated.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; + +/** Profile of the managed outbound IP resources of the managed cluster. */ +@Fluent +public final class ManagedClusterManagedOutboundIpProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterManagedOutboundIpProfile.class); + + /* + * The desired number of outbound IPs created/managed by Azure. Allowed + * values must be in the range of 1 to 16 (inclusive). The default value is + * 1. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Get the count property: The desired number of outbound IPs created/managed by Azure. Allowed values must be in + * the range of 1 to 16 (inclusive). The default value is 1. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * Set the count property: The desired number of outbound IPs created/managed by Azure. Allowed values must be in + * the range of 1 to 16 (inclusive). The default value is 1. + * + * @param count the count value to set. + * @return the ManagedClusterManagedOutboundIpProfile object itself. + */ + public ManagedClusterManagedOutboundIpProfile withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNatGatewayProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNatGatewayProfile.java new file mode 100644 index 0000000000000..4beb266ae41d7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNatGatewayProfile.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Profile of the managed cluster NAT gateway. */ +@Fluent +public final class ManagedClusterNatGatewayProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterNatGatewayProfile.class); + + /* + * Profile of the managed outbound IP resources of the cluster NAT gateway. + */ + @JsonProperty(value = "managedOutboundIPProfile") + private ManagedClusterManagedOutboundIpProfile managedOutboundIpProfile; + + /* + * The effective outbound IP resources of the cluster NAT gateway. + */ + @JsonProperty(value = "effectiveOutboundIPs") + private List effectiveOutboundIPs; + + /* + * Desired outbound flow idle timeout in minutes. Allowed values are in the + * range of 4 to 120 (inclusive). The default value is 4 minutes. + */ + @JsonProperty(value = "idleTimeoutInMinutes") + private Integer idleTimeoutInMinutes; + + /** + * Get the managedOutboundIpProfile property: Profile of the managed outbound IP resources of the cluster NAT + * gateway. + * + * @return the managedOutboundIpProfile value. + */ + public ManagedClusterManagedOutboundIpProfile managedOutboundIpProfile() { + return this.managedOutboundIpProfile; + } + + /** + * Set the managedOutboundIpProfile property: Profile of the managed outbound IP resources of the cluster NAT + * gateway. + * + * @param managedOutboundIpProfile the managedOutboundIpProfile value to set. + * @return the ManagedClusterNatGatewayProfile object itself. + */ + public ManagedClusterNatGatewayProfile withManagedOutboundIpProfile( + ManagedClusterManagedOutboundIpProfile managedOutboundIpProfile) { + this.managedOutboundIpProfile = managedOutboundIpProfile; + return this; + } + + /** + * Get the effectiveOutboundIPs property: The effective outbound IP resources of the cluster NAT gateway. + * + * @return the effectiveOutboundIPs value. + */ + public List effectiveOutboundIPs() { + return this.effectiveOutboundIPs; + } + + /** + * Set the effectiveOutboundIPs property: The effective outbound IP resources of the cluster NAT gateway. + * + * @param effectiveOutboundIPs the effectiveOutboundIPs value to set. + * @return the ManagedClusterNatGatewayProfile object itself. + */ + public ManagedClusterNatGatewayProfile withEffectiveOutboundIPs(List effectiveOutboundIPs) { + this.effectiveOutboundIPs = effectiveOutboundIPs; + return this; + } + + /** + * Get the idleTimeoutInMinutes property: Desired outbound flow idle timeout in minutes. Allowed values are in the + * range of 4 to 120 (inclusive). The default value is 4 minutes. + * + * @return the idleTimeoutInMinutes value. + */ + public Integer idleTimeoutInMinutes() { + return this.idleTimeoutInMinutes; + } + + /** + * Set the idleTimeoutInMinutes property: Desired outbound flow idle timeout in minutes. Allowed values are in the + * range of 4 to 120 (inclusive). The default value is 4 minutes. + * + * @param idleTimeoutInMinutes the idleTimeoutInMinutes value to set. + * @return the ManagedClusterNatGatewayProfile object itself. + */ + public ManagedClusterNatGatewayProfile withIdleTimeoutInMinutes(Integer idleTimeoutInMinutes) { + this.idleTimeoutInMinutes = idleTimeoutInMinutes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedOutboundIpProfile() != null) { + managedOutboundIpProfile().validate(); + } + if (effectiveOutboundIPs() != null) { + effectiveOutboundIPs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentity.java new file mode 100644 index 0000000000000..29dc2985742aa --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentity.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Details about the pod identity assigned to the Managed Cluster. */ +@Fluent +public class ManagedClusterPodIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPodIdentity.class); + + /* + * The name of the pod identity. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The namespace of the pod identity. + */ + @JsonProperty(value = "namespace", required = true) + private String namespace; + + /* + * The binding selector to use for the AzureIdentityBinding resource. + */ + @JsonProperty(value = "bindingSelector") + private String bindingSelector; + + /* + * The user assigned identity details. + */ + @JsonProperty(value = "identity", required = true) + private UserAssignedIdentity identity; + + /* + * The current provisioning state of the pod identity. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ManagedClusterPodIdentityProvisioningState provisioningState; + + /* + * The provisioningInfo property. + */ + @JsonProperty(value = "provisioningInfo", access = JsonProperty.Access.WRITE_ONLY) + private ManagedClusterPodIdentityProvisioningInfo provisioningInfo; + + /** + * Get the name property: The name of the pod identity. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the pod identity. + * + * @param name the name value to set. + * @return the ManagedClusterPodIdentity object itself. + */ + public ManagedClusterPodIdentity withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: The namespace of the pod identity. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the pod identity. + * + * @param namespace the namespace value to set. + * @return the ManagedClusterPodIdentity object itself. + */ + public ManagedClusterPodIdentity withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the bindingSelector property: The binding selector to use for the AzureIdentityBinding resource. + * + * @return the bindingSelector value. + */ + public String bindingSelector() { + return this.bindingSelector; + } + + /** + * Set the bindingSelector property: The binding selector to use for the AzureIdentityBinding resource. + * + * @param bindingSelector the bindingSelector value to set. + * @return the ManagedClusterPodIdentity object itself. + */ + public ManagedClusterPodIdentity withBindingSelector(String bindingSelector) { + this.bindingSelector = bindingSelector; + return this; + } + + /** + * Get the identity property: The user assigned identity details. + * + * @return the identity value. + */ + public UserAssignedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The user assigned identity details. + * + * @param identity the identity value to set. + * @return the ManagedClusterPodIdentity object itself. + */ + public ManagedClusterPodIdentity withIdentity(UserAssignedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the provisioningState property: The current provisioning state of the pod identity. + * + * @return the provisioningState value. + */ + public ManagedClusterPodIdentityProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisioningInfo property: The provisioningInfo property. + * + * @return the provisioningInfo value. + */ + public ManagedClusterPodIdentityProvisioningInfo provisioningInfo() { + return this.provisioningInfo; + } + + /** + * 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 ManagedClusterPodIdentity")); + } + if (namespace() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property namespace in model ManagedClusterPodIdentity")); + } + if (identity() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property identity in model ManagedClusterPodIdentity")); + } else { + identity().validate(); + } + if (provisioningInfo() != null) { + provisioningInfo().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityException.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityException.java new file mode 100644 index 0000000000000..946678b5e3910 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityException.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** + * See [disable AAD Pod Identity for a specific + * Pod/Application](https://azure.github.io/aad-pod-identity/docs/configure/application_exception/) for more details. + */ +@Fluent +public final class ManagedClusterPodIdentityException { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPodIdentityException.class); + + /* + * The name of the pod identity exception. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The namespace of the pod identity exception. + */ + @JsonProperty(value = "namespace", required = true) + private String namespace; + + /* + * The pod labels to match. + */ + @JsonProperty(value = "podLabels", required = true) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map podLabels; + + /** + * Get the name property: The name of the pod identity exception. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the pod identity exception. + * + * @param name the name value to set. + * @return the ManagedClusterPodIdentityException object itself. + */ + public ManagedClusterPodIdentityException withName(String name) { + this.name = name; + return this; + } + + /** + * Get the namespace property: The namespace of the pod identity exception. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the pod identity exception. + * + * @param namespace the namespace value to set. + * @return the ManagedClusterPodIdentityException object itself. + */ + public ManagedClusterPodIdentityException withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the podLabels property: The pod labels to match. + * + * @return the podLabels value. + */ + public Map podLabels() { + return this.podLabels; + } + + /** + * Set the podLabels property: The pod labels to match. + * + * @param podLabels the podLabels value to set. + * @return the ManagedClusterPodIdentityException object itself. + */ + public ManagedClusterPodIdentityException withPodLabels(Map podLabels) { + this.podLabels = podLabels; + 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 ManagedClusterPodIdentityException")); + } + if (namespace() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property namespace in model ManagedClusterPodIdentityException")); + } + if (podLabels() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property podLabels in model ManagedClusterPodIdentityException")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProfile.java new file mode 100644 index 0000000000000..6bdf44d03a085 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProfile.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** + * See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on pod + * identity integration. + */ +@Fluent +public final class ManagedClusterPodIdentityProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPodIdentityProfile.class); + + /* + * Whether the pod identity addon is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Whether pod identity is allowed to run on clusters with Kubenet + * networking. Running in Kubenet is disabled by default due to the + * security related nature of AAD Pod Identity and the risks of IP + * spoofing. See [using Kubenet network plugin with AAD Pod + * Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + * for more information. + */ + @JsonProperty(value = "allowNetworkPluginKubenet") + private Boolean allowNetworkPluginKubenet; + + /* + * The pod identities to use in the cluster. + */ + @JsonProperty(value = "userAssignedIdentities") + private List userAssignedIdentities; + + /* + * The pod identity exceptions to allow. + */ + @JsonProperty(value = "userAssignedIdentityExceptions") + private List userAssignedIdentityExceptions; + + /** + * Get the enabled property: Whether the pod identity addon is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the pod identity addon is enabled. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterPodIdentityProfile object itself. + */ + public ManagedClusterPodIdentityProfile withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the allowNetworkPluginKubenet property: Whether pod identity is allowed to run on clusters with Kubenet + * networking. Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and + * the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod + * Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + * for more information. + * + * @return the allowNetworkPluginKubenet value. + */ + public Boolean allowNetworkPluginKubenet() { + return this.allowNetworkPluginKubenet; + } + + /** + * Set the allowNetworkPluginKubenet property: Whether pod identity is allowed to run on clusters with Kubenet + * networking. Running in Kubenet is disabled by default due to the security related nature of AAD Pod Identity and + * the risks of IP spoofing. See [using Kubenet network plugin with AAD Pod + * Identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity#using-kubenet-network-plugin-with-azure-active-directory-pod-managed-identities) + * for more information. + * + * @param allowNetworkPluginKubenet the allowNetworkPluginKubenet value to set. + * @return the ManagedClusterPodIdentityProfile object itself. + */ + public ManagedClusterPodIdentityProfile withAllowNetworkPluginKubenet(Boolean allowNetworkPluginKubenet) { + this.allowNetworkPluginKubenet = allowNetworkPluginKubenet; + return this; + } + + /** + * Get the userAssignedIdentities property: The pod identities to use in the cluster. + * + * @return the userAssignedIdentities value. + */ + public List userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The pod identities to use in the cluster. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedClusterPodIdentityProfile object itself. + */ + public ManagedClusterPodIdentityProfile withUserAssignedIdentities( + List userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Get the userAssignedIdentityExceptions property: The pod identity exceptions to allow. + * + * @return the userAssignedIdentityExceptions value. + */ + public List userAssignedIdentityExceptions() { + return this.userAssignedIdentityExceptions; + } + + /** + * Set the userAssignedIdentityExceptions property: The pod identity exceptions to allow. + * + * @param userAssignedIdentityExceptions the userAssignedIdentityExceptions value to set. + * @return the ManagedClusterPodIdentityProfile object itself. + */ + public ManagedClusterPodIdentityProfile withUserAssignedIdentityExceptions( + List userAssignedIdentityExceptions) { + this.userAssignedIdentityExceptions = userAssignedIdentityExceptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities().forEach(e -> e.validate()); + } + if (userAssignedIdentityExceptions() != null) { + userAssignedIdentityExceptions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningError.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningError.java new file mode 100644 index 0000000000000..5fd31a73608f4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningError.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.containerservice.generated.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; + +/** An error response from the pod identity provisioning. */ +@Fluent +public final class ManagedClusterPodIdentityProvisioningError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPodIdentityProvisioningError.class); + + /* + * Details about the error. + */ + @JsonProperty(value = "error") + private ManagedClusterPodIdentityProvisioningErrorBody error; + + /** + * Get the error property: Details about the error. + * + * @return the error value. + */ + public ManagedClusterPodIdentityProvisioningErrorBody error() { + return this.error; + } + + /** + * Set the error property: Details about the error. + * + * @param error the error value to set. + * @return the ManagedClusterPodIdentityProvisioningError object itself. + */ + public ManagedClusterPodIdentityProvisioningError withError(ManagedClusterPodIdentityProvisioningErrorBody error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningErrorBody.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningErrorBody.java new file mode 100644 index 0000000000000..d842a08423511 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningErrorBody.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** An error response from the pod identity provisioning. */ +@Fluent +public final class ManagedClusterPodIdentityProvisioningErrorBody { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ManagedClusterPodIdentityProvisioningErrorBody.class); + + /* + * An identifier for the error. Codes are invariant and are intended to be + * consumed programmatically. + */ + @JsonProperty(value = "code") + private String code; + + /* + * A message describing the error, intended to be suitable for display in a + * user interface. + */ + @JsonProperty(value = "message") + private String message; + + /* + * The target of the particular error. For example, the name of the + * property in error. + */ + @JsonProperty(value = "target") + private String target; + + /* + * A list of additional details about the error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the code property: An identifier for the error. Codes are invariant and are intended to be consumed + * programmatically. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: An identifier for the error. Codes are invariant and are intended to be consumed + * programmatically. + * + * @param code the code value to set. + * @return the ManagedClusterPodIdentityProvisioningErrorBody object itself. + */ + public ManagedClusterPodIdentityProvisioningErrorBody withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: A message describing the error, intended to be suitable for display in a user + * interface. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: A message describing the error, intended to be suitable for display in a user + * interface. + * + * @param message the message value to set. + * @return the ManagedClusterPodIdentityProvisioningErrorBody object itself. + */ + public ManagedClusterPodIdentityProvisioningErrorBody withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target property: The target of the particular error. For example, the name of the property in error. + * + * @return the target value. + */ + public String target() { + return this.target; + } + + /** + * Set the target property: The target of the particular error. For example, the name of the property in error. + * + * @param target the target value to set. + * @return the ManagedClusterPodIdentityProvisioningErrorBody object itself. + */ + public ManagedClusterPodIdentityProvisioningErrorBody withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the details property: A list of additional details about the error. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Set the details property: A list of additional details about the error. + * + * @param details the details value to set. + * @return the ManagedClusterPodIdentityProvisioningErrorBody object itself. + */ + public ManagedClusterPodIdentityProvisioningErrorBody withDetails( + List details) { + this.details = details; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningInfo.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningInfo.java new file mode 100644 index 0000000000000..6919626e21d68 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningInfo.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.containerservice.generated.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 ManagedClusterPodIdentityProvisioningInfo model. */ +@Fluent +public final class ManagedClusterPodIdentityProvisioningInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPodIdentityProvisioningInfo.class); + + /* + * Pod identity assignment error (if any). + */ + @JsonProperty(value = "error") + private ManagedClusterPodIdentityProvisioningError error; + + /** + * Get the error property: Pod identity assignment error (if any). + * + * @return the error value. + */ + public ManagedClusterPodIdentityProvisioningError error() { + return this.error; + } + + /** + * Set the error property: Pod identity assignment error (if any). + * + * @param error the error value to set. + * @return the ManagedClusterPodIdentityProvisioningInfo object itself. + */ + public ManagedClusterPodIdentityProvisioningInfo withError(ManagedClusterPodIdentityProvisioningError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningState.java new file mode 100644 index 0000000000000..c4e40bfc0a5e2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedClusterPodIdentityProvisioningState. */ +public final class ManagedClusterPodIdentityProvisioningState + extends ExpandableStringEnum { + /** Static value Assigned for ManagedClusterPodIdentityProvisioningState. */ + public static final ManagedClusterPodIdentityProvisioningState ASSIGNED = fromString("Assigned"); + + /** Static value Updating for ManagedClusterPodIdentityProvisioningState. */ + public static final ManagedClusterPodIdentityProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ManagedClusterPodIdentityProvisioningState. */ + public static final ManagedClusterPodIdentityProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ManagedClusterPodIdentityProvisioningState. */ + public static final ManagedClusterPodIdentityProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a ManagedClusterPodIdentityProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedClusterPodIdentityProvisioningState. + */ + @JsonCreator + public static ManagedClusterPodIdentityProvisioningState fromString(String name) { + return fromString(name, ManagedClusterPodIdentityProvisioningState.class); + } + + /** @return known ManagedClusterPodIdentityProvisioningState values. */ + public static Collection values() { + return values(ManagedClusterPodIdentityProvisioningState.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfile.java new file mode 100644 index 0000000000000..141f8bc04a398 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfile.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** The list of available upgrade versions. */ +@Fluent +public final class ManagedClusterPoolUpgradeProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPoolUpgradeProfile.class); + + /* + * The Kubernetes version (major.minor.patch). + */ + @JsonProperty(value = "kubernetesVersion", required = true) + private String kubernetesVersion; + + /* + * The Agent Pool name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * OsType to be used to specify os type. Choose from Linux and Windows. + * Default to Linux. + */ + @JsonProperty(value = "osType", required = true) + private OSType osType; + + /* + * List of orchestrator types and versions available for upgrade. + */ + @JsonProperty(value = "upgrades") + private List upgrades; + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Set the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @param kubernetesVersion the kubernetesVersion value to set. + * @return the ManagedClusterPoolUpgradeProfile object itself. + */ + public ManagedClusterPoolUpgradeProfile withKubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + return this; + } + + /** + * Get the name property: The Agent Pool name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The Agent Pool name. + * + * @param name the name value to set. + * @return the ManagedClusterPoolUpgradeProfile object itself. + */ + public ManagedClusterPoolUpgradeProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @param osType the osType value to set. + * @return the ManagedClusterPoolUpgradeProfile object itself. + */ + public ManagedClusterPoolUpgradeProfile withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the upgrades property: List of orchestrator types and versions available for upgrade. + * + * @return the upgrades value. + */ + public List upgrades() { + return this.upgrades; + } + + /** + * Set the upgrades property: List of orchestrator types and versions available for upgrade. + * + * @param upgrades the upgrades value to set. + * @return the ManagedClusterPoolUpgradeProfile object itself. + */ + public ManagedClusterPoolUpgradeProfile withUpgrades(List upgrades) { + this.upgrades = upgrades; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kubernetesVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property kubernetesVersion in model ManagedClusterPoolUpgradeProfile")); + } + if (osType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osType in model ManagedClusterPoolUpgradeProfile")); + } + if (upgrades() != null) { + upgrades().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java new file mode 100644 index 0000000000000..a2850e2fc5a24 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 ManagedClusterPoolUpgradeProfileUpgradesItem model. */ +@Fluent +public final class ManagedClusterPoolUpgradeProfileUpgradesItem { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ManagedClusterPoolUpgradeProfileUpgradesItem.class); + + /* + * The Kubernetes version (major.minor.patch). + */ + @JsonProperty(value = "kubernetesVersion") + private String kubernetesVersion; + + /* + * Whether the Kubernetes version is currently in preview. + */ + @JsonProperty(value = "isPreview") + private Boolean isPreview; + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Set the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @param kubernetesVersion the kubernetesVersion value to set. + * @return the ManagedClusterPoolUpgradeProfileUpgradesItem object itself. + */ + public ManagedClusterPoolUpgradeProfileUpgradesItem withKubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + return this; + } + + /** + * Get the isPreview property: Whether the Kubernetes version is currently in preview. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Whether the Kubernetes version is currently in preview. + * + * @param isPreview the isPreview value to set. + * @return the ManagedClusterPoolUpgradeProfileUpgradesItem object itself. + */ + public ManagedClusterPoolUpgradeProfileUpgradesItem withIsPreview(Boolean isPreview) { + this.isPreview = isPreview; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesAutoScalerProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesAutoScalerProfile.java new file mode 100644 index 0000000000000..704f6ad94b771 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesAutoScalerProfile.java @@ -0,0 +1,550 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Parameters to be applied to the cluster-autoscaler when enabled. */ +@Fluent +public final class ManagedClusterPropertiesAutoScalerProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterPropertiesAutoScalerProfile.class); + + /* + * Detects similar node pools and balances the number of nodes between + * them. Valid values are 'true' and 'false' + */ + @JsonProperty(value = "balance-similar-node-groups") + private String balanceSimilarNodeGroups; + + /* + * The expander to use when scaling up If not specified, the default is + * 'random'. See + * [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) + * for more information. + */ + @JsonProperty(value = "expander") + private Expander expander; + + /* + * The maximum number of empty nodes that can be deleted at the same time. + * This must be a positive integer. The default is 10. + */ + @JsonProperty(value = "max-empty-bulk-delete") + private String maxEmptyBulkDelete; + + /* + * The maximum number of seconds the cluster autoscaler waits for pod + * termination when trying to scale down a node. The default is 600. + */ + @JsonProperty(value = "max-graceful-termination-sec") + private String maxGracefulTerminationSec; + + /* + * The maximum time the autoscaler waits for a node to be provisioned. The + * default is '15m'. Values must be an integer followed by an 'm'. No unit + * of time other than minutes (m) is supported. + */ + @JsonProperty(value = "max-node-provision-time") + private String maxNodeProvisionTime; + + /* + * The maximum percentage of unready nodes in the cluster. After this + * percentage is exceeded, cluster autoscaler halts operations. The default + * is 45. The maximum is 100 and the minimum is 0. + */ + @JsonProperty(value = "max-total-unready-percentage") + private String maxTotalUnreadyPercentage; + + /* + * Ignore unscheduled pods before they're a certain age. For scenarios like + * burst/batch scale where you don't want CA to act before the kubernetes + * scheduler could schedule all the pods, you can tell CA to ignore + * unscheduled pods before they're a certain age. The default is '0s'. + * Values must be an integer followed by a unit ('s' for seconds, 'm' for + * minutes, 'h' for hours, etc). + */ + @JsonProperty(value = "new-pod-scale-up-delay") + private String newPodScaleUpDelay; + + /* + * The number of allowed unready nodes, irrespective of + * max-total-unready-percentage. This must be an integer. The default is 3. + */ + @JsonProperty(value = "ok-total-unready-count") + private String okTotalUnreadyCount; + + /* + * How often cluster is reevaluated for scale up or down. The default is + * '10'. Values must be an integer number of seconds. + */ + @JsonProperty(value = "scan-interval") + private String scanInterval; + + /* + * How long after scale up that scale down evaluation resumes The default + * is '10m'. Values must be an integer followed by an 'm'. No unit of time + * other than minutes (m) is supported. + */ + @JsonProperty(value = "scale-down-delay-after-add") + private String scaleDownDelayAfterAdd; + + /* + * How long after node deletion that scale down evaluation resumes. The + * default is the scan-interval. Values must be an integer followed by an + * 'm'. No unit of time other than minutes (m) is supported. + */ + @JsonProperty(value = "scale-down-delay-after-delete") + private String scaleDownDelayAfterDelete; + + /* + * How long after scale down failure that scale down evaluation resumes. + * The default is '3m'. Values must be an integer followed by an 'm'. No + * unit of time other than minutes (m) is supported. + */ + @JsonProperty(value = "scale-down-delay-after-failure") + private String scaleDownDelayAfterFailure; + + /* + * How long a node should be unneeded before it is eligible for scale down. + * The default is '10m'. Values must be an integer followed by an 'm'. No + * unit of time other than minutes (m) is supported. + */ + @JsonProperty(value = "scale-down-unneeded-time") + private String scaleDownUnneededTime; + + /* + * How long an unready node should be unneeded before it is eligible for + * scale down The default is '20m'. Values must be an integer followed by + * an 'm'. No unit of time other than minutes (m) is supported. + */ + @JsonProperty(value = "scale-down-unready-time") + private String scaleDownUnreadyTime; + + /* + * Node utilization level, defined as sum of requested resources divided by + * capacity, below which a node can be considered for scale down. The + * default is '0.5'. + */ + @JsonProperty(value = "scale-down-utilization-threshold") + private String scaleDownUtilizationThreshold; + + /* + * If cluster autoscaler will skip deleting nodes with pods with local + * storage, for example, EmptyDir or HostPath. The default is true. + */ + @JsonProperty(value = "skip-nodes-with-local-storage") + private String skipNodesWithLocalStorage; + + /* + * If cluster autoscaler will skip deleting nodes with pods from + * kube-system (except for DaemonSet or mirror pods) The default is true. + */ + @JsonProperty(value = "skip-nodes-with-system-pods") + private String skipNodesWithSystemPods; + + /** + * Get the balanceSimilarNodeGroups property: Detects similar node pools and balances the number of nodes between + * them. Valid values are 'true' and 'false'. + * + * @return the balanceSimilarNodeGroups value. + */ + public String balanceSimilarNodeGroups() { + return this.balanceSimilarNodeGroups; + } + + /** + * Set the balanceSimilarNodeGroups property: Detects similar node pools and balances the number of nodes between + * them. Valid values are 'true' and 'false'. + * + * @param balanceSimilarNodeGroups the balanceSimilarNodeGroups value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withBalanceSimilarNodeGroups(String balanceSimilarNodeGroups) { + this.balanceSimilarNodeGroups = balanceSimilarNodeGroups; + return this; + } + + /** + * Get the expander property: The expander to use when scaling up If not specified, the default is 'random'. See + * [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) + * for more information. + * + * @return the expander value. + */ + public Expander expander() { + return this.expander; + } + + /** + * Set the expander property: The expander to use when scaling up If not specified, the default is 'random'. See + * [expanders](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders) + * for more information. + * + * @param expander the expander value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withExpander(Expander expander) { + this.expander = expander; + return this; + } + + /** + * Get the maxEmptyBulkDelete property: The maximum number of empty nodes that can be deleted at the same time. This + * must be a positive integer. The default is 10. + * + * @return the maxEmptyBulkDelete value. + */ + public String maxEmptyBulkDelete() { + return this.maxEmptyBulkDelete; + } + + /** + * Set the maxEmptyBulkDelete property: The maximum number of empty nodes that can be deleted at the same time. This + * must be a positive integer. The default is 10. + * + * @param maxEmptyBulkDelete the maxEmptyBulkDelete value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withMaxEmptyBulkDelete(String maxEmptyBulkDelete) { + this.maxEmptyBulkDelete = maxEmptyBulkDelete; + return this; + } + + /** + * Get the maxGracefulTerminationSec property: The maximum number of seconds the cluster autoscaler waits for pod + * termination when trying to scale down a node. The default is 600. + * + * @return the maxGracefulTerminationSec value. + */ + public String maxGracefulTerminationSec() { + return this.maxGracefulTerminationSec; + } + + /** + * Set the maxGracefulTerminationSec property: The maximum number of seconds the cluster autoscaler waits for pod + * termination when trying to scale down a node. The default is 600. + * + * @param maxGracefulTerminationSec the maxGracefulTerminationSec value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withMaxGracefulTerminationSec(String maxGracefulTerminationSec) { + this.maxGracefulTerminationSec = maxGracefulTerminationSec; + return this; + } + + /** + * Get the maxNodeProvisionTime property: The maximum time the autoscaler waits for a node to be provisioned. The + * default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + * supported. + * + * @return the maxNodeProvisionTime value. + */ + public String maxNodeProvisionTime() { + return this.maxNodeProvisionTime; + } + + /** + * Set the maxNodeProvisionTime property: The maximum time the autoscaler waits for a node to be provisioned. The + * default is '15m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + * supported. + * + * @param maxNodeProvisionTime the maxNodeProvisionTime value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withMaxNodeProvisionTime(String maxNodeProvisionTime) { + this.maxNodeProvisionTime = maxNodeProvisionTime; + return this; + } + + /** + * Get the maxTotalUnreadyPercentage property: The maximum percentage of unready nodes in the cluster. After this + * percentage is exceeded, cluster autoscaler halts operations. The default is 45. The maximum is 100 and the + * minimum is 0. + * + * @return the maxTotalUnreadyPercentage value. + */ + public String maxTotalUnreadyPercentage() { + return this.maxTotalUnreadyPercentage; + } + + /** + * Set the maxTotalUnreadyPercentage property: The maximum percentage of unready nodes in the cluster. After this + * percentage is exceeded, cluster autoscaler halts operations. The default is 45. The maximum is 100 and the + * minimum is 0. + * + * @param maxTotalUnreadyPercentage the maxTotalUnreadyPercentage value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withMaxTotalUnreadyPercentage(String maxTotalUnreadyPercentage) { + this.maxTotalUnreadyPercentage = maxTotalUnreadyPercentage; + return this; + } + + /** + * Get the newPodScaleUpDelay property: Ignore unscheduled pods before they're a certain age. For scenarios like + * burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you + * can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an + * integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + * + * @return the newPodScaleUpDelay value. + */ + public String newPodScaleUpDelay() { + return this.newPodScaleUpDelay; + } + + /** + * Set the newPodScaleUpDelay property: Ignore unscheduled pods before they're a certain age. For scenarios like + * burst/batch scale where you don't want CA to act before the kubernetes scheduler could schedule all the pods, you + * can tell CA to ignore unscheduled pods before they're a certain age. The default is '0s'. Values must be an + * integer followed by a unit ('s' for seconds, 'm' for minutes, 'h' for hours, etc). + * + * @param newPodScaleUpDelay the newPodScaleUpDelay value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withNewPodScaleUpDelay(String newPodScaleUpDelay) { + this.newPodScaleUpDelay = newPodScaleUpDelay; + return this; + } + + /** + * Get the okTotalUnreadyCount property: The number of allowed unready nodes, irrespective of + * max-total-unready-percentage. This must be an integer. The default is 3. + * + * @return the okTotalUnreadyCount value. + */ + public String okTotalUnreadyCount() { + return this.okTotalUnreadyCount; + } + + /** + * Set the okTotalUnreadyCount property: The number of allowed unready nodes, irrespective of + * max-total-unready-percentage. This must be an integer. The default is 3. + * + * @param okTotalUnreadyCount the okTotalUnreadyCount value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withOkTotalUnreadyCount(String okTotalUnreadyCount) { + this.okTotalUnreadyCount = okTotalUnreadyCount; + return this; + } + + /** + * Get the scanInterval property: How often cluster is reevaluated for scale up or down. The default is '10'. Values + * must be an integer number of seconds. + * + * @return the scanInterval value. + */ + public String scanInterval() { + return this.scanInterval; + } + + /** + * Set the scanInterval property: How often cluster is reevaluated for scale up or down. The default is '10'. Values + * must be an integer number of seconds. + * + * @param scanInterval the scanInterval value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScanInterval(String scanInterval) { + this.scanInterval = scanInterval; + return this; + } + + /** + * Get the scaleDownDelayAfterAdd property: How long after scale up that scale down evaluation resumes The default + * is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + * + * @return the scaleDownDelayAfterAdd value. + */ + public String scaleDownDelayAfterAdd() { + return this.scaleDownDelayAfterAdd; + } + + /** + * Set the scaleDownDelayAfterAdd property: How long after scale up that scale down evaluation resumes The default + * is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is supported. + * + * @param scaleDownDelayAfterAdd the scaleDownDelayAfterAdd value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownDelayAfterAdd(String scaleDownDelayAfterAdd) { + this.scaleDownDelayAfterAdd = scaleDownDelayAfterAdd; + return this; + } + + /** + * Get the scaleDownDelayAfterDelete property: How long after node deletion that scale down evaluation resumes. The + * default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes + * (m) is supported. + * + * @return the scaleDownDelayAfterDelete value. + */ + public String scaleDownDelayAfterDelete() { + return this.scaleDownDelayAfterDelete; + } + + /** + * Set the scaleDownDelayAfterDelete property: How long after node deletion that scale down evaluation resumes. The + * default is the scan-interval. Values must be an integer followed by an 'm'. No unit of time other than minutes + * (m) is supported. + * + * @param scaleDownDelayAfterDelete the scaleDownDelayAfterDelete value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownDelayAfterDelete(String scaleDownDelayAfterDelete) { + this.scaleDownDelayAfterDelete = scaleDownDelayAfterDelete; + return this; + } + + /** + * Get the scaleDownDelayAfterFailure property: How long after scale down failure that scale down evaluation + * resumes. The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes + * (m) is supported. + * + * @return the scaleDownDelayAfterFailure value. + */ + public String scaleDownDelayAfterFailure() { + return this.scaleDownDelayAfterFailure; + } + + /** + * Set the scaleDownDelayAfterFailure property: How long after scale down failure that scale down evaluation + * resumes. The default is '3m'. Values must be an integer followed by an 'm'. No unit of time other than minutes + * (m) is supported. + * + * @param scaleDownDelayAfterFailure the scaleDownDelayAfterFailure value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownDelayAfterFailure(String scaleDownDelayAfterFailure) { + this.scaleDownDelayAfterFailure = scaleDownDelayAfterFailure; + return this; + } + + /** + * Get the scaleDownUnneededTime property: How long a node should be unneeded before it is eligible for scale down. + * The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + * supported. + * + * @return the scaleDownUnneededTime value. + */ + public String scaleDownUnneededTime() { + return this.scaleDownUnneededTime; + } + + /** + * Set the scaleDownUnneededTime property: How long a node should be unneeded before it is eligible for scale down. + * The default is '10m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + * supported. + * + * @param scaleDownUnneededTime the scaleDownUnneededTime value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownUnneededTime(String scaleDownUnneededTime) { + this.scaleDownUnneededTime = scaleDownUnneededTime; + return this; + } + + /** + * Get the scaleDownUnreadyTime property: How long an unready node should be unneeded before it is eligible for + * scale down The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes + * (m) is supported. + * + * @return the scaleDownUnreadyTime value. + */ + public String scaleDownUnreadyTime() { + return this.scaleDownUnreadyTime; + } + + /** + * Set the scaleDownUnreadyTime property: How long an unready node should be unneeded before it is eligible for + * scale down The default is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes + * (m) is supported. + * + * @param scaleDownUnreadyTime the scaleDownUnreadyTime value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownUnreadyTime(String scaleDownUnreadyTime) { + this.scaleDownUnreadyTime = scaleDownUnreadyTime; + return this; + } + + /** + * Get the scaleDownUtilizationThreshold property: Node utilization level, defined as sum of requested resources + * divided by capacity, below which a node can be considered for scale down. The default is '0.5'. + * + * @return the scaleDownUtilizationThreshold value. + */ + public String scaleDownUtilizationThreshold() { + return this.scaleDownUtilizationThreshold; + } + + /** + * Set the scaleDownUtilizationThreshold property: Node utilization level, defined as sum of requested resources + * divided by capacity, below which a node can be considered for scale down. The default is '0.5'. + * + * @param scaleDownUtilizationThreshold the scaleDownUtilizationThreshold value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withScaleDownUtilizationThreshold( + String scaleDownUtilizationThreshold) { + this.scaleDownUtilizationThreshold = scaleDownUtilizationThreshold; + return this; + } + + /** + * Get the skipNodesWithLocalStorage property: If cluster autoscaler will skip deleting nodes with pods with local + * storage, for example, EmptyDir or HostPath. The default is true. + * + * @return the skipNodesWithLocalStorage value. + */ + public String skipNodesWithLocalStorage() { + return this.skipNodesWithLocalStorage; + } + + /** + * Set the skipNodesWithLocalStorage property: If cluster autoscaler will skip deleting nodes with pods with local + * storage, for example, EmptyDir or HostPath. The default is true. + * + * @param skipNodesWithLocalStorage the skipNodesWithLocalStorage value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withSkipNodesWithLocalStorage(String skipNodesWithLocalStorage) { + this.skipNodesWithLocalStorage = skipNodesWithLocalStorage; + return this; + } + + /** + * Get the skipNodesWithSystemPods property: If cluster autoscaler will skip deleting nodes with pods from + * kube-system (except for DaemonSet or mirror pods) The default is true. + * + * @return the skipNodesWithSystemPods value. + */ + public String skipNodesWithSystemPods() { + return this.skipNodesWithSystemPods; + } + + /** + * Set the skipNodesWithSystemPods property: If cluster autoscaler will skip deleting nodes with pods from + * kube-system (except for DaemonSet or mirror pods) The default is true. + * + * @param skipNodesWithSystemPods the skipNodesWithSystemPods value to set. + * @return the ManagedClusterPropertiesAutoScalerProfile object itself. + */ + public ManagedClusterPropertiesAutoScalerProfile withSkipNodesWithSystemPods(String skipNodesWithSystemPods) { + this.skipNodesWithSystemPods = skipNodesWithSystemPods; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfile.java new file mode 100644 index 0000000000000..149d33206d5d7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfile.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.containerservice.generated.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; + +/** Security profile for the container service cluster. */ +@Fluent +public final class ManagedClusterSecurityProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterSecurityProfile.class); + + /* + * Azure Defender settings for the security profile. + */ + @JsonProperty(value = "azureDefender") + private ManagedClusterSecurityProfileAzureDefender azureDefender; + + /** + * Get the azureDefender property: Azure Defender settings for the security profile. + * + * @return the azureDefender value. + */ + public ManagedClusterSecurityProfileAzureDefender azureDefender() { + return this.azureDefender; + } + + /** + * Set the azureDefender property: Azure Defender settings for the security profile. + * + * @param azureDefender the azureDefender value to set. + * @return the ManagedClusterSecurityProfile object itself. + */ + public ManagedClusterSecurityProfile withAzureDefender(ManagedClusterSecurityProfileAzureDefender azureDefender) { + this.azureDefender = azureDefender; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureDefender() != null) { + azureDefender().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileAzureDefender.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileAzureDefender.java new file mode 100644 index 0000000000000..21543c2af3f82 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileAzureDefender.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Azure Defender settings for the security profile. */ +@Fluent +public final class ManagedClusterSecurityProfileAzureDefender { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterSecurityProfileAzureDefender.class); + + /* + * Whether to enable Azure Defender + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Resource ID of the Log Analytics workspace to be associated with Azure + * Defender. When Azure Defender is enabled, this field is required and + * must be a valid workspace resource ID. When Azure Defender is disabled, + * leave the field empty. + */ + @JsonProperty(value = "logAnalyticsWorkspaceResourceId") + private String logAnalyticsWorkspaceResourceId; + + /** + * Get the enabled property: Whether to enable Azure Defender. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable Azure Defender. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterSecurityProfileAzureDefender object itself. + */ + public ManagedClusterSecurityProfileAzureDefender withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the logAnalyticsWorkspaceResourceId property: Resource ID of the Log Analytics workspace to be associated + * with Azure Defender. When Azure Defender is enabled, this field is required and must be a valid workspace + * resource ID. When Azure Defender is disabled, leave the field empty. + * + * @return the logAnalyticsWorkspaceResourceId value. + */ + public String logAnalyticsWorkspaceResourceId() { + return this.logAnalyticsWorkspaceResourceId; + } + + /** + * Set the logAnalyticsWorkspaceResourceId property: Resource ID of the Log Analytics workspace to be associated + * with Azure Defender. When Azure Defender is enabled, this field is required and must be a valid workspace + * resource ID. When Azure Defender is disabled, leave the field empty. + * + * @param logAnalyticsWorkspaceResourceId the logAnalyticsWorkspaceResourceId value to set. + * @return the ManagedClusterSecurityProfileAzureDefender object itself. + */ + public ManagedClusterSecurityProfileAzureDefender withLogAnalyticsWorkspaceResourceId( + String logAnalyticsWorkspaceResourceId) { + this.logAnalyticsWorkspaceResourceId = logAnalyticsWorkspaceResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterServicePrincipalProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterServicePrincipalProfile.java new file mode 100644 index 0000000000000..aa658f3b750c4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterServicePrincipalProfile.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.containerservice.generated.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; + +/** Information about a service principal identity for the cluster to use for manipulating Azure APIs. */ +@Fluent +public final class ManagedClusterServicePrincipalProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterServicePrincipalProfile.class); + + /* + * The ID for the service principal. + */ + @JsonProperty(value = "clientId", required = true) + private String clientId; + + /* + * The secret password associated with the service principal in plain text. + */ + @JsonProperty(value = "secret") + private String secret; + + /** + * Get the clientId property: The ID for the service principal. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The ID for the service principal. + * + * @param clientId the clientId value to set. + * @return the ManagedClusterServicePrincipalProfile object itself. + */ + public ManagedClusterServicePrincipalProfile withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the secret property: The secret password associated with the service principal in plain text. + * + * @return the secret value. + */ + public String secret() { + return this.secret; + } + + /** + * Set the secret property: The secret password associated with the service principal in plain text. + * + * @param secret the secret value to set. + * @return the ManagedClusterServicePrincipalProfile object itself. + */ + public ManagedClusterServicePrincipalProfile withSecret(String secret) { + this.secret = secret; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clientId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clientId in model ManagedClusterServicePrincipalProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSku.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSku.java new file mode 100644 index 0000000000000..70c0be041fd33 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSku.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 SKU of a Managed Cluster. */ +@Fluent +public final class ManagedClusterSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterSku.class); + + /* + * The name of a managed cluster SKU. + */ + @JsonProperty(value = "name") + private ManagedClusterSkuName name; + + /* + * The tier of a managed cluster SKU. If not specified, the default is + * 'Free'. See [uptime + * SLA](https://docs.microsoft.com/azure/aks/uptime-sla) for more details. + */ + @JsonProperty(value = "tier") + private ManagedClusterSkuTier tier; + + /** + * Get the name property: The name of a managed cluster SKU. + * + * @return the name value. + */ + public ManagedClusterSkuName name() { + return this.name; + } + + /** + * Set the name property: The name of a managed cluster SKU. + * + * @param name the name value to set. + * @return the ManagedClusterSku object itself. + */ + public ManagedClusterSku withName(ManagedClusterSkuName name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The tier of a managed cluster SKU. If not specified, the default is 'Free'. See [uptime + * SLA](https://docs.microsoft.com/azure/aks/uptime-sla) for more details. + * + * @return the tier value. + */ + public ManagedClusterSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: The tier of a managed cluster SKU. If not specified, the default is 'Free'. See [uptime + * SLA](https://docs.microsoft.com/azure/aks/uptime-sla) for more details. + * + * @param tier the tier value to set. + * @return the ManagedClusterSku object itself. + */ + public ManagedClusterSku withTier(ManagedClusterSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSkuName.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSkuName.java new file mode 100644 index 0000000000000..44d13c8e0e4c2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSkuName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedClusterSkuName. */ +public final class ManagedClusterSkuName extends ExpandableStringEnum { + /** Static value Basic for ManagedClusterSkuName. */ + public static final ManagedClusterSkuName BASIC = fromString("Basic"); + + /** + * Creates or finds a ManagedClusterSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedClusterSkuName. + */ + @JsonCreator + public static ManagedClusterSkuName fromString(String name) { + return fromString(name, ManagedClusterSkuName.class); + } + + /** @return known ManagedClusterSkuName values. */ + public static Collection values() { + return values(ManagedClusterSkuName.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSkuTier.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSkuTier.java new file mode 100644 index 0000000000000..d22f78d080a89 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSkuTier.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedClusterSkuTier. */ +public final class ManagedClusterSkuTier extends ExpandableStringEnum { + /** Static value Paid for ManagedClusterSkuTier. */ + public static final ManagedClusterSkuTier PAID = fromString("Paid"); + + /** Static value Free for ManagedClusterSkuTier. */ + public static final ManagedClusterSkuTier FREE = fromString("Free"); + + /** + * Creates or finds a ManagedClusterSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedClusterSkuTier. + */ + @JsonCreator + public static ManagedClusterSkuTier fromString(String name) { + return fromString(name, ManagedClusterSkuTier.class); + } + + /** @return known ManagedClusterSkuTier values. */ + public static Collection values() { + return values(ManagedClusterSkuTier.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterUpgradeProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterUpgradeProfile.java new file mode 100644 index 0000000000000..491e2c70a5540 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterUpgradeProfile.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.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner; +import java.util.List; + +/** An immutable client-side representation of ManagedClusterUpgradeProfile. */ +public interface ManagedClusterUpgradeProfile { + /** + * Gets the id property: The ID of the upgrade profile. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the upgrade profile. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the upgrade profile. + * + * @return the type value. + */ + String type(); + + /** + * Gets the controlPlaneProfile property: The list of available upgrade versions for the control plane. + * + * @return the controlPlaneProfile value. + */ + ManagedClusterPoolUpgradeProfile controlPlaneProfile(); + + /** + * Gets the agentPoolProfiles property: The list of available upgrade versions for agent pools. + * + * @return the agentPoolProfiles value. + */ + List agentPoolProfiles(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterUpgradeProfileInner object. + * + * @return the inner object. + */ + ManagedClusterUpgradeProfileInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWindowsProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWindowsProfile.java new file mode 100644 index 0000000000000..3f45473e4b655 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWindowsProfile.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.containerservice.generated.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; + +/** Profile for Windows VMs in the managed cluster. */ +@Fluent +public final class ManagedClusterWindowsProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedClusterWindowsProfile.class); + + /* + * Specifies the name of the administrator account.

+ * **Restriction:** Cannot end in "."

**Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", + * "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", + * "aspnet", "backup", "console", "david", "guest", "john", "owner", + * "root", "server", "sql", "support", "support_388945a0", "sys", "test2", + * "test3", "user4", "user5".

**Minimum-length:** 1 character + *

**Max-length:** 20 characters + */ + @JsonProperty(value = "adminUsername", required = true) + private String adminUsername; + + /* + * Specifies the password of the administrator account.

+ * **Minimum-length:** 8 characters

**Max-length:** 123 characters + *

**Complexity requirements:** 3 out of 4 conditions below need + * to be fulfilled
Has lower characters
Has upper characters
+ * Has a digit
Has a special character (Regex match [\W_])

+ * **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", + * "iloveyou!" + */ + @JsonProperty(value = "adminPassword") + private String adminPassword; + + /* + * The license type to use for Windows VMs. See [Azure Hybrid User + * Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for + * more details. + */ + @JsonProperty(value = "licenseType") + private LicenseType licenseType; + + /* + * Whether to enable CSI proxy. For more details on CSI proxy, see the [CSI + * proxy GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + */ + @JsonProperty(value = "enableCSIProxy") + private Boolean enableCsiProxy; + + /** + * Get the adminUsername property: Specifies the name of the administrator account. <br><br> + * **Restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length:** 1 character + * <br><br> **Max-length:** 20 characters. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: Specifies the name of the administrator account. <br><br> + * **Restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", + * "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", + * "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", + * "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length:** 1 character + * <br><br> **Max-length:** 20 characters. + * + * @param adminUsername the adminUsername value to set. + * @return the ManagedClusterWindowsProfile object itself. + */ + public ManagedClusterWindowsProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length:** 8 characters <br><br> **Max-length:** 123 characters <br><br> + * **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters + * <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) + * <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length:** 8 characters <br><br> **Max-length:** 123 characters <br><br> + * **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters + * <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) + * <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", + * "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". + * + * @param adminPassword the adminPassword value to set. + * @return the ManagedClusterWindowsProfile object itself. + */ + public ManagedClusterWindowsProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the licenseType property: The license type to use for Windows VMs. See [Azure Hybrid User + * Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. + * + * @return the licenseType value. + */ + public LicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: The license type to use for Windows VMs. See [Azure Hybrid User + * Benefits](https://azure.microsoft.com/pricing/hybrid-benefit/faq/) for more details. + * + * @param licenseType the licenseType value to set. + * @return the ManagedClusterWindowsProfile object itself. + */ + public ManagedClusterWindowsProfile withLicenseType(LicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the enableCsiProxy property: Whether to enable CSI proxy. For more details on CSI proxy, see the [CSI proxy + * GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + * + * @return the enableCsiProxy value. + */ + public Boolean enableCsiProxy() { + return this.enableCsiProxy; + } + + /** + * Set the enableCsiProxy property: Whether to enable CSI proxy. For more details on CSI proxy, see the [CSI proxy + * GitHub repo](https://github.com/kubernetes-csi/csi-proxy). + * + * @param enableCsiProxy the enableCsiProxy value to set. + * @return the ManagedClusterWindowsProfile object itself. + */ + public ManagedClusterWindowsProfile withEnableCsiProxy(Boolean enableCsiProxy) { + this.enableCsiProxy = enableCsiProxy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (adminUsername() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adminUsername in model ManagedClusterWindowsProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusters.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusters.java new file mode 100644 index 0000000000000..15c9d779dd22d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusters.java @@ -0,0 +1,547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 supported OS options in the specified subscription. + * + * @param location The name of a supported Azure region. + * @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 supported OS options in the specified subscription. + */ + OSOptionProfile getOSOptions(String location); + + /** + * Gets supported OS options in the specified subscription. + * + * @param location The name of a supported Azure region. + * @param resourceType The resource type for which the OS options needs to be returned. + * @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 supported OS options in the specified subscription. + */ + Response getOSOptionsWithResponse(String location, String resourceType, Context context); + + /** + * Gets a list of managed clusters in the specified 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 a list of managed clusters in the specified subscription. + */ + PagedIterable list(); + + /** + * Gets a list of managed clusters in the specified 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 a list of managed clusters in the specified subscription. + */ + PagedIterable list(Context context); + + /** + * Lists managed clusters in the specified subscription and 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 the response from the List Managed Clusters operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists managed clusters in the specified subscription and 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 the response from the List Managed Clusters operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 upgrade profile of a managed cluster. + */ + ManagedClusterUpgradeProfile getUpgradeProfile(String resourceGroupName, String resourceName); + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 upgrade profile of a managed cluster. + */ + Response getUpgradeProfileWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * **WARNING**: This API will be deprecated. Instead use + * [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + * or + * [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + * . + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile 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 managed cluster Access Profile. + */ + ManagedClusterAccessProfile getAccessProfile(String resourceGroupName, String resourceName, String roleName); + + /** + * **WARNING**: This API will be deprecated. Instead use + * [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) + * or + * [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) + * . + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param roleName The name of the role for managed cluster accessProfile 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 managed cluster Access Profile. + */ + Response getAccessProfileWithResponse( + String resourceGroupName, String resourceName, String roleName, Context context); + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + CredentialResults listClusterAdminCredentials(String resourceGroupName, String resourceName); + + /** + * Lists the admin credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + Response listClusterAdminCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context); + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + CredentialResults listClusterUserCredentials(String resourceGroupName, String resourceName); + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + Response listClusterUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list credential result response. + */ + CredentialResults listClusterMonitoringUserCredentials(String resourceGroupName, String resourceName); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @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 credential result response. + */ + Response listClusterMonitoringUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context); + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 managed cluster. + */ + ManagedCluster getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 managed cluster. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName, Context context); + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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. + */ + void resetServicePrincipalProfile( + String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters); + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The service principal profile to set on the managed 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. + */ + void resetServicePrincipalProfile( + String resourceGroupName, + String resourceName, + ManagedClusterServicePrincipalProfile parameters, + Context context); + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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. + */ + void resetAadProfile(String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters); + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters The AAD profile to set on the Managed 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. + */ + void resetAadProfile( + String resourceGroupName, String resourceName, ManagedClusterAadProfile parameters, Context context); + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 rotateClusterCertificates(String resourceGroupName, String resourceName); + + /** + * See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about + * rotating managed cluster certificates. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 rotateClusterCertificates(String resourceGroupName, String resourceName, Context context); + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 stop(String resourceGroupName, String resourceName); + + /** + * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the + * control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue + * charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) + * for more details about stopping a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 stop(String resourceGroupName, String resourceName, Context context); + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 start(String resourceGroupName, String resourceName); + + /** + * See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting + * a cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 start(String resourceGroupName, String resourceName, Context context); + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + RunCommandResult runCommand(String resourceGroupName, String resourceName, RunCommandRequest requestPayload); + + /** + * AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see + * [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param requestPayload The run command request. + * @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 run command result. + */ + RunCommandResult runCommand( + String resourceGroupName, String resourceName, RunCommandRequest requestPayload, Context context); + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @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 results of a command which has been run on the Managed Cluster. + */ + RunCommandResult getCommandResult(String resourceGroupName, String resourceName, String commandId); + + /** + * Gets the results of a command which has been run on the Managed Cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param commandId Id of the command. + * @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 results of a command which has been run on the Managed Cluster. + */ + Response getCommandResultWithResponse( + String resourceGroupName, String resourceName, String commandId, Context context); + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. The operation returns properties of each egress endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + */ + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String resourceName); + + /** + * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. The operation returns properties of each egress endpoint. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed + * cluster. + */ + PagedIterable listOutboundNetworkDependenciesEndpoints( + String resourceGroupName, String resourceName, Context context); + + /** + * Gets a 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 managed cluster. + */ + ManagedCluster getById(String id); + + /** + * Gets a 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 managed cluster. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a 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); + + /** + * Deletes a 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 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedServiceIdentityUserAssignedIdentitiesValue.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedServiceIdentityUserAssignedIdentitiesValue.java new file mode 100644 index 0000000000000..911d3bbc7100a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedServiceIdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 ManagedServiceIdentityUserAssignedIdentitiesValue model. */ +@Immutable +public final class ManagedServiceIdentityUserAssignedIdentitiesValue { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ManagedServiceIdentityUserAssignedIdentitiesValue.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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkMode.java new file mode 100644 index 0000000000000..96a77765ee488 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkMode.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkMode. */ +public final class NetworkMode extends ExpandableStringEnum { + /** Static value transparent for NetworkMode. */ + public static final NetworkMode TRANSPARENT = fromString("transparent"); + + /** Static value bridge for NetworkMode. */ + public static final NetworkMode BRIDGE = fromString("bridge"); + + /** + * Creates or finds a NetworkMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkMode. + */ + @JsonCreator + public static NetworkMode fromString(String name) { + return fromString(name, NetworkMode.class); + } + + /** @return known NetworkMode values. */ + public static Collection values() { + return values(NetworkMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPlugin.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPlugin.java new file mode 100644 index 0000000000000..e3e82a0f633bf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPlugin.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkPlugin. */ +public final class NetworkPlugin extends ExpandableStringEnum { + /** Static value azure for NetworkPlugin. */ + public static final NetworkPlugin AZURE = fromString("azure"); + + /** Static value kubenet for NetworkPlugin. */ + public static final NetworkPlugin KUBENET = fromString("kubenet"); + + /** + * Creates or finds a NetworkPlugin from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkPlugin. + */ + @JsonCreator + public static NetworkPlugin fromString(String name) { + return fromString(name, NetworkPlugin.class); + } + + /** @return known NetworkPlugin values. */ + public static Collection values() { + return values(NetworkPlugin.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicy.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicy.java new file mode 100644 index 0000000000000..e0dfc819ae3e2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPolicy.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkPolicy. */ +public final class NetworkPolicy extends ExpandableStringEnum { + /** Static value calico for NetworkPolicy. */ + public static final NetworkPolicy CALICO = fromString("calico"); + + /** Static value azure for NetworkPolicy. */ + public static final NetworkPolicy AZURE = fromString("azure"); + + /** + * Creates or finds a NetworkPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkPolicy. + */ + @JsonCreator + public static NetworkPolicy fromString(String name) { + return fromString(name, NetworkPolicy.class); + } + + /** @return known NetworkPolicy values. */ + public static Collection values() { + return values(NetworkPolicy.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkProfile.java new file mode 100644 index 0000000000000..724f90ba2588f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkProfile.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Represents the OpenShift networking configuration. */ +@Fluent +public final class NetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfile.class); + + /* + * CIDR for the OpenShift Vnet. + */ + @JsonProperty(value = "vnetCidr") + private String vnetCidr; + + /* + * CIDR of the Vnet to peer. + */ + @JsonProperty(value = "peerVnetId") + private String peerVnetId; + + /* + * ID of the Vnet created for OSA cluster. + */ + @JsonProperty(value = "vnetId") + private String vnetId; + + /** + * Get the vnetCidr property: CIDR for the OpenShift Vnet. + * + * @return the vnetCidr value. + */ + public String vnetCidr() { + return this.vnetCidr; + } + + /** + * Set the vnetCidr property: CIDR for the OpenShift Vnet. + * + * @param vnetCidr the vnetCidr value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withVnetCidr(String vnetCidr) { + this.vnetCidr = vnetCidr; + return this; + } + + /** + * Get the peerVnetId property: CIDR of the Vnet to peer. + * + * @return the peerVnetId value. + */ + public String peerVnetId() { + return this.peerVnetId; + } + + /** + * Set the peerVnetId property: CIDR of the Vnet to peer. + * + * @param peerVnetId the peerVnetId value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withPeerVnetId(String peerVnetId) { + this.peerVnetId = peerVnetId; + return this; + } + + /** + * Get the vnetId property: ID of the Vnet created for OSA cluster. + * + * @return the vnetId value. + */ + public String vnetId() { + return this.vnetId; + } + + /** + * Set the vnetId property: ID of the Vnet created for OSA cluster. + * + * @param vnetId the vnetId value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withVnetId(String vnetId) { + this.vnetId = vnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSDiskType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSDiskType.java new file mode 100644 index 0000000000000..0d1731d31d888 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSDiskType.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OSDiskType. */ +public final class OSDiskType extends ExpandableStringEnum { + /** Static value Managed for OSDiskType. */ + public static final OSDiskType MANAGED = fromString("Managed"); + + /** Static value Ephemeral for OSDiskType. */ + public static final OSDiskType EPHEMERAL = fromString("Ephemeral"); + + /** + * Creates or finds a OSDiskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSDiskType. + */ + @JsonCreator + public static OSDiskType fromString(String name) { + return fromString(name, OSDiskType.class); + } + + /** @return known OSDiskType values. */ + public static Collection values() { + return values(OSDiskType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSOptionProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSOptionProfile.java new file mode 100644 index 0000000000000..0d13e6b5cc279 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSOptionProfile.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OSOptionProfileInner; +import java.util.List; + +/** An immutable client-side representation of OSOptionProfile. */ +public interface OSOptionProfile { + /** + * Gets the id property: The ID of the OS option resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the OS option resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the OS option resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the osOptionPropertyList property: The list of OS options. + * + * @return the osOptionPropertyList value. + */ + List osOptionPropertyList(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.OSOptionProfileInner object. + * + * @return the inner object. + */ + OSOptionProfileInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSOptionProperty.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSOptionProperty.java new file mode 100644 index 0000000000000..d7ad03e7fe035 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSOptionProperty.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.containerservice.generated.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; + +/** OS option property. */ +@Fluent +public final class OSOptionProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OSOptionProperty.class); + + /* + * The OS type. + */ + @JsonProperty(value = "os-type", required = true) + private String osType; + + /* + * Whether the image is FIPS-enabled. + */ + @JsonProperty(value = "enable-fips-image", required = true) + private boolean enableFipsImage; + + /** + * Get the osType property: The OS type. + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The OS type. + * + * @param osType the osType value to set. + * @return the OSOptionProperty object itself. + */ + public OSOptionProperty withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the enableFipsImage property: Whether the image is FIPS-enabled. + * + * @return the enableFipsImage value. + */ + public boolean enableFipsImage() { + return this.enableFipsImage; + } + + /** + * Set the enableFipsImage property: Whether the image is FIPS-enabled. + * + * @param enableFipsImage the enableFipsImage value to set. + * @return the OSOptionProperty object itself. + */ + public OSOptionProperty withEnableFipsImage(boolean enableFipsImage) { + this.enableFipsImage = enableFipsImage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property osType in model OSOptionProperty")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSType.java new file mode 100644 index 0000000000000..e7f60f8592d2b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSType.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OSType. */ +public final class OSType extends ExpandableStringEnum { + /** Static value Linux for OSType. */ + public static final OSType LINUX = fromString("Linux"); + + /** Static value Windows for OSType. */ + public static final OSType WINDOWS = fromString("Windows"); + + /** + * Creates or finds a OSType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSType. + */ + @JsonCreator + public static OSType fromString(String name) { + return fromString(name, OSType.class); + } + + /** @return known OSType values. */ + public static Collection values() { + return values(OSType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftAgentPoolProfileRole.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftAgentPoolProfileRole.java new file mode 100644 index 0000000000000..45cb003f86cd4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftAgentPoolProfileRole.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OpenShiftAgentPoolProfileRole. */ +public final class OpenShiftAgentPoolProfileRole extends ExpandableStringEnum { + /** Static value compute for OpenShiftAgentPoolProfileRole. */ + public static final OpenShiftAgentPoolProfileRole COMPUTE = fromString("compute"); + + /** Static value infra for OpenShiftAgentPoolProfileRole. */ + public static final OpenShiftAgentPoolProfileRole INFRA = fromString("infra"); + + /** + * Creates or finds a OpenShiftAgentPoolProfileRole from its string representation. + * + * @param name a name to look for. + * @return the corresponding OpenShiftAgentPoolProfileRole. + */ + @JsonCreator + public static OpenShiftAgentPoolProfileRole fromString(String name) { + return fromString(name, OpenShiftAgentPoolProfileRole.class); + } + + /** @return known OpenShiftAgentPoolProfileRole values. */ + public static Collection values() { + return values(OpenShiftAgentPoolProfileRole.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftContainerServiceVMSize.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftContainerServiceVMSize.java new file mode 100644 index 0000000000000..18977483f5d7f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftContainerServiceVMSize.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OpenShiftContainerServiceVMSize. */ +public final class OpenShiftContainerServiceVMSize extends ExpandableStringEnum { + /** Static value Standard_D2s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_D2S_V3 = fromString("Standard_D2s_v3"); + + /** Static value Standard_D4s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_D4S_V3 = fromString("Standard_D4s_v3"); + + /** Static value Standard_D8s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_D8S_V3 = fromString("Standard_D8s_v3"); + + /** Static value Standard_D16s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_D16S_V3 = fromString("Standard_D16s_v3"); + + /** Static value Standard_D32s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_D32S_V3 = fromString("Standard_D32s_v3"); + + /** Static value Standard_D64s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_D64S_V3 = fromString("Standard_D64s_v3"); + + /** Static value Standard_DS4_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_DS4_V2 = fromString("Standard_DS4_v2"); + + /** Static value Standard_DS5_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_DS5_V2 = fromString("Standard_DS5_v2"); + + /** Static value Standard_F8s_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_F8S_V2 = fromString("Standard_F8s_v2"); + + /** Static value Standard_F16s_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_F16S_V2 = fromString("Standard_F16s_v2"); + + /** Static value Standard_F32s_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_F32S_V2 = fromString("Standard_F32s_v2"); + + /** Static value Standard_F64s_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_F64S_V2 = fromString("Standard_F64s_v2"); + + /** Static value Standard_F72s_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_F72S_V2 = fromString("Standard_F72s_v2"); + + /** Static value Standard_F8s for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_F8S = fromString("Standard_F8s"); + + /** Static value Standard_F16s for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_F16S = fromString("Standard_F16s"); + + /** Static value Standard_E4s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_E4S_V3 = fromString("Standard_E4s_v3"); + + /** Static value Standard_E8s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_E8S_V3 = fromString("Standard_E8s_v3"); + + /** Static value Standard_E16s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_E16S_V3 = fromString("Standard_E16s_v3"); + + /** Static value Standard_E20s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_E20S_V3 = fromString("Standard_E20s_v3"); + + /** Static value Standard_E32s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_E32S_V3 = fromString("Standard_E32s_v3"); + + /** Static value Standard_E64s_v3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_E64S_V3 = fromString("Standard_E64s_v3"); + + /** Static value Standard_GS2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_GS2 = fromString("Standard_GS2"); + + /** Static value Standard_GS3 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_GS3 = fromString("Standard_GS3"); + + /** Static value Standard_GS4 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_GS4 = fromString("Standard_GS4"); + + /** Static value Standard_GS5 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_GS5 = fromString("Standard_GS5"); + + /** Static value Standard_DS12_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_DS12_V2 = fromString("Standard_DS12_v2"); + + /** Static value Standard_DS13_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_DS13_V2 = fromString("Standard_DS13_v2"); + + /** Static value Standard_DS14_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_DS14_V2 = fromString("Standard_DS14_v2"); + + /** Static value Standard_DS15_v2 for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_DS15_V2 = fromString("Standard_DS15_v2"); + + /** Static value Standard_L4s for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_L4S = fromString("Standard_L4s"); + + /** Static value Standard_L8s for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_L8S = fromString("Standard_L8s"); + + /** Static value Standard_L16s for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_L16S = fromString("Standard_L16s"); + + /** Static value Standard_L32s for OpenShiftContainerServiceVMSize. */ + public static final OpenShiftContainerServiceVMSize STANDARD_L32S = fromString("Standard_L32s"); + + /** + * Creates or finds a OpenShiftContainerServiceVMSize from its string representation. + * + * @param name a name to look for. + * @return the corresponding OpenShiftContainerServiceVMSize. + */ + @JsonCreator + public static OpenShiftContainerServiceVMSize fromString(String name) { + return fromString(name, OpenShiftContainerServiceVMSize.class); + } + + /** @return known OpenShiftContainerServiceVMSize values. */ + public static Collection values() { + return values(OpenShiftContainerServiceVMSize.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedCluster.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedCluster.java new file mode 100644 index 0000000000000..53b26cad69d7d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedCluster.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OpenShiftManagedClusterInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of OpenShiftManagedCluster. */ +public interface OpenShiftManagedCluster { + /** + * 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 plan property: Define the resource plan as required by ARM for billing purposes. + * + * @return the plan value. + */ + PurchasePlan plan(); + + /** + * Gets the provisioningState property: The current deployment or provisioning state, which only appears in the + * response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the openShiftVersion property: Version of OpenShift specified when creating the cluster. + * + * @return the openShiftVersion value. + */ + String openShiftVersion(); + + /** + * Gets the clusterVersion property: Version of OpenShift specified when creating the cluster. + * + * @return the clusterVersion value. + */ + String clusterVersion(); + + /** + * Gets the publicHostname property: Service generated FQDN for OpenShift API server. + * + * @return the publicHostname value. + */ + String publicHostname(); + + /** + * Gets the fqdn property: Service generated FQDN for OpenShift API server loadbalancer internal hostname. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the networkProfile property: Configuration for OpenShift networking. + * + * @return the networkProfile value. + */ + NetworkProfile networkProfile(); + + /** + * Gets the routerProfiles property: Configuration for OpenShift router(s). + * + * @return the routerProfiles value. + */ + List routerProfiles(); + + /** + * Gets the masterPoolProfile property: Configuration for OpenShift master VMs. + * + * @return the masterPoolProfile value. + */ + OpenShiftManagedClusterMasterPoolProfile masterPoolProfile(); + + /** + * Gets the agentPoolProfiles property: Configuration of OpenShift cluster VMs. + * + * @return the agentPoolProfiles value. + */ + List agentPoolProfiles(); + + /** + * Gets the authProfile property: Configures OpenShift authentication. + * + * @return the authProfile value. + */ + OpenShiftManagedClusterAuthProfile authProfile(); + + /** + * 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.containerservice.generated.fluent.models.OpenShiftManagedClusterInner + * object. + * + * @return the inner object. + */ + OpenShiftManagedClusterInner innerModel(); + + /** The entirety of the OpenShiftManagedCluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The OpenShiftManagedCluster definition stages. */ + interface DefinitionStages { + /** The first stage of the OpenShiftManagedCluster definition. */ + interface Blank extends WithLocation { + } + /** The stage of the OpenShiftManagedCluster 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 OpenShiftManagedCluster 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 OpenShiftManagedCluster 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.WithPlan, + DefinitionStages.WithOpenShiftVersion, + DefinitionStages.WithNetworkProfile, + DefinitionStages.WithRouterProfiles, + DefinitionStages.WithMasterPoolProfile, + DefinitionStages.WithAgentPoolProfiles, + DefinitionStages.WithAuthProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + OpenShiftManagedCluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OpenShiftManagedCluster create(Context context); + } + /** The stage of the OpenShiftManagedCluster 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 OpenShiftManagedCluster definition allowing to specify plan. */ + interface WithPlan { + /** + * Specifies the plan property: Define the resource plan as required by ARM for billing purposes. + * + * @param plan Define the resource plan as required by ARM for billing purposes. + * @return the next definition stage. + */ + WithCreate withPlan(PurchasePlan plan); + } + /** The stage of the OpenShiftManagedCluster definition allowing to specify openShiftVersion. */ + interface WithOpenShiftVersion { + /** + * Specifies the openShiftVersion property: Version of OpenShift specified when creating the cluster.. + * + * @param openShiftVersion Version of OpenShift specified when creating the cluster. + * @return the next definition stage. + */ + WithCreate withOpenShiftVersion(String openShiftVersion); + } + /** The stage of the OpenShiftManagedCluster definition allowing to specify networkProfile. */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: Configuration for OpenShift networking.. + * + * @param networkProfile Configuration for OpenShift networking. + * @return the next definition stage. + */ + WithCreate withNetworkProfile(NetworkProfile networkProfile); + } + /** The stage of the OpenShiftManagedCluster definition allowing to specify routerProfiles. */ + interface WithRouterProfiles { + /** + * Specifies the routerProfiles property: Configuration for OpenShift router(s).. + * + * @param routerProfiles Configuration for OpenShift router(s). + * @return the next definition stage. + */ + WithCreate withRouterProfiles(List routerProfiles); + } + /** The stage of the OpenShiftManagedCluster definition allowing to specify masterPoolProfile. */ + interface WithMasterPoolProfile { + /** + * Specifies the masterPoolProfile property: Configuration for OpenShift master VMs.. + * + * @param masterPoolProfile Configuration for OpenShift master VMs. + * @return the next definition stage. + */ + WithCreate withMasterPoolProfile(OpenShiftManagedClusterMasterPoolProfile masterPoolProfile); + } + /** The stage of the OpenShiftManagedCluster definition allowing to specify agentPoolProfiles. */ + interface WithAgentPoolProfiles { + /** + * Specifies the agentPoolProfiles property: Configuration of OpenShift cluster VMs.. + * + * @param agentPoolProfiles Configuration of OpenShift cluster VMs. + * @return the next definition stage. + */ + WithCreate withAgentPoolProfiles(List agentPoolProfiles); + } + /** The stage of the OpenShiftManagedCluster definition allowing to specify authProfile. */ + interface WithAuthProfile { + /** + * Specifies the authProfile property: Configures OpenShift authentication.. + * + * @param authProfile Configures OpenShift authentication. + * @return the next definition stage. + */ + WithCreate withAuthProfile(OpenShiftManagedClusterAuthProfile authProfile); + } + } + /** + * Begins update for the OpenShiftManagedCluster resource. + * + * @return the stage of resource update. + */ + OpenShiftManagedCluster.Update update(); + + /** The template for OpenShiftManagedCluster update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OpenShiftManagedCluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OpenShiftManagedCluster apply(Context context); + } + /** The OpenShiftManagedCluster update stages. */ + interface UpdateStages { + /** The stage of the OpenShiftManagedCluster update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OpenShiftManagedCluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OpenShiftManagedCluster refresh(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAadIdentityProvider.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAadIdentityProvider.java new file mode 100644 index 0000000000000..a46a2860e2122 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAadIdentityProvider.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the Identity provider for MS AAD. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AADIdentityProvider") +@Fluent +public final class OpenShiftManagedClusterAadIdentityProvider extends OpenShiftManagedClusterBaseIdentityProvider { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterAadIdentityProvider.class); + + /* + * The clientId password associated with the provider. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The secret password associated with the provider. + */ + @JsonProperty(value = "secret") + private String secret; + + /* + * The tenantId associated with the provider. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * The groupId to be granted cluster admin role. + */ + @JsonProperty(value = "customerAdminGroupId") + private String customerAdminGroupId; + + /** + * Get the clientId property: The clientId password associated with the provider. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The clientId password associated with the provider. + * + * @param clientId the clientId value to set. + * @return the OpenShiftManagedClusterAadIdentityProvider object itself. + */ + public OpenShiftManagedClusterAadIdentityProvider withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the secret property: The secret password associated with the provider. + * + * @return the secret value. + */ + public String secret() { + return this.secret; + } + + /** + * Set the secret property: The secret password associated with the provider. + * + * @param secret the secret value to set. + * @return the OpenShiftManagedClusterAadIdentityProvider object itself. + */ + public OpenShiftManagedClusterAadIdentityProvider withSecret(String secret) { + this.secret = secret; + return this; + } + + /** + * Get the tenantId property: The tenantId associated with the provider. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenantId associated with the provider. + * + * @param tenantId the tenantId value to set. + * @return the OpenShiftManagedClusterAadIdentityProvider object itself. + */ + public OpenShiftManagedClusterAadIdentityProvider withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the customerAdminGroupId property: The groupId to be granted cluster admin role. + * + * @return the customerAdminGroupId value. + */ + public String customerAdminGroupId() { + return this.customerAdminGroupId; + } + + /** + * Set the customerAdminGroupId property: The groupId to be granted cluster admin role. + * + * @param customerAdminGroupId the customerAdminGroupId value to set. + * @return the OpenShiftManagedClusterAadIdentityProvider object itself. + */ + public OpenShiftManagedClusterAadIdentityProvider withCustomerAdminGroupId(String customerAdminGroupId) { + this.customerAdminGroupId = customerAdminGroupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAgentPoolProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAgentPoolProfile.java new file mode 100644 index 0000000000000..a656e33f95d1e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAgentPoolProfile.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Defines the configuration of the OpenShift cluster VMs. */ +@Fluent +public final class OpenShiftManagedClusterAgentPoolProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterAgentPoolProfile.class); + + /* + * Unique name of the pool profile in the context of the subscription and + * resource group. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Number of agents (VMs) to host docker containers. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * Size of agent VMs. + */ + @JsonProperty(value = "vmSize", required = true) + private OpenShiftContainerServiceVMSize vmSize; + + /* + * Subnet CIDR for the peering. + */ + @JsonProperty(value = "subnetCidr") + private String subnetCidr; + + /* + * OsType to be used to specify os type. Choose from Linux and Windows. + * Default to Linux. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /* + * Define the role of the AgentPoolProfile. + */ + @JsonProperty(value = "role") + private OpenShiftAgentPoolProfileRole role; + + /** + * Get the name property: Unique name of the pool profile in the context of the subscription and resource group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Unique name of the pool profile in the context of the subscription and resource group. + * + * @param name the name value to set. + * @return the OpenShiftManagedClusterAgentPoolProfile object itself. + */ + public OpenShiftManagedClusterAgentPoolProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the count property: Number of agents (VMs) to host docker containers. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: Number of agents (VMs) to host docker containers. + * + * @param count the count value to set. + * @return the OpenShiftManagedClusterAgentPoolProfile object itself. + */ + public OpenShiftManagedClusterAgentPoolProfile withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the vmSize property: Size of agent VMs. + * + * @return the vmSize value. + */ + public OpenShiftContainerServiceVMSize vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: Size of agent VMs. + * + * @param vmSize the vmSize value to set. + * @return the OpenShiftManagedClusterAgentPoolProfile object itself. + */ + public OpenShiftManagedClusterAgentPoolProfile withVmSize(OpenShiftContainerServiceVMSize vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the subnetCidr property: Subnet CIDR for the peering. + * + * @return the subnetCidr value. + */ + public String subnetCidr() { + return this.subnetCidr; + } + + /** + * Set the subnetCidr property: Subnet CIDR for the peering. + * + * @param subnetCidr the subnetCidr value to set. + * @return the OpenShiftManagedClusterAgentPoolProfile object itself. + */ + public OpenShiftManagedClusterAgentPoolProfile withSubnetCidr(String subnetCidr) { + this.subnetCidr = subnetCidr; + return this; + } + + /** + * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @param osType the osType value to set. + * @return the OpenShiftManagedClusterAgentPoolProfile object itself. + */ + public OpenShiftManagedClusterAgentPoolProfile withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the role property: Define the role of the AgentPoolProfile. + * + * @return the role value. + */ + public OpenShiftAgentPoolProfileRole role() { + return this.role; + } + + /** + * Set the role property: Define the role of the AgentPoolProfile. + * + * @param role the role value to set. + * @return the OpenShiftManagedClusterAgentPoolProfile object itself. + */ + public OpenShiftManagedClusterAgentPoolProfile withRole(OpenShiftAgentPoolProfileRole role) { + this.role = role; + 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 OpenShiftManagedClusterAgentPoolProfile")); + } + if (vmSize() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmSize in model OpenShiftManagedClusterAgentPoolProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAuthProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAuthProfile.java new file mode 100644 index 0000000000000..d73e4128e6d24 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAuthProfile.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Defines all possible authentication profiles for the OpenShift cluster. */ +@Fluent +public final class OpenShiftManagedClusterAuthProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterAuthProfile.class); + + /* + * Type of authentication profile to use. + */ + @JsonProperty(value = "identityProviders") + private List identityProviders; + + /** + * Get the identityProviders property: Type of authentication profile to use. + * + * @return the identityProviders value. + */ + public List identityProviders() { + return this.identityProviders; + } + + /** + * Set the identityProviders property: Type of authentication profile to use. + * + * @param identityProviders the identityProviders value to set. + * @return the OpenShiftManagedClusterAuthProfile object itself. + */ + public OpenShiftManagedClusterAuthProfile withIdentityProviders( + List identityProviders) { + this.identityProviders = identityProviders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identityProviders() != null) { + identityProviders().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterBaseIdentityProvider.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterBaseIdentityProvider.java new file mode 100644 index 0000000000000..55d0b1447aa1d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterBaseIdentityProvider.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Structure for any Identity provider. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "kind", + defaultImpl = OpenShiftManagedClusterBaseIdentityProvider.class) +@JsonTypeName("OpenShiftManagedClusterBaseIdentityProvider") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AADIdentityProvider", value = OpenShiftManagedClusterAadIdentityProvider.class) +}) +@Immutable +public class OpenShiftManagedClusterBaseIdentityProvider { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterBaseIdentityProvider.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterIdentityProvider.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterIdentityProvider.java new file mode 100644 index 0000000000000..3bb5eb7e19162 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterIdentityProvider.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Defines the configuration of the identity providers to be used in the OpenShift cluster. */ +@Fluent +public final class OpenShiftManagedClusterIdentityProvider { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterIdentityProvider.class); + + /* + * Name of the provider. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Configuration of the provider. + */ + @JsonProperty(value = "provider") + private OpenShiftManagedClusterBaseIdentityProvider provider; + + /** + * Get the name property: Name of the provider. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the provider. + * + * @param name the name value to set. + * @return the OpenShiftManagedClusterIdentityProvider object itself. + */ + public OpenShiftManagedClusterIdentityProvider withName(String name) { + this.name = name; + return this; + } + + /** + * Get the provider property: Configuration of the provider. + * + * @return the provider value. + */ + public OpenShiftManagedClusterBaseIdentityProvider provider() { + return this.provider; + } + + /** + * Set the provider property: Configuration of the provider. + * + * @param provider the provider value to set. + * @return the OpenShiftManagedClusterIdentityProvider object itself. + */ + public OpenShiftManagedClusterIdentityProvider withProvider(OpenShiftManagedClusterBaseIdentityProvider provider) { + this.provider = provider; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provider() != null) { + provider().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterListResult.java new file mode 100644 index 0000000000000..39a42b7af01cb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OpenShiftManagedClusterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List OpenShift Managed Clusters operation. */ +@Fluent +public final class OpenShiftManagedClusterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterListResult.class); + + /* + * The list of OpenShift managed clusters. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of OpenShift managed cluster results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of OpenShift managed clusters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of OpenShift managed clusters. + * + * @param value the value value to set. + * @return the OpenShiftManagedClusterListResult object itself. + */ + public OpenShiftManagedClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of OpenShift managed cluster results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterMasterPoolProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterMasterPoolProfile.java new file mode 100644 index 0000000000000..94c2776611fa5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterMasterPoolProfile.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** OpenShiftManagedClusterMaterPoolProfile contains configuration for OpenShift master VMs. */ +@Fluent +public final class OpenShiftManagedClusterMasterPoolProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftManagedClusterMasterPoolProfile.class); + + /* + * Unique name of the master pool profile in the context of the + * subscription and resource group. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Number of masters (VMs) to host docker containers. The default value is + * 3. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * Size of agent VMs. + */ + @JsonProperty(value = "vmSize", required = true) + private OpenShiftContainerServiceVMSize vmSize; + + /* + * Subnet CIDR for the peering. + */ + @JsonProperty(value = "subnetCidr") + private String subnetCidr; + + /* + * OsType to be used to specify os type. Choose from Linux and Windows. + * Default to Linux. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /** + * Get the name property: Unique name of the master pool profile in the context of the subscription and resource + * group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Unique name of the master pool profile in the context of the subscription and resource + * group. + * + * @param name the name value to set. + * @return the OpenShiftManagedClusterMasterPoolProfile object itself. + */ + public OpenShiftManagedClusterMasterPoolProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the count property: Number of masters (VMs) to host docker containers. The default value is 3. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: Number of masters (VMs) to host docker containers. The default value is 3. + * + * @param count the count value to set. + * @return the OpenShiftManagedClusterMasterPoolProfile object itself. + */ + public OpenShiftManagedClusterMasterPoolProfile withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the vmSize property: Size of agent VMs. + * + * @return the vmSize value. + */ + public OpenShiftContainerServiceVMSize vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: Size of agent VMs. + * + * @param vmSize the vmSize value to set. + * @return the OpenShiftManagedClusterMasterPoolProfile object itself. + */ + public OpenShiftManagedClusterMasterPoolProfile withVmSize(OpenShiftContainerServiceVMSize vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the subnetCidr property: Subnet CIDR for the peering. + * + * @return the subnetCidr value. + */ + public String subnetCidr() { + return this.subnetCidr; + } + + /** + * Set the subnetCidr property: Subnet CIDR for the peering. + * + * @param subnetCidr the subnetCidr value to set. + * @return the OpenShiftManagedClusterMasterPoolProfile object itself. + */ + public OpenShiftManagedClusterMasterPoolProfile withSubnetCidr(String subnetCidr) { + this.subnetCidr = subnetCidr; + return this; + } + + /** + * Get the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the osType property: OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * + * @param osType the osType value to set. + * @return the OpenShiftManagedClusterMasterPoolProfile object itself. + */ + public OpenShiftManagedClusterMasterPoolProfile withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmSize() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmSize in model OpenShiftManagedClusterMasterPoolProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusters.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusters.java new file mode 100644 index 0000000000000..9fedce3249c14 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusters.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 OpenShiftManagedClusters. */ +public interface OpenShiftManagedClusters { + /** + * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each + * OpenShift managed cluster. + * + * @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 list of OpenShift managed clusters in the specified subscription. + */ + PagedIterable list(); + + /** + * Gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of each + * OpenShift managed 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 a list of OpenShift managed clusters in the specified subscription. + */ + PagedIterable list(Context context); + + /** + * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns + * properties of each OpenShift managed cluster. + * + * @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 the response from the List OpenShift Managed Clusters operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists OpenShift managed clusters in the specified subscription and resource group. The operation returns + * properties of each OpenShift managed cluster. + * + * @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 the response from the List OpenShift Managed Clusters operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 details of the managed OpenShift cluster with a specified resource group and name. + */ + OpenShiftManagedCluster getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 details of the managed OpenShift cluster with a specified resource group and name. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName); + + /** + * Deletes the OpenShift managed cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the OpenShift managed 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 resourceName, Context context); + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and 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. + * @return the details of the managed OpenShift cluster with a specified resource group and name. + */ + OpenShiftManagedCluster getById(String id); + + /** + * Gets the details of the managed OpenShift cluster with a specified resource group and 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. + * @return the details of the managed OpenShift cluster with a specified resource group and name. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the OpenShift managed cluster with a specified resource group and 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); + + /** + * Deletes the OpenShift managed cluster with a specified resource group and 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 OpenShiftManagedCluster resource. + * + * @param name resource name. + * @return the first stage of the new OpenShiftManagedCluster definition. + */ + OpenShiftManagedCluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftRouterProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftRouterProfile.java new file mode 100644 index 0000000000000..93c680fe3d871 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftRouterProfile.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Represents an OpenShift router. */ +@Fluent +public final class OpenShiftRouterProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenShiftRouterProfile.class); + + /* + * Name of the router profile. + */ + @JsonProperty(value = "name") + private String name; + + /* + * DNS subdomain for OpenShift router. + */ + @JsonProperty(value = "publicSubdomain", access = JsonProperty.Access.WRITE_ONLY) + private String publicSubdomain; + + /* + * Auto-allocated FQDN for the OpenShift router. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * Get the name property: Name of the router profile. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the router profile. + * + * @param name the name value to set. + * @return the OpenShiftRouterProfile object itself. + */ + public OpenShiftRouterProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publicSubdomain property: DNS subdomain for OpenShift router. + * + * @return the publicSubdomain value. + */ + public String publicSubdomain() { + return this.publicSubdomain; + } + + /** + * Get the fqdn property: Auto-allocated FQDN for the OpenShift router. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..9ef0eef359236 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationListResult.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.containerservice.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Operation response. */ +@Immutable +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * The list of operations + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get the value property: The list of operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationValue.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationValue.java new file mode 100644 index 0000000000000..34591dc400672 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationValue.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; + +/** An immutable client-side representation of OperationValue. */ +public interface OperationValue { + /** + * Gets the origin property: The origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the name property: The name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the operation property: The display name of the operation. + * + * @return the operation value. + */ + String operation(); + + /** + * Gets the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + String resource(); + + /** + * Gets the description property: The description of the operation. + * + * @return the description value. + */ + String description(); + + /** + * Gets the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + String provider(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner object. + * + * @return the inner object. + */ + OperationValueInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Operations.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Operations.java new file mode 100644 index 0000000000000..9399e4e3df11a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Gets a list of 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 a list of operations. + */ + PagedIterable list(); + + /** + * Gets a list of 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 a list of operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorProfile.java new file mode 100644 index 0000000000000..ed85c2d0b8391 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorProfile.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Contains information about orchestrator. */ +@Fluent +public final class OrchestratorProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorProfile.class); + + /* + * Orchestrator type. + */ + @JsonProperty(value = "orchestratorType") + private String orchestratorType; + + /* + * Orchestrator version (major, minor, patch). + */ + @JsonProperty(value = "orchestratorVersion", required = true) + private String orchestratorVersion; + + /* + * Whether Kubernetes version is currently in preview. + */ + @JsonProperty(value = "isPreview") + private Boolean isPreview; + + /** + * Get the orchestratorType property: Orchestrator type. + * + * @return the orchestratorType value. + */ + public String orchestratorType() { + return this.orchestratorType; + } + + /** + * Set the orchestratorType property: Orchestrator type. + * + * @param orchestratorType the orchestratorType value to set. + * @return the OrchestratorProfile object itself. + */ + public OrchestratorProfile withOrchestratorType(String orchestratorType) { + this.orchestratorType = orchestratorType; + return this; + } + + /** + * Get the orchestratorVersion property: Orchestrator version (major, minor, patch). + * + * @return the orchestratorVersion value. + */ + public String orchestratorVersion() { + return this.orchestratorVersion; + } + + /** + * Set the orchestratorVersion property: Orchestrator version (major, minor, patch). + * + * @param orchestratorVersion the orchestratorVersion value to set. + * @return the OrchestratorProfile object itself. + */ + public OrchestratorProfile withOrchestratorVersion(String orchestratorVersion) { + this.orchestratorVersion = orchestratorVersion; + return this; + } + + /** + * Get the isPreview property: Whether Kubernetes version is currently in preview. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Whether Kubernetes version is currently in preview. + * + * @param isPreview the isPreview value to set. + * @return the OrchestratorProfile object itself. + */ + public OrchestratorProfile withIsPreview(Boolean isPreview) { + this.isPreview = isPreview; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (orchestratorVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property orchestratorVersion in model OrchestratorProfile")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorVersionProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorVersionProfile.java new file mode 100644 index 0000000000000..67de1e5951c3e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorVersionProfile.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** The profile of an orchestrator and its available versions. */ +@Fluent +public final class OrchestratorVersionProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorVersionProfile.class); + + /* + * Orchestrator type. + */ + @JsonProperty(value = "orchestratorType", required = true) + private String orchestratorType; + + /* + * Orchestrator version (major, minor, patch). + */ + @JsonProperty(value = "orchestratorVersion", required = true) + private String orchestratorVersion; + + /* + * Installed by default if version is not specified. + */ + @JsonProperty(value = "default") + private Boolean defaultProperty; + + /* + * Whether Kubernetes version is currently in preview. + */ + @JsonProperty(value = "isPreview") + private Boolean isPreview; + + /* + * The list of available upgrade versions. + */ + @JsonProperty(value = "upgrades") + private List upgrades; + + /** + * Get the orchestratorType property: Orchestrator type. + * + * @return the orchestratorType value. + */ + public String orchestratorType() { + return this.orchestratorType; + } + + /** + * Set the orchestratorType property: Orchestrator type. + * + * @param orchestratorType the orchestratorType value to set. + * @return the OrchestratorVersionProfile object itself. + */ + public OrchestratorVersionProfile withOrchestratorType(String orchestratorType) { + this.orchestratorType = orchestratorType; + return this; + } + + /** + * Get the orchestratorVersion property: Orchestrator version (major, minor, patch). + * + * @return the orchestratorVersion value. + */ + public String orchestratorVersion() { + return this.orchestratorVersion; + } + + /** + * Set the orchestratorVersion property: Orchestrator version (major, minor, patch). + * + * @param orchestratorVersion the orchestratorVersion value to set. + * @return the OrchestratorVersionProfile object itself. + */ + public OrchestratorVersionProfile withOrchestratorVersion(String orchestratorVersion) { + this.orchestratorVersion = orchestratorVersion; + return this; + } + + /** + * Get the defaultProperty property: Installed by default if version is not specified. + * + * @return the defaultProperty value. + */ + public Boolean defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Installed by default if version is not specified. + * + * @param defaultProperty the defaultProperty value to set. + * @return the OrchestratorVersionProfile object itself. + */ + public OrchestratorVersionProfile withDefaultProperty(Boolean defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the isPreview property: Whether Kubernetes version is currently in preview. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Whether Kubernetes version is currently in preview. + * + * @param isPreview the isPreview value to set. + * @return the OrchestratorVersionProfile object itself. + */ + public OrchestratorVersionProfile withIsPreview(Boolean isPreview) { + this.isPreview = isPreview; + return this; + } + + /** + * Get the upgrades property: The list of available upgrade versions. + * + * @return the upgrades value. + */ + public List upgrades() { + return this.upgrades; + } + + /** + * Set the upgrades property: The list of available upgrade versions. + * + * @param upgrades the upgrades value to set. + * @return the OrchestratorVersionProfile object itself. + */ + public OrchestratorVersionProfile withUpgrades(List upgrades) { + this.upgrades = upgrades; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (orchestratorType() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property orchestratorType in model OrchestratorVersionProfile")); + } + if (orchestratorVersion() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property orchestratorVersion in model OrchestratorVersionProfile")); + } + if (upgrades() != null) { + upgrades().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorVersionProfileListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorVersionProfileListResult.java new file mode 100644 index 0000000000000..dc7a396e96e24 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorVersionProfileListResult.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OrchestratorVersionProfileListResultInner; +import java.util.List; + +/** An immutable client-side representation of OrchestratorVersionProfileListResult. */ +public interface OrchestratorVersionProfileListResult { + /** + * Gets the id property: Id of the orchestrator version profile list result. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the orchestrator version profile list result. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: Type of the orchestrator version profile list result. + * + * @return the type value. + */ + String type(); + + /** + * Gets the orchestrators property: List of orchestrator version profiles. + * + * @return the orchestrators value. + */ + List orchestrators(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.OrchestratorVersionProfileListResultInner + * object. + * + * @return the inner object. + */ + OrchestratorVersionProfileListResultInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Ossku.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Ossku.java new file mode 100644 index 0000000000000..01a3f191cdddf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Ossku.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Ossku. */ +public final class Ossku extends ExpandableStringEnum { + /** Static value Ubuntu for Ossku. */ + public static final Ossku UBUNTU = fromString("Ubuntu"); + + /** Static value CBLMariner for Ossku. */ + public static final Ossku CBLMARINER = fromString("CBLMariner"); + + /** + * Creates or finds a Ossku from its string representation. + * + * @param name a name to look for. + * @return the corresponding Ossku. + */ + @JsonCreator + public static Ossku fromString(String name) { + return fromString(name, Ossku.class); + } + + /** @return known Ossku values. */ + public static Collection values() { + return values(Ossku.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpoint.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpoint.java new file mode 100644 index 0000000000000..1540bda9951fc --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpoint.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.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import java.util.List; + +/** An immutable client-side representation of OutboundEnvironmentEndpoint. */ +public interface OutboundEnvironmentEndpoint { + /** + * Gets the category property: The category of endpoints accessed by the AKS agent node, e.g. + * azure-resource-management, apiserver, etc. + * + * @return the category value. + */ + String category(); + + /** + * Gets the endpoints property: The endpoints that AKS agent nodes connect to. + * + * @return the endpoints value. + */ + List endpoints(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner object. + * + * @return the inner object. + */ + OutboundEnvironmentEndpointInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpointCollection.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpointCollection.java new file mode 100644 index 0000000000000..f0d41ee12d0e4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpointCollection.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.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OutboundEnvironmentEndpointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of OutboundEnvironmentEndpoint. */ +@Fluent +public final class OutboundEnvironmentEndpointCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OutboundEnvironmentEndpointCollection.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the OutboundEnvironmentEndpointCollection object itself. + */ + public OutboundEnvironmentEndpointCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model OutboundEnvironmentEndpointCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundType.java new file mode 100644 index 0000000000000..c24e1e81481ad --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundType.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OutboundType. */ +public final class OutboundType extends ExpandableStringEnum { + /** Static value loadBalancer for OutboundType. */ + public static final OutboundType LOAD_BALANCER = fromString("loadBalancer"); + + /** Static value userDefinedRouting for OutboundType. */ + public static final OutboundType USER_DEFINED_ROUTING = fromString("userDefinedRouting"); + + /** Static value managedNATGateway for OutboundType. */ + public static final OutboundType MANAGED_NATGATEWAY = fromString("managedNATGateway"); + + /** Static value userAssignedNATGateway for OutboundType. */ + public static final OutboundType USER_ASSIGNED_NATGATEWAY = fromString("userAssignedNATGateway"); + + /** + * Creates or finds a OutboundType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OutboundType. + */ + @JsonCreator + public static OutboundType fromString(String name) { + return fromString(name, OutboundType.class); + } + + /** @return known OutboundType values. */ + public static Collection values() { + return values(OutboundType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PowerState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PowerState.java new file mode 100644 index 0000000000000..ca6cd2a91498f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PowerState.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.containerservice.generated.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 the Power State of the cluster. */ +@Fluent +public final class PowerState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PowerState.class); + + /* + * Tells whether the cluster is Running or Stopped + */ + @JsonProperty(value = "code") + private Code code; + + /** + * Get the code property: Tells whether the cluster is Running or Stopped. + * + * @return the code value. + */ + public Code code() { + return this.code; + } + + /** + * Set the code property: Tells whether the cluster is Running or Stopped. + * + * @param code the code value to set. + * @return the PowerState object itself. + */ + public PowerState withCode(Code code) { + this.code = code; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpoint.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..00652b92945f8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpoint.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.containerservice.generated.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; + +/** Private endpoint which a connection belongs to. */ +@Fluent +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * The resource ID of the private endpoint + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The resource ID of the private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource ID of the private endpoint. + * + * @param id the id value to set. + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnection.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..44ca3652ad007 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnection.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * 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 provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..aaf6176e1e743 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateEndpointConnectionListResult. */ +public interface PrivateEndpointConnectionListResult { + /** + * Gets the value property: The collection value. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionListResultInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionListResultInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionProvisioningState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..3bd309730afcb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointConnectionProvisioningState. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** @return known PrivateEndpointConnectionProvisioningState values. */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnections.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..d4c0f584879d9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpointConnections.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.containerservice.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private endpoint connections. + */ + PrivateEndpointConnectionListResult list(String resourceGroupName, String resourceName); + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private endpoint connections. + */ + Response listWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + PrivateEndpointConnection get(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 private endpoint connection. + */ + Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @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 private endpoint connection. + */ + PrivateEndpointConnection update( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param parameters The updated private endpoint connection. + * @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 private endpoint connection. + */ + Response updateWithResponse( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param privateEndpointConnectionName The name of the private endpoint connection. + * @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 resourceName, String privateEndpointConnectionName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResource.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..9f4cbe8dd6457 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResource.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the id property: The ID of the private link resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the private link resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The resource type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the groupId property: The group ID of the resource. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The RequiredMembers of the resource. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the privateLinkServiceId property: The private link service ID of the resource, this field is exposed only + * to NRP internally. + * + * @return the privateLinkServiceId value. + */ + String privateLinkServiceId(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner + * object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResources.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..145baa16c358d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResources.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.containerservice.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private link resources. + */ + PrivateLinkResourcesListResult list(String resourceGroupName, String resourceName); + + /** + * To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 list of private link resources. + */ + Response listWithResponse( + String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResourcesListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResourcesListResult.java new file mode 100644 index 0000000000000..822a373d3e708 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkResourcesListResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResourcesListResult. */ +public interface PrivateLinkResourcesListResult { + /** + * Gets the value property: The collection value. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourcesListResultInner object. + * + * @return the inner object. + */ + PrivateLinkResourcesListResultInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkServiceConnectionState.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..82fee76c7fbb0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 state of a private link service connection. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * The private link service connection status. + */ + @JsonProperty(value = "status") + private ConnectionStatus status; + + /* + * The private link service connection description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the status property: The private link service connection status. + * + * @return the status value. + */ + public ConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: The private link service connection status. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(ConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The private link service connection description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The private link service connection description. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PublicNetworkAccess.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..745fa3b58f997 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PublicNetworkAccess.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccess. */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** @return known PublicNetworkAccess values. */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PurchasePlan.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PurchasePlan.java new file mode 100644 index 0000000000000..97cdbcf954651 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PurchasePlan.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ +@Fluent +public final class PurchasePlan { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PurchasePlan.class); + + /* + * The plan ID. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Specifies the product of the image from the marketplace. This is the + * same value as Offer under the imageReference element. + */ + @JsonProperty(value = "product") + private String product; + + /* + * The promotion code. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /* + * The plan ID. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * Get the name property: The plan ID. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The plan ID. + * + * @param name the name value to set. + * @return the PurchasePlan object itself. + */ + public PurchasePlan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the product property: Specifies the product of the image from the marketplace. This is the same value as + * Offer under the imageReference element. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: Specifies the product of the image from the marketplace. This is the same value as + * Offer under the imageReference element. + * + * @param product the product value to set. + * @return the PurchasePlan object itself. + */ + public PurchasePlan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: The promotion code. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: The promotion code. + * + * @param promotionCode the promotionCode value to set. + * @return the PurchasePlan object itself. + */ + public PurchasePlan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the publisher property: The plan ID. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The plan ID. + * + * @param publisher the publisher value to set. + * @return the PurchasePlan object itself. + */ + public PurchasePlan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResolvePrivateLinkServiceIds.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResolvePrivateLinkServiceIds.java new file mode 100644 index 0000000000000..93d1aed28da44 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResolvePrivateLinkServiceIds.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.containerservice.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; + +/** Resource collection API of ResolvePrivateLinkServiceIds. */ +public interface ResolvePrivateLinkServiceIds { + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service 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 the private link service ID for the specified managed cluster. + */ + PrivateLinkResource post(String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters); + + /** + * Gets the private link service ID for the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters required in order to resolve a private link service 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 the private link service ID for the specified managed cluster. + */ + Response postWithResponse( + String resourceGroupName, String resourceName, PrivateLinkResourceInner parameters, Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceIdentityType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..18045311ffc63 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceIdentityType.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.containerservice.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceReference.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceReference.java new file mode 100644 index 0000000000000..d009d56804ce0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceReference.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.containerservice.generated.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; + +/** A reference to an Azure resource. */ +@Fluent +public final class ResourceReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceReference.class); + + /* + * The fully qualified Azure resource id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: The fully qualified Azure resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The fully qualified Azure resource id. + * + * @param id the id value to set. + * @return the ResourceReference object itself. + */ + public ResourceReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandRequest.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandRequest.java new file mode 100644 index 0000000000000..ebb77fadd7d44 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandRequest.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** A run command request. */ +@Fluent +public final class RunCommandRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RunCommandRequest.class); + + /* + * The command to run. + */ + @JsonProperty(value = "command", required = true) + private String command; + + /* + * A base64 encoded zip file containing the files required by the command. + */ + @JsonProperty(value = "context") + private String context; + + /* + * AuthToken issued for AKS AAD Server App. + */ + @JsonProperty(value = "clusterToken") + private String clusterToken; + + /** + * Get the command property: The command to run. + * + * @return the command value. + */ + public String command() { + return this.command; + } + + /** + * Set the command property: The command to run. + * + * @param command the command value to set. + * @return the RunCommandRequest object itself. + */ + public RunCommandRequest withCommand(String command) { + this.command = command; + return this; + } + + /** + * Get the context property: A base64 encoded zip file containing the files required by the command. + * + * @return the context value. + */ + public String context() { + return this.context; + } + + /** + * Set the context property: A base64 encoded zip file containing the files required by the command. + * + * @param context the context value to set. + * @return the RunCommandRequest object itself. + */ + public RunCommandRequest withContext(String context) { + this.context = context; + return this; + } + + /** + * Get the clusterToken property: AuthToken issued for AKS AAD Server App. + * + * @return the clusterToken value. + */ + public String clusterToken() { + return this.clusterToken; + } + + /** + * Set the clusterToken property: AuthToken issued for AKS AAD Server App. + * + * @param clusterToken the clusterToken value to set. + * @return the RunCommandRequest object itself. + */ + public RunCommandRequest withClusterToken(String clusterToken) { + this.clusterToken = clusterToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (command() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property command in model RunCommandRequest")); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandResult.java new file mode 100644 index 0000000000000..b91ba884ad2c7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandResult.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RunCommandResult. */ +public interface RunCommandResult { + /** + * Gets the id property: The command id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the provisioningState property: provisioning State. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the exitCode property: The exit code of the command. + * + * @return the exitCode value. + */ + Integer exitCode(); + + /** + * Gets the startedAt property: The time when the command started. + * + * @return the startedAt value. + */ + OffsetDateTime startedAt(); + + /** + * Gets the finishedAt property: The time when the command finished. + * + * @return the finishedAt value. + */ + OffsetDateTime finishedAt(); + + /** + * Gets the logs property: The command output. + * + * @return the logs value. + */ + String logs(); + + /** + * Gets the reason property: An explanation of why provisioningState is set to failed (if so). + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the inner com.azure.resourcemanager.containerservice.generated.fluent.models.RunCommandResultInner object. + * + * @return the inner object. + */ + RunCommandResultInner innerModel(); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleDownMode.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleDownMode.java new file mode 100644 index 0000000000000..1d1685070fffb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleDownMode.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScaleDownMode. */ +public final class ScaleDownMode extends ExpandableStringEnum { + /** Static value Delete for ScaleDownMode. */ + public static final ScaleDownMode DELETE = fromString("Delete"); + + /** Static value Deallocate for ScaleDownMode. */ + public static final ScaleDownMode DEALLOCATE = fromString("Deallocate"); + + /** + * Creates or finds a ScaleDownMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScaleDownMode. + */ + @JsonCreator + public static ScaleDownMode fromString(String name) { + return fromString(name, ScaleDownMode.class); + } + + /** @return known ScaleDownMode values. */ + public static Collection values() { + return values(ScaleDownMode.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetEvictionPolicy.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetEvictionPolicy.java new file mode 100644 index 0000000000000..d99e0b38d2a65 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetEvictionPolicy.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScaleSetEvictionPolicy. */ +public final class ScaleSetEvictionPolicy extends ExpandableStringEnum { + /** Static value Delete for ScaleSetEvictionPolicy. */ + public static final ScaleSetEvictionPolicy DELETE = fromString("Delete"); + + /** Static value Deallocate for ScaleSetEvictionPolicy. */ + public static final ScaleSetEvictionPolicy DEALLOCATE = fromString("Deallocate"); + + /** + * Creates or finds a ScaleSetEvictionPolicy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScaleSetEvictionPolicy. + */ + @JsonCreator + public static ScaleSetEvictionPolicy fromString(String name) { + return fromString(name, ScaleSetEvictionPolicy.class); + } + + /** @return known ScaleSetEvictionPolicy values. */ + public static Collection values() { + return values(ScaleSetEvictionPolicy.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetPriority.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetPriority.java new file mode 100644 index 0000000000000..9df208fa1c9be --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ScaleSetPriority.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.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScaleSetPriority. */ +public final class ScaleSetPriority extends ExpandableStringEnum { + /** Static value Spot for ScaleSetPriority. */ + public static final ScaleSetPriority SPOT = fromString("Spot"); + + /** Static value Regular for ScaleSetPriority. */ + public static final ScaleSetPriority REGULAR = fromString("Regular"); + + /** + * Creates or finds a ScaleSetPriority from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScaleSetPriority. + */ + @JsonCreator + public static ScaleSetPriority fromString(String name) { + return fromString(name, ScaleSetPriority.class); + } + + /** @return known ScaleSetPriority values. */ + public static Collection values() { + return values(ScaleSetPriority.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshot.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshot.java new file mode 100644 index 0000000000000..7ff71a96c23e0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshot.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import java.util.Map; + +/** An immutable client-side representation of Snapshot. */ +public interface Snapshot { + /** + * 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 systemData property: The system metadata relating to this snapshot. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the creationData property: CreationData to be used to specify the source agent pool resource ID to create + * this snapshot. + * + * @return the creationData value. + */ + CreationData creationData(); + + /** + * Gets the snapshotType property: The type of a snapshot. The default is NodePool. + * + * @return the snapshotType value. + */ + SnapshotType snapshotType(); + + /** + * 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.containerservice.generated.fluent.models.SnapshotInner object. + * + * @return the inner object. + */ + SnapshotInner innerModel(); + + /** The entirety of the Snapshot definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Snapshot definition stages. */ + interface DefinitionStages { + /** The first stage of the Snapshot definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Snapshot 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 Snapshot 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 Snapshot 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.WithCreationData, DefinitionStages.WithSnapshotType { + /** + * Executes the create request. + * + * @return the created resource. + */ + Snapshot create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Snapshot create(Context context); + } + /** The stage of the Snapshot 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 Snapshot definition allowing to specify creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: CreationData to be used to specify the source agent pool resource ID + * to create this snapshot.. + * + * @param creationData CreationData to be used to specify the source agent pool resource ID to create this + * snapshot. + * @return the next definition stage. + */ + WithCreate withCreationData(CreationData creationData); + } + /** The stage of the Snapshot definition allowing to specify snapshotType. */ + interface WithSnapshotType { + /** + * Specifies the snapshotType property: The type of a snapshot. The default is NodePool.. + * + * @param snapshotType The type of a snapshot. The default is NodePool. + * @return the next definition stage. + */ + WithCreate withSnapshotType(SnapshotType snapshotType); + } + } + /** + * Begins update for the Snapshot resource. + * + * @return the stage of resource update. + */ + Snapshot.Update update(); + + /** The template for Snapshot update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Snapshot apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Snapshot apply(Context context); + } + /** The Snapshot update stages. */ + interface UpdateStages { + /** The stage of the Snapshot update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Snapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Snapshot refresh(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotListResult.java new file mode 100644 index 0000000000000..71f117c75abca --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Snapshots operation. */ +@Fluent +public final class SnapshotListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SnapshotListResult.class); + + /* + * The list of snapshots. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of snapshot results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of snapshots. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of snapshots. + * + * @param value the value value to set. + * @return the SnapshotListResult object itself. + */ + public SnapshotListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of snapshot results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotType.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotType.java new file mode 100644 index 0000000000000..383a8687cf4c9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SnapshotType. */ +public final class SnapshotType extends ExpandableStringEnum { + /** Static value NodePool for SnapshotType. */ + public static final SnapshotType NODE_POOL = fromString("NodePool"); + + /** + * Creates or finds a SnapshotType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SnapshotType. + */ + @JsonCreator + public static SnapshotType fromString(String name) { + return fromString(name, SnapshotType.class); + } + + /** @return known SnapshotType values. */ + public static Collection values() { + return values(SnapshotType.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshots.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshots.java new file mode 100644 index 0000000000000..26171de88d119 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshots.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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 Snapshots. */ +public interface Snapshots { + /** + * Gets a list of snapshots in the specified 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 a list of snapshots in the specified subscription. + */ + PagedIterable list(); + + /** + * Gets a list of snapshots in the specified 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 a list of snapshots in the specified subscription. + */ + PagedIterable list(Context context); + + /** + * Lists snapshots in the specified subscription and 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 the response from the List Snapshots operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists snapshots in the specified subscription and 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 the response from the List Snapshots operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 snapshot. + */ + Snapshot getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 snapshot. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 resourceName); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. + * @param resourceName The name of the managed 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 response. + */ + Response deleteWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Gets a snapshot. + * + * @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 snapshot. + */ + Snapshot getById(String id); + + /** + * Gets a snapshot. + * + * @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 snapshot. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a snapshot. + * + * @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); + + /** + * Deletes a snapshot. + * + * @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 the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Snapshot resource. + * + * @param name resource name. + * @return the first stage of the new Snapshot definition. + */ + Snapshot.DefinitionStages.Blank define(String name); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SysctlConfig.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SysctlConfig.java new file mode 100644 index 0000000000000..14c631379be29 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SysctlConfig.java @@ -0,0 +1,752 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Sysctl settings for Linux agent nodes. */ +@Fluent +public final class SysctlConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SysctlConfig.class); + + /* + * Sysctl setting net.core.somaxconn. + */ + @JsonProperty(value = "netCoreSomaxconn") + private Integer netCoreSomaxconn; + + /* + * Sysctl setting net.core.netdev_max_backlog. + */ + @JsonProperty(value = "netCoreNetdevMaxBacklog") + private Integer netCoreNetdevMaxBacklog; + + /* + * Sysctl setting net.core.rmem_default. + */ + @JsonProperty(value = "netCoreRmemDefault") + private Integer netCoreRmemDefault; + + /* + * Sysctl setting net.core.rmem_max. + */ + @JsonProperty(value = "netCoreRmemMax") + private Integer netCoreRmemMax; + + /* + * Sysctl setting net.core.wmem_default. + */ + @JsonProperty(value = "netCoreWmemDefault") + private Integer netCoreWmemDefault; + + /* + * Sysctl setting net.core.wmem_max. + */ + @JsonProperty(value = "netCoreWmemMax") + private Integer netCoreWmemMax; + + /* + * Sysctl setting net.core.optmem_max. + */ + @JsonProperty(value = "netCoreOptmemMax") + private Integer netCoreOptmemMax; + + /* + * Sysctl setting net.ipv4.tcp_max_syn_backlog. + */ + @JsonProperty(value = "netIpv4TcpMaxSynBacklog") + private Integer netIpv4TcpMaxSynBacklog; + + /* + * Sysctl setting net.ipv4.tcp_max_tw_buckets. + */ + @JsonProperty(value = "netIpv4TcpMaxTwBuckets") + private Integer netIpv4TcpMaxTwBuckets; + + /* + * Sysctl setting net.ipv4.tcp_fin_timeout. + */ + @JsonProperty(value = "netIpv4TcpFinTimeout") + private Integer netIpv4TcpFinTimeout; + + /* + * Sysctl setting net.ipv4.tcp_keepalive_time. + */ + @JsonProperty(value = "netIpv4TcpKeepaliveTime") + private Integer netIpv4TcpKeepaliveTime; + + /* + * Sysctl setting net.ipv4.tcp_keepalive_probes. + */ + @JsonProperty(value = "netIpv4TcpKeepaliveProbes") + private Integer netIpv4TcpKeepaliveProbes; + + /* + * Sysctl setting net.ipv4.tcp_keepalive_intvl. + */ + @JsonProperty(value = "netIpv4TcpkeepaliveIntvl") + private Integer netIpv4TcpkeepaliveIntvl; + + /* + * Sysctl setting net.ipv4.tcp_tw_reuse. + */ + @JsonProperty(value = "netIpv4TcpTwReuse") + private Boolean netIpv4TcpTwReuse; + + /* + * Sysctl setting net.ipv4.ip_local_port_range. + */ + @JsonProperty(value = "netIpv4IpLocalPortRange") + private String netIpv4IpLocalPortRange; + + /* + * Sysctl setting net.ipv4.neigh.default.gc_thresh1. + */ + @JsonProperty(value = "netIpv4NeighDefaultGcThresh1") + private Integer netIpv4NeighDefaultGcThresh1; + + /* + * Sysctl setting net.ipv4.neigh.default.gc_thresh2. + */ + @JsonProperty(value = "netIpv4NeighDefaultGcThresh2") + private Integer netIpv4NeighDefaultGcThresh2; + + /* + * Sysctl setting net.ipv4.neigh.default.gc_thresh3. + */ + @JsonProperty(value = "netIpv4NeighDefaultGcThresh3") + private Integer netIpv4NeighDefaultGcThresh3; + + /* + * Sysctl setting net.netfilter.nf_conntrack_max. + */ + @JsonProperty(value = "netNetfilterNfConntrackMax") + private Integer netNetfilterNfConntrackMax; + + /* + * Sysctl setting net.netfilter.nf_conntrack_buckets. + */ + @JsonProperty(value = "netNetfilterNfConntrackBuckets") + private Integer netNetfilterNfConntrackBuckets; + + /* + * Sysctl setting fs.inotify.max_user_watches. + */ + @JsonProperty(value = "fsInotifyMaxUserWatches") + private Integer fsInotifyMaxUserWatches; + + /* + * Sysctl setting fs.file-max. + */ + @JsonProperty(value = "fsFileMax") + private Integer fsFileMax; + + /* + * Sysctl setting fs.aio-max-nr. + */ + @JsonProperty(value = "fsAioMaxNr") + private Integer fsAioMaxNr; + + /* + * Sysctl setting fs.nr_open. + */ + @JsonProperty(value = "fsNrOpen") + private Integer fsNrOpen; + + /* + * Sysctl setting kernel.threads-max. + */ + @JsonProperty(value = "kernelThreadsMax") + private Integer kernelThreadsMax; + + /* + * Sysctl setting vm.max_map_count. + */ + @JsonProperty(value = "vmMaxMapCount") + private Integer vmMaxMapCount; + + /* + * Sysctl setting vm.swappiness. + */ + @JsonProperty(value = "vmSwappiness") + private Integer vmSwappiness; + + /* + * Sysctl setting vm.vfs_cache_pressure. + */ + @JsonProperty(value = "vmVfsCachePressure") + private Integer vmVfsCachePressure; + + /** + * Get the netCoreSomaxconn property: Sysctl setting net.core.somaxconn. + * + * @return the netCoreSomaxconn value. + */ + public Integer netCoreSomaxconn() { + return this.netCoreSomaxconn; + } + + /** + * Set the netCoreSomaxconn property: Sysctl setting net.core.somaxconn. + * + * @param netCoreSomaxconn the netCoreSomaxconn value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreSomaxconn(Integer netCoreSomaxconn) { + this.netCoreSomaxconn = netCoreSomaxconn; + return this; + } + + /** + * Get the netCoreNetdevMaxBacklog property: Sysctl setting net.core.netdev_max_backlog. + * + * @return the netCoreNetdevMaxBacklog value. + */ + public Integer netCoreNetdevMaxBacklog() { + return this.netCoreNetdevMaxBacklog; + } + + /** + * Set the netCoreNetdevMaxBacklog property: Sysctl setting net.core.netdev_max_backlog. + * + * @param netCoreNetdevMaxBacklog the netCoreNetdevMaxBacklog value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreNetdevMaxBacklog(Integer netCoreNetdevMaxBacklog) { + this.netCoreNetdevMaxBacklog = netCoreNetdevMaxBacklog; + return this; + } + + /** + * Get the netCoreRmemDefault property: Sysctl setting net.core.rmem_default. + * + * @return the netCoreRmemDefault value. + */ + public Integer netCoreRmemDefault() { + return this.netCoreRmemDefault; + } + + /** + * Set the netCoreRmemDefault property: Sysctl setting net.core.rmem_default. + * + * @param netCoreRmemDefault the netCoreRmemDefault value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreRmemDefault(Integer netCoreRmemDefault) { + this.netCoreRmemDefault = netCoreRmemDefault; + return this; + } + + /** + * Get the netCoreRmemMax property: Sysctl setting net.core.rmem_max. + * + * @return the netCoreRmemMax value. + */ + public Integer netCoreRmemMax() { + return this.netCoreRmemMax; + } + + /** + * Set the netCoreRmemMax property: Sysctl setting net.core.rmem_max. + * + * @param netCoreRmemMax the netCoreRmemMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreRmemMax(Integer netCoreRmemMax) { + this.netCoreRmemMax = netCoreRmemMax; + return this; + } + + /** + * Get the netCoreWmemDefault property: Sysctl setting net.core.wmem_default. + * + * @return the netCoreWmemDefault value. + */ + public Integer netCoreWmemDefault() { + return this.netCoreWmemDefault; + } + + /** + * Set the netCoreWmemDefault property: Sysctl setting net.core.wmem_default. + * + * @param netCoreWmemDefault the netCoreWmemDefault value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreWmemDefault(Integer netCoreWmemDefault) { + this.netCoreWmemDefault = netCoreWmemDefault; + return this; + } + + /** + * Get the netCoreWmemMax property: Sysctl setting net.core.wmem_max. + * + * @return the netCoreWmemMax value. + */ + public Integer netCoreWmemMax() { + return this.netCoreWmemMax; + } + + /** + * Set the netCoreWmemMax property: Sysctl setting net.core.wmem_max. + * + * @param netCoreWmemMax the netCoreWmemMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreWmemMax(Integer netCoreWmemMax) { + this.netCoreWmemMax = netCoreWmemMax; + return this; + } + + /** + * Get the netCoreOptmemMax property: Sysctl setting net.core.optmem_max. + * + * @return the netCoreOptmemMax value. + */ + public Integer netCoreOptmemMax() { + return this.netCoreOptmemMax; + } + + /** + * Set the netCoreOptmemMax property: Sysctl setting net.core.optmem_max. + * + * @param netCoreOptmemMax the netCoreOptmemMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetCoreOptmemMax(Integer netCoreOptmemMax) { + this.netCoreOptmemMax = netCoreOptmemMax; + return this; + } + + /** + * Get the netIpv4TcpMaxSynBacklog property: Sysctl setting net.ipv4.tcp_max_syn_backlog. + * + * @return the netIpv4TcpMaxSynBacklog value. + */ + public Integer netIpv4TcpMaxSynBacklog() { + return this.netIpv4TcpMaxSynBacklog; + } + + /** + * Set the netIpv4TcpMaxSynBacklog property: Sysctl setting net.ipv4.tcp_max_syn_backlog. + * + * @param netIpv4TcpMaxSynBacklog the netIpv4TcpMaxSynBacklog value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpMaxSynBacklog(Integer netIpv4TcpMaxSynBacklog) { + this.netIpv4TcpMaxSynBacklog = netIpv4TcpMaxSynBacklog; + return this; + } + + /** + * Get the netIpv4TcpMaxTwBuckets property: Sysctl setting net.ipv4.tcp_max_tw_buckets. + * + * @return the netIpv4TcpMaxTwBuckets value. + */ + public Integer netIpv4TcpMaxTwBuckets() { + return this.netIpv4TcpMaxTwBuckets; + } + + /** + * Set the netIpv4TcpMaxTwBuckets property: Sysctl setting net.ipv4.tcp_max_tw_buckets. + * + * @param netIpv4TcpMaxTwBuckets the netIpv4TcpMaxTwBuckets value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpMaxTwBuckets(Integer netIpv4TcpMaxTwBuckets) { + this.netIpv4TcpMaxTwBuckets = netIpv4TcpMaxTwBuckets; + return this; + } + + /** + * Get the netIpv4TcpFinTimeout property: Sysctl setting net.ipv4.tcp_fin_timeout. + * + * @return the netIpv4TcpFinTimeout value. + */ + public Integer netIpv4TcpFinTimeout() { + return this.netIpv4TcpFinTimeout; + } + + /** + * Set the netIpv4TcpFinTimeout property: Sysctl setting net.ipv4.tcp_fin_timeout. + * + * @param netIpv4TcpFinTimeout the netIpv4TcpFinTimeout value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpFinTimeout(Integer netIpv4TcpFinTimeout) { + this.netIpv4TcpFinTimeout = netIpv4TcpFinTimeout; + return this; + } + + /** + * Get the netIpv4TcpKeepaliveTime property: Sysctl setting net.ipv4.tcp_keepalive_time. + * + * @return the netIpv4TcpKeepaliveTime value. + */ + public Integer netIpv4TcpKeepaliveTime() { + return this.netIpv4TcpKeepaliveTime; + } + + /** + * Set the netIpv4TcpKeepaliveTime property: Sysctl setting net.ipv4.tcp_keepalive_time. + * + * @param netIpv4TcpKeepaliveTime the netIpv4TcpKeepaliveTime value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpKeepaliveTime(Integer netIpv4TcpKeepaliveTime) { + this.netIpv4TcpKeepaliveTime = netIpv4TcpKeepaliveTime; + return this; + } + + /** + * Get the netIpv4TcpKeepaliveProbes property: Sysctl setting net.ipv4.tcp_keepalive_probes. + * + * @return the netIpv4TcpKeepaliveProbes value. + */ + public Integer netIpv4TcpKeepaliveProbes() { + return this.netIpv4TcpKeepaliveProbes; + } + + /** + * Set the netIpv4TcpKeepaliveProbes property: Sysctl setting net.ipv4.tcp_keepalive_probes. + * + * @param netIpv4TcpKeepaliveProbes the netIpv4TcpKeepaliveProbes value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpKeepaliveProbes(Integer netIpv4TcpKeepaliveProbes) { + this.netIpv4TcpKeepaliveProbes = netIpv4TcpKeepaliveProbes; + return this; + } + + /** + * Get the netIpv4TcpkeepaliveIntvl property: Sysctl setting net.ipv4.tcp_keepalive_intvl. + * + * @return the netIpv4TcpkeepaliveIntvl value. + */ + public Integer netIpv4TcpkeepaliveIntvl() { + return this.netIpv4TcpkeepaliveIntvl; + } + + /** + * Set the netIpv4TcpkeepaliveIntvl property: Sysctl setting net.ipv4.tcp_keepalive_intvl. + * + * @param netIpv4TcpkeepaliveIntvl the netIpv4TcpkeepaliveIntvl value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpkeepaliveIntvl(Integer netIpv4TcpkeepaliveIntvl) { + this.netIpv4TcpkeepaliveIntvl = netIpv4TcpkeepaliveIntvl; + return this; + } + + /** + * Get the netIpv4TcpTwReuse property: Sysctl setting net.ipv4.tcp_tw_reuse. + * + * @return the netIpv4TcpTwReuse value. + */ + public Boolean netIpv4TcpTwReuse() { + return this.netIpv4TcpTwReuse; + } + + /** + * Set the netIpv4TcpTwReuse property: Sysctl setting net.ipv4.tcp_tw_reuse. + * + * @param netIpv4TcpTwReuse the netIpv4TcpTwReuse value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4TcpTwReuse(Boolean netIpv4TcpTwReuse) { + this.netIpv4TcpTwReuse = netIpv4TcpTwReuse; + return this; + } + + /** + * Get the netIpv4IpLocalPortRange property: Sysctl setting net.ipv4.ip_local_port_range. + * + * @return the netIpv4IpLocalPortRange value. + */ + public String netIpv4IpLocalPortRange() { + return this.netIpv4IpLocalPortRange; + } + + /** + * Set the netIpv4IpLocalPortRange property: Sysctl setting net.ipv4.ip_local_port_range. + * + * @param netIpv4IpLocalPortRange the netIpv4IpLocalPortRange value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4IpLocalPortRange(String netIpv4IpLocalPortRange) { + this.netIpv4IpLocalPortRange = netIpv4IpLocalPortRange; + return this; + } + + /** + * Get the netIpv4NeighDefaultGcThresh1 property: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + * + * @return the netIpv4NeighDefaultGcThresh1 value. + */ + public Integer netIpv4NeighDefaultGcThresh1() { + return this.netIpv4NeighDefaultGcThresh1; + } + + /** + * Set the netIpv4NeighDefaultGcThresh1 property: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + * + * @param netIpv4NeighDefaultGcThresh1 the netIpv4NeighDefaultGcThresh1 value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4NeighDefaultGcThresh1(Integer netIpv4NeighDefaultGcThresh1) { + this.netIpv4NeighDefaultGcThresh1 = netIpv4NeighDefaultGcThresh1; + return this; + } + + /** + * Get the netIpv4NeighDefaultGcThresh2 property: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + * + * @return the netIpv4NeighDefaultGcThresh2 value. + */ + public Integer netIpv4NeighDefaultGcThresh2() { + return this.netIpv4NeighDefaultGcThresh2; + } + + /** + * Set the netIpv4NeighDefaultGcThresh2 property: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + * + * @param netIpv4NeighDefaultGcThresh2 the netIpv4NeighDefaultGcThresh2 value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4NeighDefaultGcThresh2(Integer netIpv4NeighDefaultGcThresh2) { + this.netIpv4NeighDefaultGcThresh2 = netIpv4NeighDefaultGcThresh2; + return this; + } + + /** + * Get the netIpv4NeighDefaultGcThresh3 property: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + * + * @return the netIpv4NeighDefaultGcThresh3 value. + */ + public Integer netIpv4NeighDefaultGcThresh3() { + return this.netIpv4NeighDefaultGcThresh3; + } + + /** + * Set the netIpv4NeighDefaultGcThresh3 property: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + * + * @param netIpv4NeighDefaultGcThresh3 the netIpv4NeighDefaultGcThresh3 value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetIpv4NeighDefaultGcThresh3(Integer netIpv4NeighDefaultGcThresh3) { + this.netIpv4NeighDefaultGcThresh3 = netIpv4NeighDefaultGcThresh3; + return this; + } + + /** + * Get the netNetfilterNfConntrackMax property: Sysctl setting net.netfilter.nf_conntrack_max. + * + * @return the netNetfilterNfConntrackMax value. + */ + public Integer netNetfilterNfConntrackMax() { + return this.netNetfilterNfConntrackMax; + } + + /** + * Set the netNetfilterNfConntrackMax property: Sysctl setting net.netfilter.nf_conntrack_max. + * + * @param netNetfilterNfConntrackMax the netNetfilterNfConntrackMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetNetfilterNfConntrackMax(Integer netNetfilterNfConntrackMax) { + this.netNetfilterNfConntrackMax = netNetfilterNfConntrackMax; + return this; + } + + /** + * Get the netNetfilterNfConntrackBuckets property: Sysctl setting net.netfilter.nf_conntrack_buckets. + * + * @return the netNetfilterNfConntrackBuckets value. + */ + public Integer netNetfilterNfConntrackBuckets() { + return this.netNetfilterNfConntrackBuckets; + } + + /** + * Set the netNetfilterNfConntrackBuckets property: Sysctl setting net.netfilter.nf_conntrack_buckets. + * + * @param netNetfilterNfConntrackBuckets the netNetfilterNfConntrackBuckets value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withNetNetfilterNfConntrackBuckets(Integer netNetfilterNfConntrackBuckets) { + this.netNetfilterNfConntrackBuckets = netNetfilterNfConntrackBuckets; + return this; + } + + /** + * Get the fsInotifyMaxUserWatches property: Sysctl setting fs.inotify.max_user_watches. + * + * @return the fsInotifyMaxUserWatches value. + */ + public Integer fsInotifyMaxUserWatches() { + return this.fsInotifyMaxUserWatches; + } + + /** + * Set the fsInotifyMaxUserWatches property: Sysctl setting fs.inotify.max_user_watches. + * + * @param fsInotifyMaxUserWatches the fsInotifyMaxUserWatches value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withFsInotifyMaxUserWatches(Integer fsInotifyMaxUserWatches) { + this.fsInotifyMaxUserWatches = fsInotifyMaxUserWatches; + return this; + } + + /** + * Get the fsFileMax property: Sysctl setting fs.file-max. + * + * @return the fsFileMax value. + */ + public Integer fsFileMax() { + return this.fsFileMax; + } + + /** + * Set the fsFileMax property: Sysctl setting fs.file-max. + * + * @param fsFileMax the fsFileMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withFsFileMax(Integer fsFileMax) { + this.fsFileMax = fsFileMax; + return this; + } + + /** + * Get the fsAioMaxNr property: Sysctl setting fs.aio-max-nr. + * + * @return the fsAioMaxNr value. + */ + public Integer fsAioMaxNr() { + return this.fsAioMaxNr; + } + + /** + * Set the fsAioMaxNr property: Sysctl setting fs.aio-max-nr. + * + * @param fsAioMaxNr the fsAioMaxNr value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withFsAioMaxNr(Integer fsAioMaxNr) { + this.fsAioMaxNr = fsAioMaxNr; + return this; + } + + /** + * Get the fsNrOpen property: Sysctl setting fs.nr_open. + * + * @return the fsNrOpen value. + */ + public Integer fsNrOpen() { + return this.fsNrOpen; + } + + /** + * Set the fsNrOpen property: Sysctl setting fs.nr_open. + * + * @param fsNrOpen the fsNrOpen value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withFsNrOpen(Integer fsNrOpen) { + this.fsNrOpen = fsNrOpen; + return this; + } + + /** + * Get the kernelThreadsMax property: Sysctl setting kernel.threads-max. + * + * @return the kernelThreadsMax value. + */ + public Integer kernelThreadsMax() { + return this.kernelThreadsMax; + } + + /** + * Set the kernelThreadsMax property: Sysctl setting kernel.threads-max. + * + * @param kernelThreadsMax the kernelThreadsMax value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withKernelThreadsMax(Integer kernelThreadsMax) { + this.kernelThreadsMax = kernelThreadsMax; + return this; + } + + /** + * Get the vmMaxMapCount property: Sysctl setting vm.max_map_count. + * + * @return the vmMaxMapCount value. + */ + public Integer vmMaxMapCount() { + return this.vmMaxMapCount; + } + + /** + * Set the vmMaxMapCount property: Sysctl setting vm.max_map_count. + * + * @param vmMaxMapCount the vmMaxMapCount value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withVmMaxMapCount(Integer vmMaxMapCount) { + this.vmMaxMapCount = vmMaxMapCount; + return this; + } + + /** + * Get the vmSwappiness property: Sysctl setting vm.swappiness. + * + * @return the vmSwappiness value. + */ + public Integer vmSwappiness() { + return this.vmSwappiness; + } + + /** + * Set the vmSwappiness property: Sysctl setting vm.swappiness. + * + * @param vmSwappiness the vmSwappiness value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withVmSwappiness(Integer vmSwappiness) { + this.vmSwappiness = vmSwappiness; + return this; + } + + /** + * Get the vmVfsCachePressure property: Sysctl setting vm.vfs_cache_pressure. + * + * @return the vmVfsCachePressure value. + */ + public Integer vmVfsCachePressure() { + return this.vmVfsCachePressure; + } + + /** + * Set the vmVfsCachePressure property: Sysctl setting vm.vfs_cache_pressure. + * + * @param vmVfsCachePressure the vmVfsCachePressure value to set. + * @return the SysctlConfig object itself. + */ + public SysctlConfig withVmVfsCachePressure(Integer vmVfsCachePressure) { + this.vmVfsCachePressure = vmVfsCachePressure; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TagsObject.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TagsObject.java new file mode 100644 index 0000000000000..6a0159f30e57d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TagsObject.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.containerservice.generated.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; + +/** Tags object for patch operations. */ +@Fluent +public final class TagsObject { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsObject.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the TagsObject object itself. + */ + public TagsObject 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/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeInWeek.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeInWeek.java new file mode 100644 index 0000000000000..6d105642cbde7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeInWeek.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Time in a week. */ +@Fluent +public final class TimeInWeek { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeInWeek.class); + + /* + * The day of the week. + */ + @JsonProperty(value = "day") + private WeekDay day; + + /* + * A list of hours in the day used to identify a time range. Each integer + * hour represents a time range beginning at 0m after the hour ending at + * the next hour (non-inclusive). 0 corresponds to 00:00 UTC, 23 + * corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC + * time range. + */ + @JsonProperty(value = "hourSlots") + private List hourSlots; + + /** + * Get the day property: The day of the week. + * + * @return the day value. + */ + public WeekDay day() { + return this.day; + } + + /** + * Set the day property: The day of the week. + * + * @param day the day value to set. + * @return the TimeInWeek object itself. + */ + public TimeInWeek withDay(WeekDay day) { + this.day = day; + return this; + } + + /** + * Get the hourSlots property: A list of hours in the day used to identify a time range. Each integer hour + * represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to + * 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + * + * @return the hourSlots value. + */ + public List hourSlots() { + return this.hourSlots; + } + + /** + * Set the hourSlots property: A list of hours in the day used to identify a time range. Each integer hour + * represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to + * 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time range. + * + * @param hourSlots the hourSlots value to set. + * @return the TimeInWeek object itself. + */ + public TimeInWeek withHourSlots(List hourSlots) { + this.hourSlots = hourSlots; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeSpan.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeSpan.java new file mode 100644 index 0000000000000..bf98a27471491 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeSpan.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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.time.OffsetDateTime; + +/** For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. */ +@Fluent +public final class TimeSpan { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeSpan.class); + + /* + * The start of a time span + */ + @JsonProperty(value = "start") + private OffsetDateTime start; + + /* + * The end of a time span + */ + @JsonProperty(value = "end") + private OffsetDateTime end; + + /** + * Get the start property: The start of a time span. + * + * @return the start value. + */ + public OffsetDateTime start() { + return this.start; + } + + /** + * Set the start property: The start of a time span. + * + * @param start the start value to set. + * @return the TimeSpan object itself. + */ + public TimeSpan withStart(OffsetDateTime start) { + this.start = start; + return this; + } + + /** + * Get the end property: The end of a time span. + * + * @return the end value. + */ + public OffsetDateTime end() { + return this.end; + } + + /** + * Set the end property: The end of a time span. + * + * @param end the end value to set. + * @return the TimeSpan object itself. + */ + public TimeSpan withEnd(OffsetDateTime end) { + this.end = end; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeChannel.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeChannel.java new file mode 100644 index 0000000000000..46c6d24bf46df --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UpgradeChannel.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UpgradeChannel. */ +public final class UpgradeChannel extends ExpandableStringEnum { + /** Static value rapid for UpgradeChannel. */ + public static final UpgradeChannel RAPID = fromString("rapid"); + + /** Static value stable for UpgradeChannel. */ + public static final UpgradeChannel STABLE = fromString("stable"); + + /** Static value patch for UpgradeChannel. */ + public static final UpgradeChannel PATCH = fromString("patch"); + + /** Static value node-image for UpgradeChannel. */ + public static final UpgradeChannel NODE_IMAGE = fromString("node-image"); + + /** Static value none for UpgradeChannel. */ + public static final UpgradeChannel NONE = fromString("none"); + + /** + * Creates or finds a UpgradeChannel from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpgradeChannel. + */ + @JsonCreator + public static UpgradeChannel fromString(String name) { + return fromString(name, UpgradeChannel.class); + } + + /** @return known UpgradeChannel values. */ + public static Collection values() { + return values(UpgradeChannel.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UserAssignedIdentity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..ca80f730c1f97 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UserAssignedIdentity.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.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; + +/** Details about a user assigned identity. */ +@Fluent +public class UserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); + + /* + * The resource ID of the user assigned identity. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The client ID of the user assigned identity. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The object ID of the user assigned identity. + */ + @JsonProperty(value = "objectId") + private String objectId; + + /** + * Get the resourceId property: The resource ID of the user assigned identity. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource ID of the user assigned identity. + * + * @param resourceId the resourceId value to set. + * @return the UserAssignedIdentity object itself. + */ + public UserAssignedIdentity withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the clientId property: The client ID of the user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client ID of the user assigned identity. + * + * @param clientId the clientId value to set. + * @return the UserAssignedIdentity object itself. + */ + public UserAssignedIdentity withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the objectId property: The object ID of the user assigned identity. + * + * @return the objectId value. + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the objectId property: The object ID of the user assigned identity. + * + * @param objectId the objectId value to set. + * @return the UserAssignedIdentity object itself. + */ + public UserAssignedIdentity withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeekDay.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeekDay.java new file mode 100644 index 0000000000000..4dba2088c58c7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WeekDay.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for WeekDay. */ +public final class WeekDay extends ExpandableStringEnum { + /** Static value Sunday for WeekDay. */ + public static final WeekDay SUNDAY = fromString("Sunday"); + + /** Static value Monday for WeekDay. */ + public static final WeekDay MONDAY = fromString("Monday"); + + /** Static value Tuesday for WeekDay. */ + public static final WeekDay TUESDAY = fromString("Tuesday"); + + /** Static value Wednesday for WeekDay. */ + public static final WeekDay WEDNESDAY = fromString("Wednesday"); + + /** Static value Thursday for WeekDay. */ + public static final WeekDay THURSDAY = fromString("Thursday"); + + /** Static value Friday for WeekDay. */ + public static final WeekDay FRIDAY = fromString("Friday"); + + /** Static value Saturday for WeekDay. */ + public static final WeekDay SATURDAY = fromString("Saturday"); + + /** + * Creates or finds a WeekDay from its string representation. + * + * @param name a name to look for. + * @return the corresponding WeekDay. + */ + @JsonCreator + public static WeekDay fromString(String name) { + return fromString(name, WeekDay.class); + } + + /** @return known WeekDay values. */ + public static Collection values() { + return values(WeekDay.class); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/package-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/package-info.java new file mode 100644 index 0000000000000..ca38b9ced40af --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ContainerServiceManagementClient. Container Service Client. */ +package com.azure.resourcemanager.containerservice.generated.models; diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/package-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/package-info.java new file mode 100644 index 0000000000000..4e3d87becffbc --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ContainerServiceManagementClient. Container Service Client. */ +package com.azure.resourcemanager.containerservice.generated; diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/module-info.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..6bc9f621d2357 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.containerservice.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.containerservice.generated; + exports com.azure.resourcemanager.containerservice.generated.fluent; + exports com.azure.resourcemanager.containerservice.generated.fluent.models; + exports com.azure.resourcemanager.containerservice.generated.models; + + opens com.azure.resourcemanager.containerservice.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.containerservice.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/containerservice/ci.yml b/sdk/containerservice/ci.yml new file mode 100644 index 0000000000000..2ea79271fdf0f --- /dev/null +++ b/sdk/containerservice/ci.yml @@ -0,0 +1,33 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - main + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ + +pr: + branches: + include: + - master + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: containerservice + Artifacts: + - name: azure-resourcemanager-containerservice-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagercontainerservicegenerated diff --git a/sdk/containerservice/pom.xml b/sdk/containerservice/pom.xml new file mode 100644 index 0000000000000..7919d6de8a480 --- /dev/null +++ b/sdk/containerservice/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-containerservice-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-containerservice-generated + + + +