diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 1760489ea9210..a14a043723366 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -332,6 +332,7 @@ com.azure.resourcemanager:azure-resourcemanager-oep;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-dnsresolver;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-mobilenetwork;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-azureadexternalidentities;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-containerservice-generated;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 76489cb77b347..cf92970fb8edc 100644 --- a/pom.xml +++ b/pom.xml @@ -869,6 +869,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..3e7d2ade677e3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-04-08) + +- Azure Resource Manager ContainerService client library for Java. This package contains Microsoft Azure SDK for ContainerService Management SDK. Container Service Client. Package tag package-preview-2022-03. 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..7bb159fcee31b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/README.md @@ -0,0 +1,102 @@ +# 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-preview-2022-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +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 + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/containerservice/azure-resourcemanager-containerservice-generated/SAMPLE.md) + + +## 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/SAMPLE.md b/sdk/containerservice/azure-resourcemanager-containerservice-generated/SAMPLE.md new file mode 100644 index 0000000000000..4ffbb5d4c514d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/SAMPLE.md @@ -0,0 +1,3847 @@ +# Code snippets and samples + + +## AgentPools + +- [CreateOrUpdate](#agentpools_createorupdate) +- [Delete](#agentpools_delete) +- [Get](#agentpools_get) +- [GetAvailableAgentPoolVersions](#agentpools_getavailableagentpoolversions) +- [GetUpgradeProfile](#agentpools_getupgradeprofile) +- [List](#agentpools_list) +- [UpgradeNodeImageVersion](#agentpools_upgradenodeimageversion) + +## ContainerServices + +- [ListOrchestrators](#containerservices_listorchestrators) + +## MaintenanceConfigurations + +- [CreateOrUpdate](#maintenanceconfigurations_createorupdate) +- [Delete](#maintenanceconfigurations_delete) +- [Get](#maintenanceconfigurations_get) +- [ListByManagedCluster](#maintenanceconfigurations_listbymanagedcluster) + +## ManagedClusterSnapshots + +- [CreateOrUpdate](#managedclustersnapshots_createorupdate) +- [Delete](#managedclustersnapshots_delete) +- [GetByResourceGroup](#managedclustersnapshots_getbyresourcegroup) +- [List](#managedclustersnapshots_list) +- [ListByResourceGroup](#managedclustersnapshots_listbyresourcegroup) +- [UpdateTags](#managedclustersnapshots_updatetags) + +## ManagedClusters + +- [CreateOrUpdate](#managedclusters_createorupdate) +- [Delete](#managedclusters_delete) +- [GetAccessProfile](#managedclusters_getaccessprofile) +- [GetByResourceGroup](#managedclusters_getbyresourcegroup) +- [GetCommandResult](#managedclusters_getcommandresult) +- [GetOSOptions](#managedclusters_getosoptions) +- [GetUpgradeProfile](#managedclusters_getupgradeprofile) +- [List](#managedclusters_list) +- [ListByResourceGroup](#managedclusters_listbyresourcegroup) +- [ListClusterAdminCredentials](#managedclusters_listclusteradmincredentials) +- [ListClusterMonitoringUserCredentials](#managedclusters_listclustermonitoringusercredentials) +- [ListClusterUserCredentials](#managedclusters_listclusterusercredentials) +- [ListOutboundNetworkDependenciesEndpoints](#managedclusters_listoutboundnetworkdependenciesendpoints) +- [ResetAadProfile](#managedclusters_resetaadprofile) +- [ResetServicePrincipalProfile](#managedclusters_resetserviceprincipalprofile) +- [RotateClusterCertificates](#managedclusters_rotateclustercertificates) +- [RotateServiceAccountSigningKeys](#managedclusters_rotateserviceaccountsigningkeys) +- [RunCommand](#managedclusters_runcommand) +- [Start](#managedclusters_start) +- [Stop](#managedclusters_stop) +- [UpdateTags](#managedclusters_updatetags) + +## OpenShiftManagedClusters + +- [CreateOrUpdate](#openshiftmanagedclusters_createorupdate) +- [Delete](#openshiftmanagedclusters_delete) +- [GetByResourceGroup](#openshiftmanagedclusters_getbyresourcegroup) +- [List](#openshiftmanagedclusters_list) +- [ListByResourceGroup](#openshiftmanagedclusters_listbyresourcegroup) +- [UpdateTags](#openshiftmanagedclusters_updatetags) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) +- [Update](#privateendpointconnections_update) + +## PrivateLinkResources + +- [List](#privatelinkresources_list) + +## ResolvePrivateLinkServiceId + +- [Post](#resolveprivatelinkserviceid_post) + +## Snapshots + +- [CreateOrUpdate](#snapshots_createorupdate) +- [Delete](#snapshots_delete) +- [GetByResourceGroup](#snapshots_getbyresourcegroup) +- [List](#snapshots_list) +- [ListByResourceGroup](#snapshots_listbyresourcegroup) +- [UpdateTags](#snapshots_updatetags) +### AgentPools_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.AgentPool; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.Code; +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.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.ScaleSetEvictionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetPriority; +import com.azure.resourcemanager.containerservice.generated.models.SysctlConfig; +import com.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AgentPools CreateOrUpdate. */ +public final class AgentPoolsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableFIPS.json + */ + /** + * Sample code: Create Agent Pool with FIPS enabled OS. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithFIPSEnabledOS( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableFips(true) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_GPUMIG.json + */ + /** + * Sample code: Create Agent Pool with GPUMIG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithGPUMIG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_ND96asr_v4") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withKubeletConfig( + new KubeletConfig() + .withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig( + new LinuxOSConfig() + .withSysctls( + new SysctlConfig() + .withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .withGpuInstanceProfile(GpuInstanceProfile.MIG2G) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json + */ + /** + * Sample code: Create Agent Pool with Dedicated Host Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithDedicatedHostGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withHostGroupId( + "/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Update.json + */ + /** + * Sample code: Create/Update Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("name1", "val1")) + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeLabels(mapOf("key1", "val1")) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Start.json + */ + /** + * Sample code: Start Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void startAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withPowerState(new PowerState().withCode(Code.RUNNING)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Spot.json + */ + /** + * Sample code: Create Spot Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createSpotAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("name1", "val1")) + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeLabels(mapOf("key1", "val1")) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Ephemeral.json + */ + /** + * Sample code: Create Agent Pool with Ephemeral OS Disk. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithEphemeralOSDisk( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withOsDiskType(OSDiskType.EPHEMERAL) + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsAssociate_CRG.json + */ + /** + * Sample code: Associate Agent Pool with Capacity Reservation Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void associateAgentPoolWithCapacityReservationGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withCapacityReservationGroupId( + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/CapacityReservationGroups/crg1") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + */ + /** + * Sample code: Create Agent Pool with EncryptionAtHost enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithEncryptionAtHostEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableEncryptionAtHost(true) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableUltraSSD.json + */ + /** + * Sample code: Create Agent Pool with UltraSSD enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithUltraSSDEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableUltraSsd(true) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_WasmWasi.json + */ + /** + * Sample code: Create Agent Pool with Krustlet and the WASI runtime. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithKrustletAndTheWASIRuntime( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withWorkloadRuntime(WorkloadRuntime.WASM_WASI) + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Snapshot.json + */ + /** + * Sample code: Create Agent Pool using an agent pool snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolUsingAnAgentPoolSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableFips(true) + .withCreationData( + new CreationData() + .withSourceResourceId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_PPG.json + */ + /** + * Sample code: Create Agent Pool with PPG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithPPG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withProximityPlacementGroupId( + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_CustomNodeConfig.json + */ + /** + * Sample code: Create Agent Pool with KubeletConfig and LinuxOSConfig. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithKubeletConfigAndLinuxOSConfig( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withKubeletConfig( + new KubeletConfig() + .withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig( + new LinuxOSConfig() + .withSysctls( + new SysctlConfig() + .withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Stop.json + */ + /** + * Sample code: Stop Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void stopAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withPowerState(new PowerState().withCode(Code.STOPPED)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_MessageOfTheDay.json + */ + /** + * Sample code: Create Agent Pool with Message of the Day. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithMessageOfTheDay( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withMessageOfTheDay("Zm9vCg==") + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_OSSKU.json + */ + /** + * Sample code: Create Agent Pool with OSSKU. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithOSSKU( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOsSku(Ossku.CBLMARINER) + .withOrchestratorVersion("") + .withKubeletConfig( + new KubeletConfig() + .withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig( + new LinuxOSConfig() + .withSysctls( + new SysctlConfig() + .withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Update.json + */ + /** + * Sample code: Update Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + AgentPool resource = + manager.agentPools().getWithResponse("rg1", "clustername1", "agentpool1", Context.NONE).getValue(); + resource + .update() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withMaxCount(2) + .withMinCount(2) + .withEnableAutoScaling(true) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### AgentPools_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for AgentPools Delete. */ +public final class AgentPoolsDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.json + */ + /** + * Sample code: Delete Agent Pool by ignoring PodDisruptionBudget. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteAgentPoolByIgnoringPodDisruptionBudget( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().delete("rg1", "clustername1", "agentpool1", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete.json + */ + /** + * Sample code: Delete Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().delete("rg1", "clustername1", "agentpool1", null, Context.NONE); + } +} +``` + +### AgentPools_Get + +```java +import com.azure.core.util.Context; + +/** Samples for AgentPools Get. */ +public final class AgentPoolsGetSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGet.json + */ + /** + * Sample code: Get Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().getWithResponse("rg1", "clustername1", "agentpool1", Context.NONE); + } +} +``` + +### AgentPools_GetAvailableAgentPoolVersions + +```java +import com.azure.core.util.Context; + +/** Samples for AgentPools GetAvailableAgentPoolVersions. */ +public final class AgentPoolsGetAvailableAgentPoolVersionsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json + */ + /** + * Sample code: Get available versions for agent pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getAvailableVersionsForAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().getAvailableAgentPoolVersionsWithResponse("rg1", "clustername1", Context.NONE); + } +} +``` + +### AgentPools_GetUpgradeProfile + +```java +import com.azure.core.util.Context; + +/** Samples for AgentPools GetUpgradeProfile. */ +public final class AgentPoolsGetUpgradeProfileSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetUpgradeProfile.json + */ + /** + * Sample code: Get Upgrade Profile for Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getUpgradeProfileForAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().getUpgradeProfileWithResponse("rg1", "clustername1", "agentpool1", Context.NONE); + } +} +``` + +### AgentPools_List + +```java +import com.azure.core.util.Context; + +/** Samples for AgentPools List. */ +public final class AgentPoolsListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsList.json + */ + /** + * Sample code: List Agent Pools by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listAgentPoolsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().list("rg1", "clustername1", Context.NONE); + } +} +``` + +### AgentPools_UpgradeNodeImageVersion + +```java +import com.azure.core.util.Context; + +/** Samples for AgentPools UpgradeNodeImageVersion. */ +public final class AgentPoolsUpgradeNodeImageVersionSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json + */ + /** + * Sample code: Upgrade Agent Pool Node Image Version. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void upgradeAgentPoolNodeImageVersion( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().upgradeNodeImageVersion("rg1", "clustername1", "agentpool1", Context.NONE); + } +} +``` + +### ContainerServices_ListOrchestrators + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerServices ListOrchestrators. */ +public final class ContainerServicesListOrchestratorsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-08-01/examples/ContainerServiceListOrchestrators.json + */ + /** + * Sample code: List Container Service Orchestrators. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listContainerServiceOrchestrators( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.containerServices().listOrchestratorsWithResponse("location1", null, Context.NONE); + } +} +``` + +### MaintenanceConfigurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for MaintenanceConfigurations CreateOrUpdate. */ +public final class MaintenanceConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsCreate_Update.json + */ + /** + * Sample code: Create/Update Maintenance Configuration. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateMaintenanceConfiguration( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .maintenanceConfigurations() + .define("default") + .withExistingManagedCluster("rg1", "clustername1") + .withTimeInWeek(Arrays.asList(new TimeInWeek().withDay(WeekDay.MONDAY).withHourSlots(Arrays.asList(1, 2)))) + .withNotAllowedTime( + Arrays + .asList( + new TimeSpan() + .withStart(OffsetDateTime.parse("2020-11-26T03:00:00Z")) + .withEnd(OffsetDateTime.parse("2020-11-30T12:00:00Z")))) + .create(); + } +} +``` + +### MaintenanceConfigurations_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for MaintenanceConfigurations Delete. */ +public final class MaintenanceConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsDelete.json + */ + /** + * Sample code: Delete Maintenance Configuration. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteMaintenanceConfiguration( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations().deleteWithResponse("rg1", "clustername1", "default", Context.NONE); + } +} +``` + +### MaintenanceConfigurations_Get + +```java +import com.azure.core.util.Context; + +/** Samples for MaintenanceConfigurations Get. */ +public final class MaintenanceConfigurationsGetSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsGet.json + */ + /** + * Sample code: Get Maintenance Configuration. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getMaintenanceConfiguration( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations().getWithResponse("rg1", "clustername1", "default", Context.NONE); + } +} +``` + +### MaintenanceConfigurations_ListByManagedCluster + +```java +import com.azure.core.util.Context; + +/** Samples for MaintenanceConfigurations ListByManagedCluster. */ +public final class MaintenanceConfigurationsListByManagedClusterSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsList.json + */ + /** + * Sample code: List maintenance configurations by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listMaintenanceConfigurationsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations().listByManagedCluster("rg1", "clustername1", Context.NONE); + } +} +``` + +### ManagedClusterSnapshots_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedClusterSnapshots CreateOrUpdate. */ +public final class ManagedClusterSnapshotsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsCreate.json + */ + /** + * Sample code: Create/Update Managed Cluster Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusterSnapshots() + .define("snapshot1") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "val1", "key2", "val2")) + .withCreationData( + new CreationData() + .withSourceResourceId( + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ManagedClusterSnapshots_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusterSnapshots Delete. */ +public final class ManagedClusterSnapshotsDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsDelete.json + */ + /** + * Sample code: Delete Managed Cluster Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteManagedClusterSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusterSnapshots().deleteWithResponse("rg1", "snapshot1", Context.NONE); + } +} +``` + +### ManagedClusterSnapshots_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusterSnapshots GetByResourceGroup. */ +public final class ManagedClusterSnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsGet.json + */ + /** + * Sample code: Get Managed Cluster Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedClusterSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusterSnapshots().getByResourceGroupWithResponse("rg1", "snapshot1", Context.NONE); + } +} +``` + +### ManagedClusterSnapshots_List + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusterSnapshots List. */ +public final class ManagedClusterSnapshotsListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsList.json + */ + /** + * Sample code: List Managed Cluster Snapshots. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listManagedClusterSnapshots( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusterSnapshots().list(Context.NONE); + } +} +``` + +### ManagedClusterSnapshots_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusterSnapshots ListByResourceGroup. */ +public final class ManagedClusterSnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json + */ + /** + * Sample code: List Managed Cluster Snapshots by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listManagedClusterSnapshotsByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusterSnapshots().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### ManagedClusterSnapshots_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSnapshot; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedClusterSnapshots UpdateTags. */ +public final class ManagedClusterSnapshotsUpdateTagsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json + */ + /** + * Sample code: Update Managed Cluster Snapshot Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateManagedClusterSnapshotTags( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + ManagedClusterSnapshot resource = + manager + .managedClusterSnapshots() + .getByResourceGroupWithResponse("rg1", "snapshot1", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2", "new-val2", "key3", "val3")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ManagedClusters_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceSshConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceSshPublicKey; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.Expander; +import com.azure.resourcemanager.containerservice.generated.models.GpuInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.IpFamily; +import com.azure.resourcemanager.containerservice.generated.models.LicenseType; +import com.azure.resourcemanager.containerservice.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAadProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileWebAppRouting; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterManagedOutboundIpProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNatGatewayProfile; +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.ManagedClusterSecurityProfileAzureDefender; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSku; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSkuName; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSkuTier; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedServiceIdentityUserAssignedIdentitiesValue; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.Ossku; +import com.azure.resourcemanager.containerservice.generated.models.OutboundType; +import com.azure.resourcemanager.containerservice.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerservice.generated.models.ScaleDownMode; +import com.azure.resourcemanager.containerservice.generated.models.WindowsGmsaProfile; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedClusters CreateOrUpdate. */ +public final class ManagedClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json + */ + /** + * Sample code: Create/Update Managed Cluster with dual-stack networking. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithDualStackNetworking( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withIdentity( + new ManagedClusterIdentity() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withScaleDownMode(ScaleDownMode.DEALLOCATE) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))) + .withIpFamilies(Arrays.asList(IpFamily.IPV4, IpFamily.IPV6))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withBalanceSimilarNodeGroups("true") + .withExpander(Expander.PRIORITY) + .withMaxNodeProvisionTime("15m") + .withNewPodScaleUpDelay("1m") + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m") + .withSkipNodesWithSystemPods("false")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PodIdentity.json + */ + /** + * Sample code: Create Managed Cluster with PodIdentity enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithPodIdentityEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withPodIdentityProfile( + new ManagedClusterPodIdentityProfile().withEnabled(true).withAllowNetworkPluginKubenet(true)) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json + */ + /** + * Sample code: Create Managed Cluster with user-assigned NAT gateway as outbound type. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithUserAssignedNATGatewayAsOutboundType( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(false) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.USER_ASSIGNED_NATGATEWAY) + .withLoadBalancerSku(LoadBalancerSku.STANDARD)) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_MCSnapshot.json + */ + /** + * Sample code: Create Managed Cluster using a managed cluster snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterUsingAManagedClusterSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withCreationData( + new CreationData() + .withSourceResourceId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1")) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableFips(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_Update.json + */ + /** + * Sample code: Create/Update Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withIdentity( + new ManagedClusterIdentity() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withScaleDownMode(ScaleDownMode.DEALLOCATE) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withBalanceSimilarNodeGroups("true") + .withExpander(Expander.PRIORITY) + .withMaxNodeProvisionTime("15m") + .withNewPodScaleUpDelay("1m") + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m") + .withSkipNodesWithSystemPods("false")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + */ + /** + * Sample code: Create Managed Private Cluster with fqdn subdomain specified. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedPrivateClusterWithFqdnSubdomainSpecified( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withFqdnSubdomain("domain1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile( + new ManagedClusterApiServerAccessProfile() + .withEnablePrivateCluster(true) + .withPrivateDnsZone( + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json + */ + /** + * Sample code: Create Managed Cluster with AKS-managed NAT gateway as outbound type. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithAKSManagedNATGatewayAsOutboundType( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(false) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.MANAGED_NATGATEWAY) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withNatGatewayProfile( + new ManagedClusterNatGatewayProfile() + .withManagedOutboundIpProfile(new ManagedClusterManagedOutboundIpProfile().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersAssociate_CRG.json + */ + /** + * Sample code: Associate Managed Cluster with Capacity Reservation Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void associateManagedClusterWithCapacityReservationGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withCapacityReservationGroupId( + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/capacityReservationGroups/crg1") + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_NodePublicIPPrefix.json + */ + /** + * Sample code: Create Managed Cluster with Node Public IP Prefix. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithNodePublicIPPrefix( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withNodePublicIpPrefixId( + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix") + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnableEncryptionAtHost.json + */ + /** + * Sample code: Create Managed Cluster with EncryptionAtHost enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithEncryptionAtHostEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json + */ + /** + * Sample code: Create Managed Private Cluster with Public FQDN specified. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedPrivateClusterWithPublicFQDNSpecified( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile( + new ManagedClusterApiServerAccessProfile() + .withEnablePrivateCluster(true) + .withEnablePrivateClusterPublicFqdn(true)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_HTTPProxy.json + */ + /** + * Sample code: Create Managed Cluster with HTTP proxy configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithHTTPProxyConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig( + new ManagedClusterHttpProxyConfig() + .withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithEnableNamespaceResources.json + */ + /** + * Sample code: Create/Update Managed Cluster with EnableNamespaceResources. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithEnableNamespaceResources( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withEnableNamespaceResources(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DedicatedHostGroup.json + */ + /** + * Sample code: Create Managed Cluster with Dedicated Host Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithDedicatedHostGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withEnableNodePublicIp(true) + .withHostGroupId( + "/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1") + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(false) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnabledFIPS.json + */ + /** + * Sample code: Create Managed Cluster with FIPS enabled OS. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithFIPSEnabledOS( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableFips(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(false) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_SecurityProfile.json + */ + /** + * Sample code: Create Managed Cluster with Security Profile configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithSecurityProfileConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withSecurityProfile( + new ManagedClusterSecurityProfile() + .withAzureDefender( + new ManagedClusterSecurityProfileAzureDefender() + .withEnabled(true) + .withLogAnalyticsWorkspaceResourceId( + "/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"))) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PPG.json + */ + /** + * Sample code: Create Managed Cluster with PPG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithPPG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withProximityPlacementGroupId( + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1") + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json + */ + /** + * Sample code: Create Managed Cluster with Web App Routing Ingress Profile configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithWebAppRoutingIngressProfileConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withIngressProfile( + new ManagedClusterIngressProfile() + .withWebAppRouting( + new ManagedClusterIngressProfileWebAppRouting() + .withEnabled(true) + .withDnsZoneResourceId( + "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"))) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithAHUB.json + */ + /** + * Sample code: Create/Update Managed Cluster with EnableAHUB. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithEnableAHUB( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withIdentity( + new ManagedClusterIdentity() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$") + .withLicenseType(LicenseType.WINDOWS_SERVER)) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DisableRunCommand.json + */ + /** + * Sample code: Create Managed Cluster with RunCommand disabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithRunCommandDisabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withDisableRunCommand(true)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_Snapshot.json + */ + /** + * Sample code: Create Managed Cluster using an agent pool snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterUsingAnAgentPoolSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableFips(true) + .withCreationData( + new CreationData() + .withSourceResourceId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(false) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_OSSKU.json + */ + /** + * Sample code: Create Managed Cluster with OSSKU. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithOSSKU( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOsSku(Ossku.CBLMARINER) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig( + new ManagedClusterHttpProxyConfig() + .withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + */ + /** + * Sample code: Create/Update AAD Managed Cluster with EnableAzureRBAC. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateAADManagedClusterWithEnableAzureRBAC( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAadProfile(new ManagedClusterAadProfile().withManaged(true).withEnableAzureRbac(true)) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnableUltraSSD.json + */ + /** + * Sample code: Create Managed Cluster with UltraSSD enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithUltraSSDEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableUltraSsd(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWindowsGmsa.json + */ + /** + * Sample code: Create/Update Managed Cluster with Windows gMSA enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithWindowsGMSAEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withIdentity( + new ManagedClusterIdentity() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$") + .withGmsaProfile(new WindowsGmsaProfile().withEnabled(true))) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_GPUMIG.json + */ + /** + * Sample code: Create Managed Cluster with GPUMIG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithGPUMIG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_ND96asr_v4") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withGpuInstanceProfile(GpuInstanceProfile.MIG3G) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig( + new ManagedClusterHttpProxyConfig() + .withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ManagedClusters_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters Delete. */ +public final class ManagedClustersDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersDelete.json + */ + /** + * Sample code: Delete Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().delete("rg1", "clustername1", null, Context.NONE); + } +} +``` + +### ManagedClusters_GetAccessProfile + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters GetAccessProfile. */ +public final class ManagedClustersGetAccessProfileSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetAccessProfile.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().getAccessProfileWithResponse("rg1", "clustername1", "clusterUser", Context.NONE); + } +} +``` + +### ManagedClusters_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters GetByResourceGroup. */ +public final class ManagedClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGet.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().getByResourceGroupWithResponse("rg1", "clustername1", Context.NONE); + } +} +``` + +### ManagedClusters_GetCommandResult + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters GetCommandResult. */ +public final class ManagedClustersGetCommandResultSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultFailed.json + */ + /** + * Sample code: commandFailedResult. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void commandFailedResult( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .getCommandResultWithResponse("rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", Context.NONE); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultSucceed.json + */ + /** + * Sample code: commandSucceedResult. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void commandSucceedResult( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .getCommandResultWithResponse("rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", Context.NONE); + } +} +``` + +### ManagedClusters_GetOSOptions + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters GetOSOptions. */ +public final class ManagedClustersGetOSOptionsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ContainerServiceGetOSOptions.json + */ + /** + * Sample code: Get Container Service OS Options. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getContainerServiceOSOptions( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().getOSOptionsWithResponse("location1", null, Context.NONE); + } +} +``` + +### ManagedClusters_GetUpgradeProfile + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters GetUpgradeProfile. */ +public final class ManagedClustersGetUpgradeProfileSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetUpgradeProfile.json + */ + /** + * Sample code: Get Upgrade Profile for Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getUpgradeProfileForManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().getUpgradeProfileWithResponse("rg1", "clustername1", Context.NONE); + } +} +``` + +### ManagedClusters_List + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters List. */ +public final class ManagedClustersListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersList.json + */ + /** + * Sample code: List Managed Clusters. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listManagedClusters( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().list(Context.NONE); + } +} +``` + +### ManagedClusters_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters ListByResourceGroup. */ +public final class ManagedClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListByResourceGroup.json + */ + /** + * Sample code: Get Managed Clusters by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedClustersByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### ManagedClusters_ListClusterAdminCredentials + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters ListClusterAdminCredentials. */ +public final class ManagedClustersListClusterAdminCredentialsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listClusterAdminCredentialsWithResponse("rg1", "clustername1", null, Context.NONE); + } +} +``` + +### ManagedClusters_ListClusterMonitoringUserCredentials + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters ListClusterMonitoringUserCredentials. */ +public final class ManagedClustersListClusterMonitoringUserCredentialsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .listClusterMonitoringUserCredentialsWithResponse("rg1", "clustername1", null, Context.NONE); + } +} +``` + +### ManagedClusters_ListClusterUserCredentials + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters ListClusterUserCredentials. */ +public final class ManagedClustersListClusterUserCredentialsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .listClusterUserCredentialsWithResponse("rg1", "clustername1", null, null, Context.NONE); + } +} +``` + +### ManagedClusters_ListOutboundNetworkDependenciesEndpoints + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters ListOutboundNetworkDependenciesEndpoints. */ +public final class ManagedClustersListOutboundNetworkDependenciesEndpointsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json + */ + /** + * Sample code: List OutboundNetworkDependenciesEndpoints by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listOutboundNetworkDependenciesEndpointsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listOutboundNetworkDependenciesEndpoints("rg1", "clustername1", Context.NONE); + } +} +``` + +### ManagedClusters_ResetAadProfile + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAadProfile; + +/** Samples for ManagedClusters ResetAadProfile. */ +public final class ManagedClustersResetAadProfileSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetAADProfile.json + */ + /** + * Sample code: Reset AAD Profile. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void resetAADProfile( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .resetAadProfile( + "rg1", + "clustername1", + new ManagedClusterAadProfile() + .withClientAppId("clientappid") + .withServerAppId("serverappid") + .withServerAppSecret("serverappsecret") + .withTenantId("tenantid"), + Context.NONE); + } +} +``` + +### ManagedClusters_ResetServicePrincipalProfile + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; + +/** Samples for ManagedClusters ResetServicePrincipalProfile. */ +public final class ManagedClustersResetServicePrincipalProfileSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json + */ + /** + * Sample code: Reset Service Principal Profile. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void resetServicePrincipalProfile( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .resetServicePrincipalProfile( + "rg1", + "clustername1", + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"), + Context.NONE); + } +} +``` + +### ManagedClusters_RotateClusterCertificates + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters RotateClusterCertificates. */ +public final class ManagedClustersRotateClusterCertificatesSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateClusterCertificates.json + */ + /** + * Sample code: Rotate Cluster Certificates. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void rotateClusterCertificates( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().rotateClusterCertificates("rg1", "clustername1", Context.NONE); + } +} +``` + +### ManagedClusters_RotateServiceAccountSigningKeys + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters RotateServiceAccountSigningKeys. */ +public final class ManagedClustersRotateServiceAccountSigningKeysSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json + */ + /** + * Sample code: Rotate Cluster Service Account Signing Keys. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void rotateClusterServiceAccountSigningKeys( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().rotateServiceAccountSigningKeys("rg1", "clustername1", Context.NONE); + } +} +``` + +### ManagedClusters_RunCommand + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; + +/** Samples for ManagedClusters RunCommand. */ +public final class ManagedClustersRunCommandSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandRequest.json + */ + /** + * Sample code: submitNewCommand. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void submitNewCommand( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .runCommand( + "rg1", + "clustername1", + new RunCommandRequest().withCommand("kubectl apply -f ns.yaml").withContext("").withClusterToken(""), + Context.NONE); + } +} +``` + +### ManagedClusters_Start + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters Start. */ +public final class ManagedClustersStartSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStart.json + */ + /** + * Sample code: Start Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void startManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().start("rg1", "clustername1", Context.NONE); + } +} +``` + +### ManagedClusters_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedClusters Stop. */ +public final class ManagedClustersStopSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStop.json + */ + /** + * Sample code: Stop Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void stopManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().stop("rg1", "clustername1", Context.NONE); + } +} +``` + +### ManagedClusters_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.ManagedCluster; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedClusters UpdateTags. */ +public final class ManagedClustersUpdateTagsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersUpdateTags.json + */ + /** + * Sample code: Update Managed Cluster Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateManagedClusterTags( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + ManagedCluster resource = + manager.managedClusters().getByResourceGroupWithResponse("rg1", "clustername1", Context.NONE).getValue(); + resource.update().withTags(mapOf("archv3", "", "tier", "testing")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OpenShiftManagedClusters_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservice.generated.models.NetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftAgentPoolProfileRole; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftContainerServiceVMSize; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterAadIdentityProvider; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterAuthProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterIdentityProvider; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterMasterPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftRouterProfile; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for OpenShiftManagedClusters CreateOrUpdate. */ +public final class OpenShiftManagedClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersCreate_Update.json + */ + /** + * Sample code: Create/Update OpenShift Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateOpenShiftManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .openShiftManagedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withOpenShiftVersion("v3.11") + .withNetworkProfile(new NetworkProfile().withVnetCidr("10.0.0.0/8")) + .withRouterProfiles(Arrays.asList(new OpenShiftRouterProfile().withName("default"))) + .withMasterPoolProfile( + new OpenShiftManagedClusterMasterPoolProfile() + .withName("master") + .withCount(3) + .withVmSize(OpenShiftContainerServiceVMSize.STANDARD_D4S_V3) + .withSubnetCidr("10.0.0.0/24") + .withOsType(OSType.LINUX)) + .withAgentPoolProfiles( + Arrays + .asList( + new OpenShiftManagedClusterAgentPoolProfile() + .withName("infra") + .withCount(2) + .withVmSize(OpenShiftContainerServiceVMSize.STANDARD_D4S_V3) + .withSubnetCidr("10.0.0.0/24") + .withOsType(OSType.LINUX) + .withRole(OpenShiftAgentPoolProfileRole.INFRA), + new OpenShiftManagedClusterAgentPoolProfile() + .withName("compute") + .withCount(4) + .withVmSize(OpenShiftContainerServiceVMSize.STANDARD_D4S_V3) + .withSubnetCidr("10.0.0.0/24") + .withOsType(OSType.LINUX) + .withRole(OpenShiftAgentPoolProfileRole.COMPUTE))) + .withAuthProfile( + new OpenShiftManagedClusterAuthProfile() + .withIdentityProviders( + Arrays + .asList( + new OpenShiftManagedClusterIdentityProvider() + .withName("Azure AD") + .withProvider( + new OpenShiftManagedClusterAadIdentityProvider() + .withClientId("clientId") + .withSecret("secret") + .withTenantId("tenantId") + .withCustomerAdminGroupId("customerAdminGroupId"))))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OpenShiftManagedClusters_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for OpenShiftManagedClusters Delete. */ +public final class OpenShiftManagedClustersDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersDelete.json + */ + /** + * Sample code: Delete OpenShift Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteOpenShiftManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.openShiftManagedClusters().delete("rg1", "clustername1", Context.NONE); + } +} +``` + +### OpenShiftManagedClusters_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for OpenShiftManagedClusters GetByResourceGroup. */ +public final class OpenShiftManagedClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersGet.json + */ + /** + * Sample code: Get OpenShift Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getOpenShiftManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.openShiftManagedClusters().getByResourceGroupWithResponse("rg1", "clustername1", Context.NONE); + } +} +``` + +### OpenShiftManagedClusters_List + +```java +import com.azure.core.util.Context; + +/** Samples for OpenShiftManagedClusters List. */ +public final class OpenShiftManagedClustersListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersList.json + */ + /** + * Sample code: List Managed Clusters. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listManagedClusters( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.openShiftManagedClusters().list(Context.NONE); + } +} +``` + +### OpenShiftManagedClusters_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for OpenShiftManagedClusters ListByResourceGroup. */ +public final class OpenShiftManagedClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersListByResourceGroup.json + */ + /** + * Sample code: Get Managed Clusters by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedClustersByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.openShiftManagedClusters().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### OpenShiftManagedClusters_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedCluster; +import java.util.HashMap; +import java.util.Map; + +/** Samples for OpenShiftManagedClusters UpdateTags. */ +public final class OpenShiftManagedClustersUpdateTagsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersUpdateTags.json + */ + /** + * Sample code: Update OpenShift Managed Cluster Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateOpenShiftManagedClusterTags( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + OpenShiftManagedCluster resource = + manager + .openShiftManagedClusters() + .getByResourceGroupWithResponse("rg1", "clustername1", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("archv3", "", "tier", "testing")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/Operation_List.json + */ + /** + * Sample code: List available operations for the container service resource provider. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listAvailableOperationsForTheContainerServiceResourceProvider( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsDelete.json + */ + /** + * Sample code: Delete Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deletePrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections().delete("rg1", "clustername1", "privateendpointconnection1", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsGet.json + */ + /** + * Sample code: Get Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getPrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("rg1", "clustername1", "privateendpointconnection1", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsList.json + */ + /** + * Sample code: List Private Endpoint Connections by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listPrivateEndpointConnectionsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections().listWithResponse("rg1", "clustername1", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Update. */ +public final class PrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsUpdate.json + */ + /** + * Sample code: Update Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updatePrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .privateEndpointConnections() + .updateWithResponse( + "rg1", + "clustername1", + "privateendpointconnection1", + new PrivateEndpointConnectionInner() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED)), + Context.NONE); + } +} +``` + +### PrivateLinkResources_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources List. */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateLinkResourcesList.json + */ + /** + * Sample code: List Private Link Resources by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listPrivateLinkResourcesByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateLinkResources().listWithResponse("rg1", "clustername1", Context.NONE); + } +} +``` + +### ResolvePrivateLinkServiceId_Post + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; + +/** Samples for ResolvePrivateLinkServiceId Post. */ +public final class ResolvePrivateLinkServiceIdPostSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ResolvePrivateLinkServiceId.json + */ + /** + * Sample code: Resolve the Private Link Service ID for Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void resolveThePrivateLinkServiceIDForManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .resolvePrivateLinkServiceIds() + .postWithResponse( + "rg1", "clustername1", new PrivateLinkResourceInner().withName("management"), Context.NONE); + } +} +``` + +### Snapshots_CreateOrUpdate + +```java +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Snapshots CreateOrUpdate. */ +public final class SnapshotsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsCreate.json + */ + /** + * Sample code: Create/Update Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .snapshots() + .define("snapshot1") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "val1", "key2", "val2")) + .withCreationData( + new CreationData() + .withSourceResourceId( + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Snapshots_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Snapshots Delete. */ +public final class SnapshotsDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsDelete.json + */ + /** + * Sample code: Delete Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().deleteWithResponse("rg1", "snapshot1", Context.NONE); + } +} +``` + +### Snapshots_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Snapshots GetByResourceGroup. */ +public final class SnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsGet.json + */ + /** + * Sample code: Get Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().getByResourceGroupWithResponse("rg1", "snapshot1", Context.NONE); + } +} +``` + +### Snapshots_List + +```java +import com.azure.core.util.Context; + +/** Samples for Snapshots List. */ +public final class SnapshotsListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsList.json + */ + /** + * Sample code: List Snapshots. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listSnapshots( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().list(Context.NONE); + } +} +``` + +### Snapshots_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Snapshots ListByResourceGroup. */ +public final class SnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsListByResourceGroup.json + */ + /** + * Sample code: List Snapshots by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listSnapshotsByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().listByResourceGroup("rg1", Context.NONE); + } +} +``` + +### Snapshots_UpdateTags + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Snapshots UpdateTags. */ +public final class SnapshotsUpdateTagsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsUpdateTags.json + */ + /** + * Sample code: Update Snapshot Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateSnapshotTags( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + Snapshot resource = + manager.snapshots().getByResourceGroupWithResponse("rg1", "snapshot1", Context.NONE).getValue(); + resource.update().withTags(mapOf("key2", "new-val2", "key3", "val3")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + 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..209aab25fc7fd --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/pom.xml @@ -0,0 +1,55 @@ + + 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-preview-2022-03. + 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 + true + + + + com.azure + azure-core + 1.27.0 + + + com.azure + azure-core-management + 1.5.4 + + + 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..93e788f6b8399 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/ContainerServiceManager.java @@ -0,0 +1,403 @@ +// 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.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +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.RetryOptions; +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.ManagedClusterSnapshotsImpl; +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.ManagedClusterSnapshots; +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; +import java.util.stream.Collectors; + +/** 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 ManagedClusterSnapshots managedClusterSnapshots; + + 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); + } + + /** + * Creates an instance of ContainerService service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ContainerService service API instance. + */ + public static ContainerServiceManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ContainerServiceManager(httpPipeline, profile, null); + } + + /** + * 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 static 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 RetryOptions retryOptions; + 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 retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' 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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + 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 Resource collection API of ManagedClusterSnapshots. */ + public ManagedClusterSnapshots managedClusterSnapshots() { + if (this.managedClusterSnapshots == null) { + this.managedClusterSnapshots = + new ManagedClusterSnapshotsImpl(clientObject.getManagedClusterSnapshots(), this); + } + return managedClusterSnapshots; + } + + /** + * @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..d52cedfbd3122 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/AgentPoolsClient.java @@ -0,0 +1,367 @@ +// 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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String agentPoolName, String ignorePodDisruptionBudget); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String resourceName, + String agentPoolName, + String ignorePodDisruptionBudget, + Context context); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, String ignorePodDisruptionBudget); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @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, + String ignorePodDisruptionBudget, + Context context); + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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..ba1f3d6acbaa6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServiceManagementClient.java @@ -0,0 +1,117 @@ +// 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(); + + /** + * Gets the ManagedClusterSnapshotsClient object to access its operations. + * + * @return the ManagedClusterSnapshotsClient object. + */ + ManagedClusterSnapshotsClient getManagedClusterSnapshots(); +} 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..a31d5bfb8bd19 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ContainerServicesClient.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.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.OrchestratorVersionProfileListResultInner; + +/** An instance of this class provides access to all the operations defined in ContainerServicesClient. */ +public interface ContainerServicesClient { + /** + * 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 along with {@link Response}. + */ + @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..a91cd0c7e6b41 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/MaintenanceConfigurationsClient.java @@ -0,0 +1,142 @@ +// 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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster. + */ + @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. The name is case insensitive. + * @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 planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster + * along with {@link Response}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link 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/ManagedClusterSnapshotsClient.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClusterSnapshotsClient.java new file mode 100644 index 0000000000000..6b78383715af9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClusterSnapshotsClient.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.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.ManagedClusterSnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ManagedClusterSnapshotsClient. */ +public interface ManagedClusterSnapshotsClient { + /** + * Gets a list of managed cluster 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 managed cluster snapshots in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of managed cluster 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 managed cluster snapshots in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Cluster Snapshots operation as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 Cluster Snapshots operation as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterSnapshotInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Gets a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Creates or updates a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster 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 managed cluster snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterSnapshotInner createOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterSnapshotInner parameters); + + /** + * Creates or updates a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster 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 managed cluster snapshot resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String resourceName, ManagedClusterSnapshotInner parameters, Context context); + + /** + * Updates tags on a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update managed cluster 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 managed cluster snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedClusterSnapshotInner updateTags(String resourceGroupName, String resourceName, TagsObject parameters); + + /** + * Updates tags on a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update managed cluster 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 managed cluster snapshot resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateTagsWithResponse( + String resourceGroupName, String resourceName, TagsObject parameters, Context context); + + /** + * Deletes a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link 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/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..e9c2252620f0a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/ManagedClustersClient.java @@ -0,0 +1,967 @@ +// 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.Format; +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 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 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 along with {@link Response}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link 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. The name is case insensitive. + * @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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return + * azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin + * binary in the path. + * @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Format format, Context context); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedClusterInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterInner parameters); + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedClusterInner> beginUpdateTags( + String resourceGroupName, String resourceName, TagsObject parameters); + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String ignorePodDisruptionBudget); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String ignorePodDisruptionBudget, Context context); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ignorePodDisruptionBudget); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @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 ignorePodDisruptionBudget, 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRotateServiceAccountSigningKeys( + String resourceGroupName, String resourceName); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRotateServiceAccountSigningKeys( + String resourceGroupName, String resourceName, Context context); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 rotateServiceAccountSigningKeys(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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of run command result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of run command result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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..8916ce884f843 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/OpenShiftManagedClustersClient.java @@ -0,0 +1,277 @@ +// 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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 along with {@link + * Response}. + */ + @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 the {@link SyncPoller} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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..061a5e6641439 --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..227dcff7fab02 --- /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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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..973c143941042 --- /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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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..48517dfd6ca23 --- /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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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..4ca9493f496bb --- /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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link 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/AccessProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AccessProfile.java new file mode 100644 index 0000000000000..22bf40cc54bfa --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AccessProfile.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Profile for enabling a user to access a managed cluster. */ +@Fluent +public final class AccessProfile { + /* + * Base64-encoded Kubernetes configuration file. + */ + @JsonProperty(value = "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 AccessProfile object itself. + */ + public AccessProfile withKubeConfig(byte[] kubeConfig) { + this.kubeConfig = CoreUtils.clone(kubeConfig); + 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/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..126956c2840ed --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsInner.java @@ -0,0 +1,117 @@ +// 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.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of available versions for an agent pool. */ +@Fluent +public final class AgentPoolAvailableVersionsInner { + /* + * 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; + + /* + * Properties of agent pool available versions. + */ + @JsonProperty(value = "properties", required = true) + private AgentPoolAvailableVersionsProperties innerProperties = new AgentPoolAvailableVersionsProperties(); + + /** + * 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 innerProperties property: Properties of agent pool available versions. + * + * @return the innerProperties value. + */ + private AgentPoolAvailableVersionsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the agentPoolVersions property: List of versions available for agent pool. + * + * @return the agentPoolVersions value. + */ + public List agentPoolVersions() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolAvailableVersionsProperties(); + } + this.innerProperties().withAgentPoolVersions(agentPoolVersions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model AgentPoolAvailableVersionsInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AgentPoolAvailableVersionsInner.class); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsProperties.java new file mode 100644 index 0000000000000..925c2cc1d932b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolAvailableVersionsProperties.java @@ -0,0 +1,52 @@ +// 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.resourcemanager.containerservice.generated.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of available agent pool versions. */ +@Fluent +public final class AgentPoolAvailableVersionsProperties { + /* + * List of versions available for agent pool. + */ + @JsonProperty(value = "agentPoolVersions") + private List agentPoolVersions; + + /** + * 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 AgentPoolAvailableVersionsProperties object itself. + */ + public AgentPoolAvailableVersionsProperties 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..0e0683270ff2b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolInner.java @@ -0,0 +1,1179 @@ +// 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.management.SubResource; +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.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Agent Pool. */ +@Fluent +public final class AgentPoolInner extends SubResource { + /* + * Properties of an agent pool. + */ + @JsonProperty(value = "properties") + private ManagedClusterAgentPoolProfileProperties innerProperties; + + /* + * 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 innerProperties property: Properties of an agent pool. + * + * @return the innerProperties value. + */ + private ManagedClusterAgentPoolProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withCount(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withVmSize(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withOsDiskSizeGB(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withOsDiskType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withKubeletDiskType(kubeletDiskType); + return this; + } + + /** + * Get the workloadRuntime property: Determines the type of workload a node can run. + * + * @return the workloadRuntime value. + */ + public WorkloadRuntime workloadRuntime() { + return this.innerProperties() == null ? null : this.innerProperties().workloadRuntime(); + } + + /** + * Set the workloadRuntime property: Determines the type of workload a node can run. + * + * @param workloadRuntime the workloadRuntime value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withWorkloadRuntime(WorkloadRuntime workloadRuntime) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withWorkloadRuntime(workloadRuntime); + return this; + } + + /** + * Get the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A base64-encoded string + * which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux + * nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not + * be executed as a script). + * + * @return the messageOfTheDay value. + */ + public String messageOfTheDay() { + return this.innerProperties() == null ? null : this.innerProperties().messageOfTheDay(); + } + + /** + * Set the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A base64-encoded string + * which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux + * nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not + * be executed as a script). + * + * @param messageOfTheDay the messageOfTheDay value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withMessageOfTheDay(String messageOfTheDay) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withMessageOfTheDay(messageOfTheDay); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withVnetSubnetId(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withPodSubnetId(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withMaxPods(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withOsType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withOsSku(osSku); + return this; + } + + /** + * Get the maxCount property: The maximum number of nodes for auto-scaling. + * + * @return the maxCount value. + */ + public Integer maxCount() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withMaxCount(maxCount); + return this; + } + + /** + * Get the minCount property: The minimum number of nodes for auto-scaling. + * + * @return the minCount value. + */ + public Integer minCount() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withMinCount(minCount); + return this; + } + + /** + * Get the enableAutoScaling property: Whether to enable auto-scaler. + * + * @return the enableAutoScaling value. + */ + public Boolean enableAutoScaling() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withEnableAutoScaling(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withScaleDownMode(scaleDownMode); + return this; + } + + /** + * Get the type property: The type of Agent Pool. + * + * @return the type value. + */ + public AgentPoolType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: The type of Agent Pool. + * + * @param type the type value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withTypePropertiesType(AgentPoolType type) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withMode(mode); + return this; + } + + /** + * Get the orchestratorVersion property: The version of Kubernetes specified by the user. Both patch version + * <major.minor.patch> and <major.minor> are supported. When <major.minor> is specified, the + * latest supported patch version is chosen automatically. Updating the agent pool with the same <major.minor> + * once it has been created will not trigger an upgrade, even if a newer patch version is available. 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.innerProperties() == null ? null : this.innerProperties().orchestratorVersion(); + } + + /** + * Set the orchestratorVersion property: The version of Kubernetes specified by the user. Both patch version + * <major.minor.patch> and <major.minor> are supported. When <major.minor> is specified, the + * latest supported patch version is chosen automatically. Updating the agent pool with the same <major.minor> + * once it has been created will not trigger an upgrade, even if a newer patch version is available. 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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withOrchestratorVersion(orchestratorVersion); + return this; + } + + /** + * Get the currentOrchestratorVersion property: The version of Kubernetes running on the Agent Pool. If + * orchestratorVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to + * it. If orchestratorVersion was <major.minor>, this field will contain the full <major.minor.patch> + * version being used. + * + * @return the currentOrchestratorVersion value. + */ + public String currentOrchestratorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().currentOrchestratorVersion(); + } + + /** + * Set the currentOrchestratorVersion property: The version of Kubernetes running on the Agent Pool. If + * orchestratorVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to + * it. If orchestratorVersion was <major.minor>, this field will contain the full <major.minor.patch> + * version being used. + * + * @param currentOrchestratorVersion the currentOrchestratorVersion value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withCurrentOrchestratorVersion(String currentOrchestratorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withCurrentOrchestratorVersion(currentOrchestratorVersion); + return this; + } + + /** + * Get the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + public String nodeImageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().nodeImageVersion(); + } + + /** + * Get the upgradeSettings property: Settings for upgrading the agentpool. + * + * @return the upgradeSettings value. + */ + public AgentPoolUpgradeSettings upgradeSettings() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withUpgradeSettings(upgradeSettings); + return this; + } + + /** + * Get the provisioningState property: The current deployment or provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the powerState property: When an Agent Pool is first created it is initially Running. The Agent Pool can be + * stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing + * charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.innerProperties() == null ? null : this.innerProperties().powerState(); + } + + /** + * Set the powerState property: When an Agent Pool is first created it is initially Running. The Agent Pool can be + * stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing + * charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. + * + * @param powerState the powerState value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withPowerState(PowerState powerState) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withPowerState(powerState); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withAvailabilityZones(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withEnableNodePublicIp(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withNodePublicIpPrefixId(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withScaleSetPriority(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withScaleSetEvictionPolicy(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withSpotMaxPrice(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withTags(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withNodeLabels(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withNodeTaints(nodeTaints); + return this; + } + + /** + * Get the proximityPlacementGroupId property: The ID for Proximity Placement Group. + * + * @return the proximityPlacementGroupId value. + */ + public String proximityPlacementGroupId() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withProximityPlacementGroupId(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withKubeletConfig(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withLinuxOSConfig(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withEnableEncryptionAtHost(enableEncryptionAtHost); + return this; + } + + /** + * Get the enableUltraSsd property: Whether to enable UltraSSD. + * + * @return the enableUltraSsd value. + */ + public Boolean enableUltraSsd() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withEnableUltraSsd(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withEnableFips(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withGpuInstanceProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withCreationData(creationData); + return this; + } + + /** + * Get the capacityReservationGroupId property: AKS will associate the specified agent pool with the Capacity + * Reservation Group. + * + * @return the capacityReservationGroupId value. + */ + public String capacityReservationGroupId() { + return this.innerProperties() == null ? null : this.innerProperties().capacityReservationGroupId(); + } + + /** + * Set the capacityReservationGroupId property: AKS will associate the specified agent pool with the Capacity + * Reservation Group. + * + * @param capacityReservationGroupId the capacityReservationGroupId value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withCapacityReservationGroupId(String capacityReservationGroupId) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withCapacityReservationGroupId(capacityReservationGroupId); + return this; + } + + /** + * Get the hostGroupId property: The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once set. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + * For more information see [Azure dedicated + * hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + * + * @return the hostGroupId value. + */ + public String hostGroupId() { + return this.innerProperties() == null ? null : this.innerProperties().hostGroupId(); + } + + /** + * Set the hostGroupId property: The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once set. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + * For more information see [Azure dedicated + * hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + * + * @param hostGroupId the hostGroupId value to set. + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withHostGroupId(String hostGroupId) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterAgentPoolProfileProperties(); + } + this.innerProperties().withHostGroupId(hostGroupId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..66b3d509d6be3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileInner.java @@ -0,0 +1,186 @@ +// 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.AgentPoolUpgradeProfilePropertiesUpgradesItem; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of available upgrades for an agent pool. */ +@Fluent +public final class AgentPoolUpgradeProfileInner { + /* + * 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 properties of the agent pool upgrade profile. + */ + @JsonProperty(value = "properties", required = true) + private AgentPoolUpgradeProfileProperties innerProperties = new AgentPoolUpgradeProfileProperties(); + + /** + * 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 innerProperties property: The properties of the agent pool upgrade profile. + * + * @return the innerProperties value. + */ + private AgentPoolUpgradeProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the kubernetesVersion property: The Kubernetes version (major.minor.patch). + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolUpgradeProfileProperties(); + } + this.innerProperties().withKubernetesVersion(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolUpgradeProfileProperties(); + } + this.innerProperties().withOsType(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolUpgradeProfileProperties(); + } + this.innerProperties().withUpgrades(upgrades); + return this; + } + + /** + * Get the latestNodeImageVersion property: The latest AKS supported node image version. + * + * @return the latestNodeImageVersion value. + */ + public String latestNodeImageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AgentPoolUpgradeProfileProperties(); + } + this.innerProperties().withLatestNodeImageVersion(latestNodeImageVersion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model AgentPoolUpgradeProfileInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AgentPoolUpgradeProfileInner.class); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileProperties.java new file mode 100644 index 0000000000000..74e018fac2701 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/AgentPoolUpgradeProfileProperties.java @@ -0,0 +1,147 @@ +// 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.AgentPoolUpgradeProfilePropertiesUpgradesItem; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of available upgrade versions. */ +@Fluent +public final class AgentPoolUpgradeProfileProperties { + /* + * The Kubernetes version (major.minor.patch). + */ + @JsonProperty(value = "kubernetesVersion", required = true) + private String kubernetesVersion; + + /* + * 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; + + /* + * The latest AKS supported node image version. + */ + @JsonProperty(value = "latestNodeImageVersion") + private String latestNodeImageVersion; + + /** + * 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 AgentPoolUpgradeProfileProperties object itself. + */ + public AgentPoolUpgradeProfileProperties 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 AgentPoolUpgradeProfileProperties object itself. + */ + public AgentPoolUpgradeProfileProperties 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 AgentPoolUpgradeProfileProperties object itself. + */ + public AgentPoolUpgradeProfileProperties 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 AgentPoolUpgradeProfileProperties object itself. + */ + public AgentPoolUpgradeProfileProperties 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 AgentPoolUpgradeProfileProperties")); + } + if (osType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osType in model AgentPoolUpgradeProfileProperties")); + } + if (upgrades() != null) { + upgrades().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AgentPoolUpgradeProfileProperties.class); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CommandResultProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CommandResultProperties.java new file mode 100644 index 0000000000000..11b17f4583106 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CommandResultProperties.java @@ -0,0 +1,111 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The results of a run command. */ +@Immutable +public final class CommandResultProperties { + /* + * provisioning State + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The exit code of the command + */ + @JsonProperty(value = "exitCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer exitCode; + + /* + * The time when the command started. + */ + @JsonProperty(value = "startedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startedAt; + + /* + * The time when the command finished. + */ + @JsonProperty(value = "finishedAt", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime finishedAt; + + /* + * The command output. + */ + @JsonProperty(value = "logs", access = JsonProperty.Access.WRITE_ONLY) + private String logs; + + /* + * An explanation of why provisioningState is set to failed (if so). + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * 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/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..fb544c099a14d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/CredentialResultsInner.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list credential result response. */ +@Immutable +public final class CredentialResultsInner { + /* + * 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..0596eebc86bb5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SubResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster. See [planned + * maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned + * maintenance. + */ +@Fluent +public final class MaintenanceConfigurationInner extends SubResource { + /* + * The system metadata relating to this resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Properties of a default maintenance configuration. + */ + @JsonProperty(value = "properties") + private MaintenanceConfigurationProperties innerProperties; + + /* + * 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 innerProperties property: Properties of a default maintenance configuration. + * + * @return the innerProperties value. + */ + private MaintenanceConfigurationProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new MaintenanceConfigurationProperties(); + } + this.innerProperties().withTimeInWeek(timeInWeek); + return this; + } + + /** + * Get the notAllowedTime property: Time slots on which upgrade is not allowed. + * + * @return the notAllowedTime value. + */ + public List notAllowedTime() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new MaintenanceConfigurationProperties(); + } + this.innerProperties().withNotAllowedTime(notAllowedTime); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationProperties.java new file mode 100644 index 0000000000000..3aa6fd40ffcfc --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/MaintenanceConfigurationProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties used to configure planned maintenance for a Managed Cluster. */ +@Fluent +public final class MaintenanceConfigurationProperties { + /* + * 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 = "timeInWeek") + private List timeInWeek; + + /* + * Time slots on which upgrade is not allowed. + */ + @JsonProperty(value = "notAllowedTime") + private List notAllowedTime; + + /** + * 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 MaintenanceConfigurationProperties object itself. + */ + public MaintenanceConfigurationProperties 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 MaintenanceConfigurationProperties object itself. + */ + public MaintenanceConfigurationProperties withNotAllowedTime(List notAllowedTime) { + this.notAllowedTime = notAllowedTime; + 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..2185f00b0e489 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAccessProfileInner.java @@ -0,0 +1,94 @@ +// 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.management.Resource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed cluster Access Profile. */ +@Fluent +public final class ManagedClusterAccessProfileInner extends Resource { + /* + * AccessProfile of a managed cluster. + */ + @JsonProperty(value = "properties") + private AccessProfile innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: AccessProfile of a managed cluster. + * + * @return the innerProperties value. + */ + private AccessProfile innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAccessProfileInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAccessProfileInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the kubeConfig property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeConfig value. + */ + public byte[] kubeConfig() { + return this.innerProperties() == null ? new byte[0] : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new AccessProfile(); + } + this.innerProperties().withKubeConfig(kubeConfig); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAgentPoolProfileProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAgentPoolProfileProperties.java new file mode 100644 index 0000000000000..269939612f1c6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterAgentPoolProfileProperties.java @@ -0,0 +1,1356 @@ +// 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.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.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime; +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 { + /* + * 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; + + /* + * Determines the type of workload a node can run. + */ + @JsonProperty(value = "workloadRuntime") + private WorkloadRuntime workloadRuntime; + + /* + * Message of the day for Linux nodes, base64-encoded. A base64-encoded + * string which will be written to /etc/motd after decoding. This allows + * customization of the message of the day for Linux nodes. It must not be + * specified for Windows nodes. It must be a static string (i.e., will be + * printed raw and not be executed as a script). + */ + @JsonProperty(value = "messageOfTheDay") + private String messageOfTheDay; + + /* + * 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 specified by the user. Both patch version + * and are supported. When + * is specified, the latest supported patch version is chosen + * automatically. Updating the agent pool with the same once + * it has been created will not trigger an upgrade, even if a newer patch + * version is available. 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 Kubernetes running on the Agent Pool. If + * orchestratorVersion was a fully specified version , + * this field will be exactly equal to it. If orchestratorVersion was + * , this field will contain the full + * version being used. + */ + @JsonProperty(value = "currentOrchestratorVersion") + private String currentOrchestratorVersion; + + /* + * 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; + + /* + * When an Agent Pool is first created it is initially Running. The Agent + * Pool can be stopped by setting this field to Stopped. A stopped Agent + * Pool stops all of its VMs and does not accrue billing charges. An Agent + * Pool can only be stopped if it is Running and provisioning state is + * Succeeded + */ + @JsonProperty(value = "powerState") + 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; + + /* + * AKS will associate the specified agent pool with the Capacity + * Reservation Group. + */ + @JsonProperty(value = "capacityReservationGroupID") + private String capacityReservationGroupId; + + /* + * The fully qualified resource ID of the Dedicated Host Group to provision + * virtual machines from, used only in creation scenario and not allowed to + * changed once set. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + * For more information see [Azure dedicated + * hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + */ + @JsonProperty(value = "hostGroupID") + private String hostGroupId; + + /** + * 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 workloadRuntime property: Determines the type of workload a node can run. + * + * @return the workloadRuntime value. + */ + public WorkloadRuntime workloadRuntime() { + return this.workloadRuntime; + } + + /** + * Set the workloadRuntime property: Determines the type of workload a node can run. + * + * @param workloadRuntime the workloadRuntime value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withWorkloadRuntime(WorkloadRuntime workloadRuntime) { + this.workloadRuntime = workloadRuntime; + return this; + } + + /** + * Get the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A base64-encoded string + * which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux + * nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not + * be executed as a script). + * + * @return the messageOfTheDay value. + */ + public String messageOfTheDay() { + return this.messageOfTheDay; + } + + /** + * Set the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A base64-encoded string + * which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux + * nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not + * be executed as a script). + * + * @param messageOfTheDay the messageOfTheDay value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withMessageOfTheDay(String messageOfTheDay) { + this.messageOfTheDay = messageOfTheDay; + 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 specified by the user. Both patch version + * <major.minor.patch> and <major.minor> are supported. When <major.minor> is specified, the + * latest supported patch version is chosen automatically. Updating the agent pool with the same <major.minor> + * once it has been created will not trigger an upgrade, even if a newer patch version is available. 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 specified by the user. Both patch version + * <major.minor.patch> and <major.minor> are supported. When <major.minor> is specified, the + * latest supported patch version is chosen automatically. Updating the agent pool with the same <major.minor> + * once it has been created will not trigger an upgrade, even if a newer patch version is available. 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 currentOrchestratorVersion property: The version of Kubernetes running on the Agent Pool. If + * orchestratorVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to + * it. If orchestratorVersion was <major.minor>, this field will contain the full <major.minor.patch> + * version being used. + * + * @return the currentOrchestratorVersion value. + */ + public String currentOrchestratorVersion() { + return this.currentOrchestratorVersion; + } + + /** + * Set the currentOrchestratorVersion property: The version of Kubernetes running on the Agent Pool. If + * orchestratorVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to + * it. If orchestratorVersion was <major.minor>, this field will contain the full <major.minor.patch> + * version being used. + * + * @param currentOrchestratorVersion the currentOrchestratorVersion value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withCurrentOrchestratorVersion(String currentOrchestratorVersion) { + this.currentOrchestratorVersion = currentOrchestratorVersion; + 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: When an Agent Pool is first created it is initially Running. The Agent Pool can be + * stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing + * charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.powerState; + } + + /** + * Set the powerState property: When an Agent Pool is first created it is initially Running. The Agent Pool can be + * stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing + * charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. + * + * @param powerState the powerState value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withPowerState(PowerState powerState) { + this.powerState = powerState; + return this; + } + + /** + * 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; + } + + /** + * Get the capacityReservationGroupId property: AKS will associate the specified agent pool with the Capacity + * Reservation Group. + * + * @return the capacityReservationGroupId value. + */ + public String capacityReservationGroupId() { + return this.capacityReservationGroupId; + } + + /** + * Set the capacityReservationGroupId property: AKS will associate the specified agent pool with the Capacity + * Reservation Group. + * + * @param capacityReservationGroupId the capacityReservationGroupId value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withCapacityReservationGroupId(String capacityReservationGroupId) { + this.capacityReservationGroupId = capacityReservationGroupId; + return this; + } + + /** + * Get the hostGroupId property: The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once set. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + * For more information see [Azure dedicated + * hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + * + * @return the hostGroupId value. + */ + public String hostGroupId() { + return this.hostGroupId; + } + + /** + * Set the hostGroupId property: The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once set. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + * For more information see [Azure dedicated + * hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + * + * @param hostGroupId the hostGroupId value to set. + * @return the ManagedClusterAgentPoolProfileProperties object itself. + */ + public ManagedClusterAgentPoolProfileProperties withHostGroupId(String hostGroupId) { + this.hostGroupId = hostGroupId; + 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/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..cdaf906ced39e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterInner.java @@ -0,0 +1,934 @@ +// 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.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +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.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterOidcIssuerProfile; +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.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Managed cluster. */ +@Fluent +public final class ManagedClusterInner extends Resource { + /* + * 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; + + /* + * Properties of a managed cluster. + */ + @JsonProperty(value = "properties") + private ManagedClusterProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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 innerProperties property: Properties of a managed cluster. + * + * @return the innerProperties value. + */ + private ManagedClusterProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the powerState property: The Power State of the cluster. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.innerProperties() == null ? null : this.innerProperties().powerState(); + } + + /** + * Get the creationData property: CreationData to be used to specify the source Snapshot ID if the cluster will be + * created/upgraded using a snapshot. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.innerProperties() == null ? null : this.innerProperties().creationData(); + } + + /** + * Set the creationData property: CreationData to be used to specify the source Snapshot ID if the cluster will be + * created/upgraded using a snapshot. + * + * @param creationData the creationData value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withCreationData(CreationData creationData) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withCreationData(creationData); + return this; + } + + /** + * Get the maxAgentPools property: The max number of agent pools for the managed cluster. + * + * @return the maxAgentPools value. + */ + public Integer maxAgentPools() { + return this.innerProperties() == null ? null : this.innerProperties().maxAgentPools(); + } + + /** + * Get the kubernetesVersion property: The version of Kubernetes the Managed Cluster is requested to run. 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.innerProperties() == null ? null : this.innerProperties().kubernetesVersion(); + } + + /** + * Set the kubernetesVersion property: The version of Kubernetes the Managed Cluster is requested to run. 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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withKubernetesVersion(kubernetesVersion); + return this; + } + + /** + * Get the currentKubernetesVersion property: The version of Kubernetes the Managed Cluster is running. + * + * @return the currentKubernetesVersion value. + */ + public String currentKubernetesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().currentKubernetesVersion(); + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withDnsPrefix(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withFqdnSubdomain(fqdnSubdomain); + return this; + } + + /** + * Get the fqdn property: The FQDN of the master pool. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerProperties() == null ? null : this.innerProperties().fqdn(); + } + + /** + * Get the privateFqdn property: The FQDN of private cluster. + * + * @return the privateFqdn value. + */ + public String privateFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().azurePortalFqdn(); + } + + /** + * Get the agentPoolProfiles property: The agent pool properties. + * + * @return the agentPoolProfiles value. + */ + public List agentPoolProfiles() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAgentPoolProfiles(agentPoolProfiles); + return this; + } + + /** + * Get the linuxProfile property: The profile for Linux VMs in the Managed Cluster. + * + * @return the linuxProfile value. + */ + public ContainerServiceLinuxProfile linuxProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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(ContainerServiceLinuxProfile linuxProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withLinuxProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withWindowsProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withServicePrincipalProfile(servicePrincipalProfile); + return this; + } + + /** + * Get the addonProfiles property: The profile of managed cluster add-on. + * + * @return the addonProfiles value. + */ + public Map addonProfiles() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAddonProfiles(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withPodIdentityProfile(podIdentityProfile); + return this; + } + + /** + * Get the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster. + * + * @return the oidcIssuerProfile value. + */ + public ManagedClusterOidcIssuerProfile oidcIssuerProfile() { + return this.innerProperties() == null ? null : this.innerProperties().oidcIssuerProfile(); + } + + /** + * Set the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster. + * + * @param oidcIssuerProfile the oidcIssuerProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withOidcIssuerProfile(ManagedClusterOidcIssuerProfile oidcIssuerProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withOidcIssuerProfile(oidcIssuerProfile); + 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withNodeResourceGroup(nodeResourceGroup); + return this; + } + + /** + * Get the enableRbac property: Whether to enable Kubernetes Role-Based Access Control. + * + * @return the enableRbac value. + */ + public Boolean enableRbac() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withEnableRbac(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withEnablePodSecurityPolicy(enablePodSecurityPolicy); + return this; + } + + /** + * Get the enableNamespaceResources property: Enable namespace as Azure resource. The default value is false. It can + * be enabled/disabled on creation and updation of the managed cluster. See + * [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM + * Resource. + * + * @return the enableNamespaceResources value. + */ + public Boolean enableNamespaceResources() { + return this.innerProperties() == null ? null : this.innerProperties().enableNamespaceResources(); + } + + /** + * Set the enableNamespaceResources property: Enable namespace as Azure resource. The default value is false. It can + * be enabled/disabled on creation and updation of the managed cluster. See + * [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM + * Resource. + * + * @param enableNamespaceResources the enableNamespaceResources value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withEnableNamespaceResources(Boolean enableNamespaceResources) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withEnableNamespaceResources(enableNamespaceResources); + return this; + } + + /** + * Get the networkProfile property: The network configuration profile. + * + * @return the networkProfile value. + */ + public ContainerServiceNetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withNetworkProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAadProfile(aadProfile); + return this; + } + + /** + * Get the autoUpgradeProfile property: The auto upgrade configuration. + * + * @return the autoUpgradeProfile value. + */ + public ManagedClusterAutoUpgradeProfile autoUpgradeProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAutoUpgradeProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withAutoScalerProfile(autoScalerProfile); + return this; + } + + /** + * Get the apiServerAccessProfile property: The access profile for managed cluster API server. + * + * @return the apiServerAccessProfile value. + */ + public ManagedClusterApiServerAccessProfile apiServerAccessProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withApiServerAccessProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withDiskEncryptionSetId(diskEncryptionSetId); + return this; + } + + /** + * Get the identityProfile property: Identities associated with the cluster. + * + * @return the identityProfile value. + */ + public Map identityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withIdentityProfile(identityProfile); + return this; + } + + /** + * Get the privateLinkResources property: Private link resources associated with the cluster. + * + * @return the privateLinkResources value. + */ + public List privateLinkResources() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withPrivateLinkResources(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withDisableLocalAccounts(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withHttpProxyConfig(httpProxyConfig); + return this; + } + + /** + * Get the securityProfile property: Security profile for the managed cluster. + * + * @return the securityProfile value. + */ + public ManagedClusterSecurityProfile securityProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withSecurityProfile(securityProfile); + return this; + } + + /** + * Get the ingressProfile property: Ingress profile for the managed cluster. + * + * @return the ingressProfile value. + */ + public ManagedClusterIngressProfile ingressProfile() { + return this.innerProperties() == null ? null : this.innerProperties().ingressProfile(); + } + + /** + * Set the ingressProfile property: Ingress profile for the managed cluster. + * + * @param ingressProfile the ingressProfile value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withIngressProfile(ManagedClusterIngressProfile ingressProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withIngressProfile(ingressProfile); + return this; + } + + /** + * Get the publicNetworkAccess property: PublicNetworkAccess of the managedCluster Allow or deny public network + * access for AKS. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: PublicNetworkAccess of the managedCluster Allow or deny public network + * access for AKS. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ManagedClusterInner object itself. + */ + public ManagedClusterInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + 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 (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterProperties.java new file mode 100644 index 0000000000000..d63686e157a51 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterProperties.java @@ -0,0 +1,1026 @@ +// 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.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +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.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterOidcIssuerProfile; +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.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.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Properties of the managed cluster. */ +@Fluent +public final class ManagedClusterProperties { + /* + * The current provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The Power State of the cluster. + */ + @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) + private PowerState powerState; + + /* + * CreationData to be used to specify the source Snapshot ID if the cluster + * will be created/upgraded using a snapshot. + */ + @JsonProperty(value = "creationData") + private CreationData creationData; + + /* + * The max number of agent pools for the managed cluster. + */ + @JsonProperty(value = "maxAgentPools", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxAgentPools; + + /* + * The version of Kubernetes the Managed Cluster is requested to run. 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 = "kubernetesVersion") + private String kubernetesVersion; + + /* + * The version of Kubernetes the Managed Cluster is running. + */ + @JsonProperty(value = "currentKubernetesVersion", access = JsonProperty.Access.WRITE_ONLY) + private String currentKubernetesVersion; + + /* + * The DNS prefix of the Managed Cluster. This cannot be updated once the + * Managed Cluster has been created. + */ + @JsonProperty(value = "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 = "fqdnSubdomain") + private String fqdnSubdomain; + + /* + * The FQDN of the master pool. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * The FQDN of private cluster. + */ + @JsonProperty(value = "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 = "azurePortalFQDN", access = JsonProperty.Access.WRITE_ONLY) + private String azurePortalFqdn; + + /* + * The agent pool properties. + */ + @JsonProperty(value = "agentPoolProfiles") + private List agentPoolProfiles; + + /* + * The profile for Linux VMs in the Managed Cluster. + */ + @JsonProperty(value = "linuxProfile") + private ContainerServiceLinuxProfile linuxProfile; + + /* + * The profile for Windows VMs in the Managed Cluster. + */ + @JsonProperty(value = "windowsProfile") + private ManagedClusterWindowsProfile windowsProfile; + + /* + * Information about a service principal identity for the cluster to use + * for manipulating Azure APIs. + */ + @JsonProperty(value = "servicePrincipalProfile") + private ManagedClusterServicePrincipalProfile servicePrincipalProfile; + + /* + * The profile of managed cluster add-on. + */ + @JsonProperty(value = "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 = "podIdentityProfile") + private ManagedClusterPodIdentityProfile podIdentityProfile; + + /* + * The OIDC issuer profile of the Managed Cluster. + */ + @JsonProperty(value = "oidcIssuerProfile") + private ManagedClusterOidcIssuerProfile oidcIssuerProfile; + + /* + * The name of the resource group containing agent pool nodes. + */ + @JsonProperty(value = "nodeResourceGroup") + private String nodeResourceGroup; + + /* + * Whether to enable Kubernetes Role-Based Access Control. + */ + @JsonProperty(value = "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 = "enablePodSecurityPolicy") + private Boolean enablePodSecurityPolicy; + + /* + * Enable namespace as Azure resource. The default value is false. It can + * be enabled/disabled on creation and updation of the managed cluster. See + * [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) + * for more details on Namespace as a ARM Resource. + */ + @JsonProperty(value = "enableNamespaceResources") + private Boolean enableNamespaceResources; + + /* + * The network configuration profile. + */ + @JsonProperty(value = "networkProfile") + private ContainerServiceNetworkProfile networkProfile; + + /* + * AADProfile specifies attributes for Azure Active Directory integration. + * The Azure Active Directory configuration. + */ + @JsonProperty(value = "aadProfile") + private ManagedClusterAadProfile aadProfile; + + /* + * The auto upgrade configuration. + */ + @JsonProperty(value = "autoUpgradeProfile") + private ManagedClusterAutoUpgradeProfile autoUpgradeProfile; + + /* + * Parameters to be applied to the cluster-autoscaler when enabled + */ + @JsonProperty(value = "autoScalerProfile") + private ManagedClusterPropertiesAutoScalerProfile autoScalerProfile; + + /* + * The access profile for managed cluster API server. + */ + @JsonProperty(value = "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 = "diskEncryptionSetID") + private String diskEncryptionSetId; + + /* + * Identities associated with the cluster. + */ + @JsonProperty(value = "identityProfile") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map identityProfile; + + /* + * Private link resources associated with the cluster. + */ + @JsonProperty(value = "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 = "disableLocalAccounts") + private Boolean disableLocalAccounts; + + /* + * Configurations for provisioning the cluster with HTTP proxy servers. + */ + @JsonProperty(value = "httpProxyConfig") + private ManagedClusterHttpProxyConfig httpProxyConfig; + + /* + * Security profile for the managed cluster. + */ + @JsonProperty(value = "securityProfile") + private ManagedClusterSecurityProfile securityProfile; + + /* + * Ingress profile for the managed cluster. + */ + @JsonProperty(value = "ingressProfile") + private ManagedClusterIngressProfile ingressProfile; + + /* + * PublicNetworkAccess of the managedCluster Allow or deny public network + * access for AKS + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * 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 creationData property: CreationData to be used to specify the source Snapshot ID if the cluster 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 cluster will be + * created/upgraded using a snapshot. + * + * @param creationData the creationData value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withCreationData(CreationData creationData) { + this.creationData = creationData; + return this; + } + + /** + * 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 requested to run. 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 requested to run. 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withKubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + return this; + } + + /** + * Get the currentKubernetesVersion property: The version of Kubernetes the Managed Cluster is running. + * + * @return the currentKubernetesVersion value. + */ + public String currentKubernetesVersion() { + return this.currentKubernetesVersion; + } + + /** + * 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ContainerServiceLinuxProfile 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withLinuxProfile(ContainerServiceLinuxProfile 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withPodIdentityProfile(ManagedClusterPodIdentityProfile podIdentityProfile) { + this.podIdentityProfile = podIdentityProfile; + return this; + } + + /** + * Get the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster. + * + * @return the oidcIssuerProfile value. + */ + public ManagedClusterOidcIssuerProfile oidcIssuerProfile() { + return this.oidcIssuerProfile; + } + + /** + * Set the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster. + * + * @param oidcIssuerProfile the oidcIssuerProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withOidcIssuerProfile(ManagedClusterOidcIssuerProfile oidcIssuerProfile) { + this.oidcIssuerProfile = oidcIssuerProfile; + 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withEnablePodSecurityPolicy(Boolean enablePodSecurityPolicy) { + this.enablePodSecurityPolicy = enablePodSecurityPolicy; + return this; + } + + /** + * Get the enableNamespaceResources property: Enable namespace as Azure resource. The default value is false. It can + * be enabled/disabled on creation and updation of the managed cluster. See + * [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM + * Resource. + * + * @return the enableNamespaceResources value. + */ + public Boolean enableNamespaceResources() { + return this.enableNamespaceResources; + } + + /** + * Set the enableNamespaceResources property: Enable namespace as Azure resource. The default value is false. It can + * be enabled/disabled on creation and updation of the managed cluster. See + * [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM + * Resource. + * + * @param enableNamespaceResources the enableNamespaceResources value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withEnableNamespaceResources(Boolean enableNamespaceResources) { + this.enableNamespaceResources = enableNamespaceResources; + 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties 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 ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withSecurityProfile(ManagedClusterSecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * Get the ingressProfile property: Ingress profile for the managed cluster. + * + * @return the ingressProfile value. + */ + public ManagedClusterIngressProfile ingressProfile() { + return this.ingressProfile; + } + + /** + * Set the ingressProfile property: Ingress profile for the managed cluster. + * + * @param ingressProfile the ingressProfile value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withIngressProfile(ManagedClusterIngressProfile ingressProfile) { + this.ingressProfile = ingressProfile; + return this; + } + + /** + * Get the publicNetworkAccess property: PublicNetworkAccess of the managedCluster Allow or deny public network + * access for AKS. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: PublicNetworkAccess of the managedCluster Allow or deny public network + * access for AKS. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ManagedClusterProperties object itself. + */ + public ManagedClusterProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (powerState() != null) { + powerState().validate(); + } + if (creationData() != null) { + creationData().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 (oidcIssuerProfile() != null) { + oidcIssuerProfile().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(); + } + if (ingressProfile() != null) { + ingressProfile().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterSnapshotInner.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterSnapshotInner.java new file mode 100644 index 0000000000000..4622eae441c48 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterSnapshotInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesForSnapshot; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A managed cluster snapshot resource. */ +@Fluent +public final class ManagedClusterSnapshotInner extends Resource { + /* + * Properties of a managed cluster snapshot. + */ + @JsonProperty(value = "properties") + private ManagedClusterSnapshotProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Properties of a managed cluster snapshot. + * + * @return the innerProperties value. + */ + private ManagedClusterSnapshotProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterSnapshotInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterSnapshotInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the creationData property: CreationData to be used to specify the source resource ID to create this snapshot. + * + * @return the creationData value. + */ + public CreationData creationData() { + return this.innerProperties() == null ? null : this.innerProperties().creationData(); + } + + /** + * Set the creationData property: CreationData to be used to specify the source resource ID to create this snapshot. + * + * @param creationData the creationData value to set. + * @return the ManagedClusterSnapshotInner object itself. + */ + public ManagedClusterSnapshotInner withCreationData(CreationData creationData) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterSnapshotProperties(); + } + this.innerProperties().withCreationData(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.innerProperties() == null ? null : this.innerProperties().snapshotType(); + } + + /** + * Set the snapshotType property: The type of a snapshot. The default is NodePool. + * + * @param snapshotType the snapshotType value to set. + * @return the ManagedClusterSnapshotInner object itself. + */ + public ManagedClusterSnapshotInner withSnapshotType(SnapshotType snapshotType) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterSnapshotProperties(); + } + this.innerProperties().withSnapshotType(snapshotType); + return this; + } + + /** + * Get the managedClusterPropertiesReadOnly property: What the properties will be showed when getting managed + * cluster snapshot. Those properties are read-only. + * + * @return the managedClusterPropertiesReadOnly value. + */ + public ManagedClusterPropertiesForSnapshot managedClusterPropertiesReadOnly() { + return this.innerProperties() == null ? null : this.innerProperties().managedClusterPropertiesReadOnly(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterSnapshotProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterSnapshotProperties.java new file mode 100644 index 0000000000000..79628431e0541 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterSnapshotProperties.java @@ -0,0 +1,99 @@ +// 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.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesForSnapshot; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for a managed cluster snapshot. */ +@Fluent +public final class ManagedClusterSnapshotProperties { + /* + * CreationData to be used to specify the source resource ID to create this + * snapshot. + */ + @JsonProperty(value = "creationData") + private CreationData creationData; + + /* + * The type of a snapshot. The default is NodePool. + */ + @JsonProperty(value = "snapshotType") + private SnapshotType snapshotType; + + /* + * What the properties will be showed when getting managed cluster + * snapshot. Those properties are read-only. + */ + @JsonProperty(value = "managedClusterPropertiesReadOnly", access = JsonProperty.Access.WRITE_ONLY) + private ManagedClusterPropertiesForSnapshot managedClusterPropertiesReadOnly; + + /** + * Get the creationData property: CreationData to be used to specify the source 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 resource ID to create this snapshot. + * + * @param creationData the creationData value to set. + * @return the ManagedClusterSnapshotProperties object itself. + */ + public ManagedClusterSnapshotProperties 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 ManagedClusterSnapshotProperties object itself. + */ + public ManagedClusterSnapshotProperties withSnapshotType(SnapshotType snapshotType) { + this.snapshotType = snapshotType; + return this; + } + + /** + * Get the managedClusterPropertiesReadOnly property: What the properties will be showed when getting managed + * cluster snapshot. Those properties are read-only. + * + * @return the managedClusterPropertiesReadOnly value. + */ + public ManagedClusterPropertiesForSnapshot managedClusterPropertiesReadOnly() { + return this.managedClusterPropertiesReadOnly; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (creationData() != null) { + creationData().validate(); + } + if (managedClusterPropertiesReadOnly() != null) { + managedClusterPropertiesReadOnly().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..ce289be0e598a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPoolUpgradeProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of available upgrades for compute pools. */ +@Fluent +public final class ManagedClusterUpgradeProfileInner { + /* + * 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 properties of the upgrade profile. + */ + @JsonProperty(value = "properties", required = true) + private ManagedClusterUpgradeProfileProperties innerProperties = new ManagedClusterUpgradeProfileProperties(); + + /** + * 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 innerProperties property: The properties of the upgrade profile. + * + * @return the innerProperties value. + */ + private ManagedClusterUpgradeProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the controlPlaneProfile property: The list of available upgrade versions for the control plane. + * + * @return the controlPlaneProfile value. + */ + public ManagedClusterPoolUpgradeProfile controlPlaneProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterUpgradeProfileProperties(); + } + this.innerProperties().withControlPlaneProfile(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedClusterUpgradeProfileProperties(); + } + this.innerProperties().withAgentPoolProfiles(agentPoolProfiles); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ManagedClusterUpgradeProfileInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterUpgradeProfileInner.class); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileProperties.java new file mode 100644 index 0000000000000..3dbbd733cd0cf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/ManagedClusterUpgradeProfileProperties.java @@ -0,0 +1,96 @@ +// 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.ManagedClusterPoolUpgradeProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Control plane and agent pool upgrade profiles. */ +@Fluent +public final class ManagedClusterUpgradeProfileProperties { + /* + * The list of available upgrade versions for the control plane. + */ + @JsonProperty(value = "controlPlaneProfile", required = true) + private ManagedClusterPoolUpgradeProfile controlPlaneProfile; + + /* + * The list of available upgrade versions for agent pools. + */ + @JsonProperty(value = "agentPoolProfiles", required = true) + private List agentPoolProfiles; + + /** + * 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 ManagedClusterUpgradeProfileProperties object itself. + */ + public ManagedClusterUpgradeProfileProperties 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 ManagedClusterUpgradeProfileProperties object itself. + */ + public ManagedClusterUpgradeProfileProperties 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" + + " ManagedClusterUpgradeProfileProperties")); + } else { + controlPlaneProfile().validate(); + } + if (agentPoolProfiles() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property agentPoolProfiles in model ManagedClusterUpgradeProfileProperties")); + } else { + agentPoolProfiles().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterUpgradeProfileProperties.class); +} 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..cb4de20b5b433 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OSOptionProfileInner.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.models.OSOptionProperty; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The OS option profile. */ +@Fluent +public final class OSOptionProfileInner { + /* + * 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", required = true) + private OSOptionPropertyList innerProperties = new 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 innerProperties property: The list of OS options. + * + * @return the innerProperties value. + */ + private OSOptionPropertyList innerProperties() { + return this.innerProperties; + } + + /** + * Get the osOptionPropertyList property: The list of OS options. + * + * @return the osOptionPropertyList value. + */ + public List osOptionPropertyList() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OSOptionPropertyList(); + } + this.innerProperties().withOsOptionPropertyList(osOptionPropertyList); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model OSOptionProfileInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OSOptionProfileInner.class); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OSOptionPropertyList.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OSOptionPropertyList.java new file mode 100644 index 0000000000000..a4675d3c47e70 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OSOptionPropertyList.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.models.OSOptionProperty; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of OS option properties. */ +@Fluent +public final class OSOptionPropertyList { + /* + * The list of OS options. + */ + @JsonProperty(value = "osOptionPropertyList", required = true) + private List osOptionPropertyList; + + /** + * 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 OSOptionPropertyList object itself. + */ + public OSOptionPropertyList 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 OSOptionPropertyList")); + } else { + osOptionPropertyList().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OSOptionPropertyList.class); +} 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..73de47c0eda91 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OpenShiftManagedClusterInner.java @@ -0,0 +1,267 @@ +// 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.management.Resource; +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.JsonProperty; +import java.util.List; +import java.util.Map; + +/** OpenShift Managed cluster. */ +@Fluent +public final class OpenShiftManagedClusterInner extends Resource { + /* + * Define the resource plan as required by ARM for billing purposes + */ + @JsonProperty(value = "plan") + private PurchasePlan plan; + + /* + * Properties of a OpenShift managed cluster. + */ + @JsonProperty(value = "properties") + private OpenShiftManagedClusterProperties innerProperties; + + /** + * 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 innerProperties property: Properties of a OpenShift managed cluster. + * + * @return the innerProperties value. + */ + private OpenShiftManagedClusterProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public OpenShiftManagedClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public OpenShiftManagedClusterInner withTags(Map tags) { + super.withTags(tags); + 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.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the openShiftVersion property: Version of OpenShift specified when creating the cluster. + * + * @return the openShiftVersion value. + */ + public String openShiftVersion() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OpenShiftManagedClusterProperties(); + } + this.innerProperties().withOpenShiftVersion(openShiftVersion); + return this; + } + + /** + * Get the clusterVersion property: Version of OpenShift specified when creating the cluster. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.innerProperties() == null ? null : this.innerProperties().clusterVersion(); + } + + /** + * Get the publicHostname property: Service generated FQDN for OpenShift API server. + * + * @return the publicHostname value. + */ + public String publicHostname() { + return this.innerProperties() == null ? null : this.innerProperties().publicHostname(); + } + + /** + * Get the fqdn property: Service generated FQDN for OpenShift API server loadbalancer internal hostname. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerProperties() == null ? null : this.innerProperties().fqdn(); + } + + /** + * Get the networkProfile property: Configuration for OpenShift networking. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OpenShiftManagedClusterProperties(); + } + this.innerProperties().withNetworkProfile(networkProfile); + return this; + } + + /** + * Get the routerProfiles property: Configuration for OpenShift router(s). + * + * @return the routerProfiles value. + */ + public List routerProfiles() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OpenShiftManagedClusterProperties(); + } + this.innerProperties().withRouterProfiles(routerProfiles); + return this; + } + + /** + * Get the masterPoolProfile property: Configuration for OpenShift master VMs. + * + * @return the masterPoolProfile value. + */ + public OpenShiftManagedClusterMasterPoolProfile masterPoolProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OpenShiftManagedClusterProperties(); + } + this.innerProperties().withMasterPoolProfile(masterPoolProfile); + return this; + } + + /** + * Get the agentPoolProfiles property: Configuration of OpenShift cluster VMs. + * + * @return the agentPoolProfiles value. + */ + public List agentPoolProfiles() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OpenShiftManagedClusterProperties(); + } + this.innerProperties().withAgentPoolProfiles(agentPoolProfiles); + return this; + } + + /** + * Get the authProfile property: Configures OpenShift authentication. + * + * @return the authProfile value. + */ + public OpenShiftManagedClusterAuthProfile authProfile() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OpenShiftManagedClusterProperties(); + } + this.innerProperties().withAuthProfile(authProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (plan() != null) { + plan().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OpenShiftManagedClusterProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OpenShiftManagedClusterProperties.java new file mode 100644 index 0000000000000..962ed0ec6e777 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OpenShiftManagedClusterProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the OpenShift managed cluster. */ +@Fluent +public final class OpenShiftManagedClusterProperties { + /* + * The current deployment or provisioning state, which only appears in the + * response. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Version of OpenShift specified when creating the cluster. + */ + @JsonProperty(value = "openShiftVersion", required = true) + private String openShiftVersion; + + /* + * Version of OpenShift specified when creating the cluster. + */ + @JsonProperty(value = "clusterVersion", access = JsonProperty.Access.WRITE_ONLY) + private String clusterVersion; + + /* + * Service generated FQDN for OpenShift API server. + */ + @JsonProperty(value = "publicHostname", access = JsonProperty.Access.WRITE_ONLY) + private String publicHostname; + + /* + * Service generated FQDN for OpenShift API server loadbalancer internal + * hostname. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * Configuration for OpenShift networking. + */ + @JsonProperty(value = "networkProfile") + private NetworkProfile networkProfile; + + /* + * Configuration for OpenShift router(s). + */ + @JsonProperty(value = "routerProfiles") + private List routerProfiles; + + /* + * Configuration for OpenShift master VMs. + */ + @JsonProperty(value = "masterPoolProfile") + private OpenShiftManagedClusterMasterPoolProfile masterPoolProfile; + + /* + * Configuration of OpenShift cluster VMs. + */ + @JsonProperty(value = "agentPoolProfiles") + private List agentPoolProfiles; + + /* + * Configures OpenShift authentication. + */ + @JsonProperty(value = "authProfile") + private OpenShiftManagedClusterAuthProfile authProfile; + + /** + * 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 OpenShiftManagedClusterProperties object itself. + */ + public OpenShiftManagedClusterProperties 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 OpenShiftManagedClusterProperties object itself. + */ + public OpenShiftManagedClusterProperties 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 OpenShiftManagedClusterProperties object itself. + */ + public OpenShiftManagedClusterProperties 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 OpenShiftManagedClusterProperties object itself. + */ + public OpenShiftManagedClusterProperties 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 OpenShiftManagedClusterProperties object itself. + */ + public OpenShiftManagedClusterProperties 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 OpenShiftManagedClusterProperties object itself. + */ + public OpenShiftManagedClusterProperties withAuthProfile(OpenShiftManagedClusterAuthProfile authProfile) { + this.authProfile = authProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (openShiftVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property openShiftVersion in model OpenShiftManagedClusterProperties")); + } + 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OpenShiftManagedClusterProperties.class); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueDisplay.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueDisplay.java new file mode 100644 index 0000000000000..a1c9f9b402d45 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueDisplay.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.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a Operation Value Display. */ +@Immutable +public final class OperationValueDisplay { + /* + * The display name of the operation. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The display name of the resource the operation applies to. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The resource provider for the operation. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * 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/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..a832401feba61 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OperationValueInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of a Operation value. */ +@Fluent +public final class OperationValueInner { + /* + * 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; + + /* + * Describes the properties of a Operation Value Display. + */ + @JsonProperty(value = "display") + private OperationValueDisplay innerDisplay; + + /** + * 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 innerDisplay property: Describes the properties of a Operation Value Display. + * + * @return the innerDisplay value. + */ + private OperationValueDisplay innerDisplay() { + return this.innerDisplay; + } + + /** + * Get the operation property: The display name of the operation. + * + * @return the operation value. + */ + public String operation() { + return this.innerDisplay() == null ? null : this.innerDisplay().operation(); + } + + /** + * Get the resource property: The display name of the resource the operation applies to. + * + * @return the resource value. + */ + public String resource() { + return this.innerDisplay() == null ? null : this.innerDisplay().resource(); + } + + /** + * Get the description property: The description of the operation. + * + * @return the description value. + */ + public String description() { + return this.innerDisplay() == null ? null : this.innerDisplay().description(); + } + + /** + * Get the provider property: The resource provider for the operation. + * + * @return the provider value. + */ + public String provider() { + return this.innerDisplay() == null ? null : this.innerDisplay().provider(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerDisplay() != null) { + innerDisplay().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..97793bb35e4ed --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OrchestratorVersionProfileListResultInner.java @@ -0,0 +1,117 @@ +// 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.OrchestratorVersionProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of versions for supported orchestrators. */ +@Fluent +public final class OrchestratorVersionProfileListResultInner { + /* + * 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; + + /* + * The properties of an orchestrator version profile. + */ + @JsonProperty(value = "properties", required = true) + private OrchestratorVersionProfileProperties innerProperties = new OrchestratorVersionProfileProperties(); + + /** + * 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 innerProperties property: The properties of an orchestrator version profile. + * + * @return the innerProperties value. + */ + private OrchestratorVersionProfileProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the orchestrators property: List of orchestrator version profiles. + * + * @return the orchestrators value. + */ + public List orchestrators() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new OrchestratorVersionProfileProperties(); + } + this.innerProperties().withOrchestrators(orchestrators); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model" + + " OrchestratorVersionProfileListResultInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OrchestratorVersionProfileListResultInner.class); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OrchestratorVersionProfileProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OrchestratorVersionProfileProperties.java new file mode 100644 index 0000000000000..b086731426a1f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OrchestratorVersionProfileProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.containerservice.generated.models.OrchestratorVersionProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of an orchestrator version profile. */ +@Fluent +public final class OrchestratorVersionProfileProperties { + /* + * List of orchestrator version profiles. + */ + @JsonProperty(value = "orchestrators", required = true) + private List orchestrators; + + /** + * 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 OrchestratorVersionProfileProperties object itself. + */ + public OrchestratorVersionProfileProperties 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 OrchestratorVersionProfileProperties")); + } else { + orchestrators().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OrchestratorVersionProfileProperties.class); +} 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..b633cbc55720b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/OutboundEnvironmentEndpointInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerservice.generated.models.EndpointDependency; +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 { + /* + * 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..bc0d5513ab019 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,100 @@ +// 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.management.ProxyResource; +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.JsonProperty; + +/** A private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * The properties of a private endpoint connection. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /** + * Get the innerProperties property: The properties of a private endpoint connection. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: The current provisioning state. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the privateEndpoint property: The resource of private endpoint. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..22c4fb44be718 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionListResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private endpoint connections. */ +@Fluent +public final class PrivateEndpointConnectionListResultInner { + /* + * 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/PrivateEndpointConnectionProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..ed307d6f679cf --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,109 @@ +// 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.PrivateEndpoint; +import com.azure.resourcemanager.containerservice.generated.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The current provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /* + * The resource of private endpoint. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + 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 PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties 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) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} 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..8eaa35ddfd544 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourceInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResourceInner { + /* + * 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..071bf4ff12581 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/PrivateLinkResourcesListResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourcesListResultInner { + /* + * 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..7d2bac1dd7b55 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/RunCommandResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** run command result. */ +@Fluent +public final class RunCommandResultInner { + /* + * The command id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Properties of command result. + */ + @JsonProperty(value = "properties") + private CommandResultProperties innerProperties; + + /** + * Get the id property: The command id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the innerProperties property: Properties of command result. + * + * @return the innerProperties value. + */ + private CommandResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: provisioning State. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the exitCode property: The exit code of the command. + * + * @return the exitCode value. + */ + public Integer exitCode() { + return this.innerProperties() == null ? null : this.innerProperties().exitCode(); + } + + /** + * Get the startedAt property: The time when the command started. + * + * @return the startedAt value. + */ + public OffsetDateTime startedAt() { + return this.innerProperties() == null ? null : this.innerProperties().startedAt(); + } + + /** + * Get the finishedAt property: The time when the command finished. + * + * @return the finishedAt value. + */ + public OffsetDateTime finishedAt() { + return this.innerProperties() == null ? null : this.innerProperties().finishedAt(); + } + + /** + * Get the logs property: The command output. + * + * @return the logs value. + */ + public String logs() { + return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().reason(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().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..cad9c122c5db8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.Ossku; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A node pool snapshot resource. */ +@Fluent +public final class SnapshotInner extends Resource { + /* + * Properties of a snapshot. + */ + @JsonProperty(value = "properties") + private SnapshotProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Properties of a snapshot. + * + * @return the innerProperties value. + */ + private SnapshotProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SnapshotInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SnapshotInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withCreationData(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withSnapshotType(snapshotType); + return this; + } + + /** + * Get the kubernetesVersion property: The version of Kubernetes. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.innerProperties() == null ? null : this.innerProperties().kubernetesVersion(); + } + + /** + * Get the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + public String nodeImageVersion() { + return this.innerProperties() == null ? null : this.innerProperties().nodeImageVersion(); + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * 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.innerProperties() == null ? null : this.innerProperties().osSku(); + } + + /** + * Get the vmSize property: The size of the VM. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.innerProperties() == null ? null : this.innerProperties().vmSize(); + } + + /** + * Get the enableFips property: Whether to use a FIPS-enabled OS. + * + * @return the enableFips value. + */ + public Boolean enableFips() { + return this.innerProperties() == null ? null : this.innerProperties().enableFips(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotProperties.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotProperties.java new file mode 100644 index 0000000000000..0f4bfbe32f467 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/fluent/models/SnapshotProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.Ossku; +import com.azure.resourcemanager.containerservice.generated.models.SnapshotType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties used to configure a node pool snapshot. */ +@Fluent +public final class SnapshotProperties { + /* + * CreationData to be used to specify the source agent pool resource ID to + * create this snapshot. + */ + @JsonProperty(value = "creationData") + private CreationData creationData; + + /* + * The type of a snapshot. The default is NodePool. + */ + @JsonProperty(value = "snapshotType") + private SnapshotType snapshotType; + + /* + * The version of Kubernetes. + */ + @JsonProperty(value = "kubernetesVersion", access = JsonProperty.Access.WRITE_ONLY) + private String kubernetesVersion; + + /* + * The version of node image. + */ + @JsonProperty(value = "nodeImageVersion", access = JsonProperty.Access.WRITE_ONLY) + private String nodeImageVersion; + + /* + * OsType to be used to specify os type. Choose from Linux and Windows. + * Default to Linux. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private OSType osType; + + /* + * Specifies an OS SKU. This value must not be specified if OSType is + * Windows. + */ + @JsonProperty(value = "osSku", access = JsonProperty.Access.WRITE_ONLY) + private Ossku osSku; + + /* + * The size of the VM. + */ + @JsonProperty(value = "vmSize", access = JsonProperty.Access.WRITE_ONLY) + private String vmSize; + + /* + * Whether to use a FIPS-enabled OS. + */ + @JsonProperty(value = "enableFIPS", access = JsonProperty.Access.WRITE_ONLY) + private Boolean enableFips; + + /** + * 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 SnapshotProperties object itself. + */ + public SnapshotProperties 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 SnapshotProperties object itself. + */ + public SnapshotProperties withSnapshotType(SnapshotType snapshotType) { + this.snapshotType = snapshotType; + return this; + } + + /** + * Get the kubernetesVersion property: The version of Kubernetes. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Get the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + public String nodeImageVersion() { + return this.nodeImageVersion; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Get the vmSize property: The size of the VM. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Get the enableFips property: Whether to use a FIPS-enabled OS. + * + * @return the enableFips value. + */ + public Boolean enableFips() { + return this.enableFips; + } + + /** + * 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..d761507f90184 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolImpl.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.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 com.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime; +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 String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + 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 WorkloadRuntime workloadRuntime() { + return this.innerModel().workloadRuntime(); + } + + public String messageOfTheDay() { + return this.innerModel().messageOfTheDay(); + } + + 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 currentOrchestratorVersion() { + return this.innerModel().currentOrchestratorVersion(); + } + + 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 capacityReservationGroupId() { + return this.innerModel().capacityReservationGroupId(); + } + + public String hostGroupId() { + return this.innerModel().hostGroupId(); + } + + 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 withWorkloadRuntime(WorkloadRuntime workloadRuntime) { + this.innerModel().withWorkloadRuntime(workloadRuntime); + return this; + } + + public AgentPoolImpl withMessageOfTheDay(String messageOfTheDay) { + this.innerModel().withMessageOfTheDay(messageOfTheDay); + 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 withCurrentOrchestratorVersion(String currentOrchestratorVersion) { + this.innerModel().withCurrentOrchestratorVersion(currentOrchestratorVersion); + return this; + } + + public AgentPoolImpl withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { + this.innerModel().withUpgradeSettings(upgradeSettings); + return this; + } + + public AgentPoolImpl withPowerState(PowerState powerState) { + this.innerModel().withPowerState(powerState); + 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; + } + + public AgentPoolImpl withCapacityReservationGroupId(String capacityReservationGroupId) { + this.innerModel().withCapacityReservationGroupId(capacityReservationGroupId); + return this; + } + + public AgentPoolImpl withHostGroupId(String hostGroupId) { + this.innerModel().withHostGroupId(hostGroupId); + 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..4636408009cb9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsClientImpl.java @@ -0,0 +1,1869 @@ +// 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.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 { + /** 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, + @QueryParam("ignore-pod-disruption-budget") String ignorePodDisruptionBudget, + @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. The name is case insensitive. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of agent Pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, String agentPoolName, String ignorePodDisruptionBudget) { + 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 = "2022-03-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + ignorePodDisruptionBudget, + 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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String resourceName, + String agentPoolName, + String ignorePodDisruptionBudget, + 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 = "2022-03-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + agentPoolName, + ignorePodDisruptionBudget, + accept, + context); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, String agentPoolName, String ignorePodDisruptionBudget) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String resourceName, + String agentPoolName, + String ignorePodDisruptionBudget, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, 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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String agentPoolName, String ignorePodDisruptionBudget) { + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget) + .getSyncPoller(); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String resourceName, + String agentPoolName, + String ignorePodDisruptionBudget, + Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, context) + .getSyncPoller(); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String resourceName, String agentPoolName, String ignorePodDisruptionBudget) { + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String agentPoolName) { + final String ignorePodDisruptionBudget = null; + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String resourceName, + String agentPoolName, + String ignorePodDisruptionBudget, + Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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, String ignorePodDisruptionBudget) { + deleteAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget).block(); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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) { + final String ignorePodDisruptionBudget = null; + deleteAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget).block(); + } + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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, + String ignorePodDisruptionBudget, + Context context) { + deleteAsync(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, context).block(); + } + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 body along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 body on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 body on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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..de46e94d1bbcb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/AgentPoolsImpl.java @@ -0,0 +1,279 @@ +// 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; + +public final class AgentPoolsImpl implements AgentPools { + private static 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, String ignorePodDisruptionBudget) { + this.serviceClient().delete(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget); + } + + public void delete(String resourceGroupName, String resourceName, String agentPoolName) { + this.serviceClient().delete(resourceGroupName, resourceName, agentPoolName); + } + + public void delete( + String resourceGroupName, + String resourceName, + String agentPoolName, + String ignorePodDisruptionBudget, + Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, agentPoolName, ignorePodDisruptionBudget, 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))); + } + String localIgnorePodDisruptionBudget = null; + this.delete(resourceGroupName, resourceName, agentPoolName, localIgnorePodDisruptionBudget, Context.NONE); + } + + public void deleteByIdWithResponse(String id, String ignorePodDisruptionBudget, 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, ignorePodDisruptionBudget, 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/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..c78dd62db2b53 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientBuilder.java @@ -0,0 +1,148 @@ +// 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.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 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 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 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 (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + 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..d90921e24902d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServiceManagementClientImpl.java @@ -0,0 +1,425 @@ +// 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.ManagedClusterSnapshotsClient; +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 { + /** + * 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; + } + + /** The ManagedClusterSnapshotsClient object to access its operations. */ + private final ManagedClusterSnapshotsClient managedClusterSnapshots; + + /** + * Gets the ManagedClusterSnapshotsClient object to access its operations. + * + * @return the ManagedClusterSnapshotsClient object. + */ + public ManagedClusterSnapshotsClient getManagedClusterSnapshots() { + return this.managedClusterSnapshots; + } + + /** + * 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); + this.managedClusterSnapshots = new ManagedClusterSnapshotsClientImpl(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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerServiceManagementClientImpl.class); +} 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..6c149111a808b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServicesClientImpl.java @@ -0,0 +1,242 @@ +// 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.resourcemanager.containerservice.generated.fluent.ContainerServicesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OrchestratorVersionProfileListResultInner; +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 { + /** 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/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); + } + + /** + * 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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listOrchestratorsWithResponse( + String location, String resourceType, Context context) { + return listOrchestratorsWithResponseAsync(location, resourceType, context).block(); + } +} 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..c42b328142d49 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ContainerServicesImpl.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.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.ContainerServicesClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OrchestratorVersionProfileListResultInner; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServices; +import com.azure.resourcemanager.containerservice.generated.models.OrchestratorVersionProfileListResult; + +public final class ContainerServicesImpl implements ContainerServices { + private static 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 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; + } + } + + private ContainerServicesClient 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/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..35054a1502821 --- /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 String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + 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 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..ac3f5153a4192 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsClientImpl.java @@ -0,0 +1,923 @@ +// 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.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 { + /** 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. The name is case insensitive. + * @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster + * along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster on + * successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster. + */ + @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. The name is case insensitive. + * @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 planned maintenance configuration, used to configure when updates can be deployed to a Managed Cluster + * along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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..2bf6c915e07b6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/MaintenanceConfigurationsImpl.java @@ -0,0 +1,208 @@ +// 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; + +public final class MaintenanceConfigurationsImpl implements MaintenanceConfigurations { + private static 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); + } + + 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..578fb3d848f79 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterAccessProfileImpl.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.implementation; + +import com.azure.core.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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..1fc8c495cb9ff --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterImpl.java @@ -0,0 +1,631 @@ +// 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.management.SystemData; +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.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.CredentialResults; +import com.azure.resourcemanager.containerservice.generated.models.ExtendedLocation; +import com.azure.resourcemanager.containerservice.generated.models.Format; +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.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterOidcIssuerProfile; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public PowerState powerState() { + return this.innerModel().powerState(); + } + + public CreationData creationData() { + return this.innerModel().creationData(); + } + + public Integer maxAgentPools() { + return this.innerModel().maxAgentPools(); + } + + public String kubernetesVersion() { + return this.innerModel().kubernetesVersion(); + } + + public String currentKubernetesVersion() { + return this.innerModel().currentKubernetesVersion(); + } + + 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 ContainerServiceLinuxProfile 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 ManagedClusterOidcIssuerProfile oidcIssuerProfile() { + return this.innerModel().oidcIssuerProfile(); + } + + public String nodeResourceGroup() { + return this.innerModel().nodeResourceGroup(); + } + + public Boolean enableRbac() { + return this.innerModel().enableRbac(); + } + + public Boolean enablePodSecurityPolicy() { + return this.innerModel().enablePodSecurityPolicy(); + } + + public Boolean enableNamespaceResources() { + return this.innerModel().enableNamespaceResources(); + } + + 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 ManagedClusterIngressProfile ingressProfile() { + return this.innerModel().ingressProfile(); + } + + 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, Format format, Context context) { + return serviceManager + .managedClusters() + .listClusterUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, format, 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 rotateServiceAccountSigningKeys() { + serviceManager.managedClusters().rotateServiceAccountSigningKeys(resourceGroupName, resourceName); + } + + public void rotateServiceAccountSigningKeys(Context context) { + serviceManager.managedClusters().rotateServiceAccountSigningKeys(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 withCreationData(CreationData creationData) { + this.innerModel().withCreationData(creationData); + 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(ContainerServiceLinuxProfile 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 withOidcIssuerProfile(ManagedClusterOidcIssuerProfile oidcIssuerProfile) { + this.innerModel().withOidcIssuerProfile(oidcIssuerProfile); + 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 withEnableNamespaceResources(Boolean enableNamespaceResources) { + this.innerModel().withEnableNamespaceResources(enableNamespaceResources); + 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 withIngressProfile(ManagedClusterIngressProfile ingressProfile) { + this.innerModel().withIngressProfile(ingressProfile); + 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/ManagedClusterSnapshotImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterSnapshotImpl.java new file mode 100644 index 0000000000000..6025560ae3bba --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterSnapshotImpl.java @@ -0,0 +1,207 @@ +// 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.ManagedClusterSnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterPropertiesForSnapshot; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSnapshot; +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 ManagedClusterSnapshotImpl + implements ManagedClusterSnapshot, ManagedClusterSnapshot.Definition, ManagedClusterSnapshot.Update { + private ManagedClusterSnapshotInner 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 ManagedClusterPropertiesForSnapshot managedClusterPropertiesReadOnly() { + return this.innerModel().managedClusterPropertiesReadOnly(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ManagedClusterSnapshotInner 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 ManagedClusterSnapshotImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ManagedClusterSnapshot create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusterSnapshots() + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ManagedClusterSnapshot create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusterSnapshots() + .createOrUpdateWithResponse(resourceGroupName, resourceName, this.innerModel(), context) + .getValue(); + return this; + } + + ManagedClusterSnapshotImpl( + String name, com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager) { + this.innerObject = new ManagedClusterSnapshotInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public ManagedClusterSnapshotImpl update() { + this.updateParameters = new TagsObject(); + return this; + } + + public ManagedClusterSnapshot apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusterSnapshots() + .updateTagsWithResponse(resourceGroupName, resourceName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ManagedClusterSnapshot apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusterSnapshots() + .updateTagsWithResponse(resourceGroupName, resourceName, updateParameters, context) + .getValue(); + return this; + } + + ManagedClusterSnapshotImpl( + ManagedClusterSnapshotInner 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(), "managedclustersnapshots"); + } + + public ManagedClusterSnapshot refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusterSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public ManagedClusterSnapshot refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedClusterSnapshots() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public ManagedClusterSnapshotImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ManagedClusterSnapshotImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ManagedClusterSnapshotImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ManagedClusterSnapshotImpl withCreationData(CreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } + + public ManagedClusterSnapshotImpl 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/ManagedClusterSnapshotsClientImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterSnapshotsClientImpl.java new file mode 100644 index 0000000000000..2c8f073901878 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterSnapshotsClientImpl.java @@ -0,0 +1,1261 @@ +// 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.resourcemanager.containerservice.generated.fluent.ManagedClusterSnapshotsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterSnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSnapshotListResult; +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 ManagedClusterSnapshotsClient. */ +public final class ManagedClusterSnapshotsClientImpl implements ManagedClusterSnapshotsClient { + /** The proxy service used to perform REST calls. */ + private final ManagedClusterSnapshotsService service; + + /** The service client containing this operation class. */ + private final ContainerServiceManagementClientImpl client; + + /** + * Initializes an instance of ManagedClusterSnapshotsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedClusterSnapshotsClientImpl(ContainerServiceManagementClientImpl client) { + this.service = + RestProxy + .create(ManagedClusterSnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerServiceManagementClientManagedClusterSnapshots to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerServiceMana") + private interface ManagedClusterSnapshotsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots") + @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" + + "/managedclustersnapshots") + @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" + + "/managedclustersnapshots/{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" + + "/managedclustersnapshots/{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") ManagedClusterSnapshotInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" + + "/managedclustersnapshots/{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" + + "/managedclustersnapshots/{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 managed cluster 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 managed cluster snapshots in the specified subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of managed cluster 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 managed cluster snapshots in the specified subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of managed cluster 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 managed cluster snapshots in the specified subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of managed cluster 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 managed cluster snapshots in the specified subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of managed cluster 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 managed cluster snapshots in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of managed cluster 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 managed cluster snapshots in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Cluster Snapshots operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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 cluster snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Cluster Snapshots operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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 cluster snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Cluster Snapshots operation as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Cluster Snapshots operation as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Cluster Snapshots operation as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 Cluster Snapshots operation as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot on successful completion of {@link Mono}. + */ + @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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterSnapshotInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + } + + /** + * Gets a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot along with {@link Response}. + */ + @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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster 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 managed cluster snapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, ManagedClusterSnapshotInner 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 = "2022-03-02-preview"; + 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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster 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 managed cluster snapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, ManagedClusterSnapshotInner 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 = "2022-03-02-preview"; + 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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster 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 managed cluster snapshot resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, ManagedClusterSnapshotInner 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 managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster 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 managed cluster snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterSnapshotInner createOrUpdate( + String resourceGroupName, String resourceName, ManagedClusterSnapshotInner parameters) { + return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Creates or updates a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster 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 managed cluster snapshot resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String resourceName, ManagedClusterSnapshotInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Updates tags on a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update managed cluster 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 managed cluster snapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update managed cluster 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 managed cluster snapshot resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update managed cluster 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 managed cluster snapshot resource on successful completion of {@link Mono}. + */ + @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 managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update managed cluster 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 managed cluster snapshot resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedClusterSnapshotInner updateTags( + String resourceGroupName, String resourceName, TagsObject parameters) { + return updateTagsAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Updates tags on a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update managed cluster 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 managed cluster snapshot resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateTagsWithResponse( + String resourceGroupName, String resourceName, TagsObject parameters, Context context) { + return updateTagsWithResponseAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Deletes a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName) { + return deleteWithResponseAsync(resourceGroupName, resourceName).flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link 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 Managed Cluster Snapshots operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 Cluster Snapshots operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 Cluster Snapshots operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 Cluster Snapshots operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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/ManagedClusterSnapshotsImpl.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterSnapshotsImpl.java new file mode 100644 index 0000000000000..29353f2bb6730 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClusterSnapshotsImpl.java @@ -0,0 +1,183 @@ +// 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.ManagedClusterSnapshotsClient; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterSnapshotInner; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSnapshot; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSnapshots; + +public final class ManagedClusterSnapshotsImpl implements ManagedClusterSnapshots { + private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterSnapshotsImpl.class); + + private final ManagedClusterSnapshotsClient innerClient; + + private final com.azure.resourcemanager.containerservice.generated.ContainerServiceManager serviceManager; + + public ManagedClusterSnapshotsImpl( + ManagedClusterSnapshotsClient 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 ManagedClusterSnapshotImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ManagedClusterSnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ManagedClusterSnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ManagedClusterSnapshotImpl(inner1, this.manager())); + } + + public ManagedClusterSnapshot getByResourceGroup(String resourceGroupName, String resourceName) { + ManagedClusterSnapshotInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new ManagedClusterSnapshotImpl(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 ManagedClusterSnapshotImpl(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 ManagedClusterSnapshot 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, "managedclustersnapshots"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedclustersnapshots'.", + 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, "managedclustersnapshots"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedclustersnapshots'.", + 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, "managedclustersnapshots"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedclustersnapshots'.", + id))); + } + this.deleteWithResponse(resourceGroupName, resourceName, Context.NONE); + } + + 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, "managedclustersnapshots"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedclustersnapshots'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, resourceName, context); + } + + private ManagedClusterSnapshotsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager() { + return this.serviceManager; + } + + public ManagedClusterSnapshotImpl define(String name) { + return new ManagedClusterSnapshotImpl(name, this.manager()); + } +} 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..f6b6c0843e4ca --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersClientImpl.java @@ -0,0 +1,5188 @@ +// 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.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.Format; +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 { + /** 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, + @QueryParam("format") Format format, + @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, + @QueryParam("ignore-pod-disruption-budget") String ignorePodDisruptionBudget, + @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}/rotateServiceAccountSigningKeys") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rotateServiceAccountSigningKeys( + @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 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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 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 along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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 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 on successful completion of {@link Mono}. + */ + @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 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 on successful completion of {@link Mono}. + */ + @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 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 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 along with {@link Response}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link 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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return + * azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin + * binary in the path. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialsWithResponseAsync( + String resourceGroupName, String resourceName, String serverFqdn, Format format) { + 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 = "2022-03-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listClusterUserCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + serverFqdn, + format, + 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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return + * azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin + * binary in the path. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialsWithResponseAsync( + String resourceGroupName, String resourceName, String serverFqdn, Format format, 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 = "2022-03-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listClusterUserCredentials( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + serverFqdn, + format, + accept, + context); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return + * azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin + * binary in the path. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterUserCredentialsAsync( + String resourceGroupName, String resourceName, String serverFqdn, Format format) { + return listClusterUserCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn, format) + .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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterUserCredentialsAsync( + String resourceGroupName, String resourceName) { + final String serverFqdn = null; + final Format format = null; + return listClusterUserCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn, format) + .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. The name is case insensitive. + * @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; + final Format format = null; + return listClusterUserCredentialsAsync(resourceGroupName, resourceName, serverFqdn, format).block(); + } + + /** + * Lists the user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return + * azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin + * binary in the path. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Format format, Context context) { + return listClusterUserCredentialsWithResponseAsync(resourceGroupName, resourceName, serverFqdn, format, context) + .block(); + } + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Creates or updates a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * Updates tags on a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, String ignorePodDisruptionBudget) { + 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 = "2022-03-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + ignorePodDisruptionBudget, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, String ignorePodDisruptionBudget, 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 = "2022-03-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + ignorePodDisruptionBudget, + accept, + context); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, String ignorePodDisruptionBudget) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, ignorePodDisruptionBudget); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, String ignorePodDisruptionBudget, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, ignorePodDisruptionBudget, 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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String ignorePodDisruptionBudget) { + return beginDeleteAsync(resourceGroupName, resourceName, ignorePodDisruptionBudget).getSyncPoller(); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String ignorePodDisruptionBudget, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, ignorePodDisruptionBudget, context).getSyncPoller(); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, String ignorePodDisruptionBudget) { + return beginDeleteAsync(resourceGroupName, resourceName, ignorePodDisruptionBudget) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName) { + final String ignorePodDisruptionBudget = null; + return beginDeleteAsync(resourceGroupName, resourceName, ignorePodDisruptionBudget) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String resourceName, String ignorePodDisruptionBudget, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, ignorePodDisruptionBudget, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ignorePodDisruptionBudget) { + deleteAsync(resourceGroupName, resourceName, ignorePodDisruptionBudget).block(); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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) { + final String ignorePodDisruptionBudget = null; + deleteAsync(resourceGroupName, resourceName, ignorePodDisruptionBudget).block(); + } + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 ignorePodDisruptionBudget, Context context) { + deleteAsync(resourceGroupName, resourceName, ignorePodDisruptionBudget, 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * This action cannot be performed on a cluster that is not using a service principal. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Reset the AAD Profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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(); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateServiceAccountSigningKeysWithResponseAsync( + 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 = "2022-03-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rotateServiceAccountSigningKeys( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateServiceAccountSigningKeysWithResponseAsync( + 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 = "2022-03-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rotateServiceAccountSigningKeys( + this.client.getEndpoint(), + apiVersion, + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRotateServiceAccountSigningKeysAsync( + String resourceGroupName, String resourceName) { + Mono>> mono = + rotateServiceAccountSigningKeysWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRotateServiceAccountSigningKeysAsync( + String resourceGroupName, String resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rotateServiceAccountSigningKeysWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRotateServiceAccountSigningKeys( + String resourceGroupName, String resourceName) { + return beginRotateServiceAccountSigningKeysAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRotateServiceAccountSigningKeys( + String resourceGroupName, String resourceName, Context context) { + return beginRotateServiceAccountSigningKeysAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateServiceAccountSigningKeysAsync(String resourceGroupName, String resourceName) { + return beginRotateServiceAccountSigningKeysAsync(resourceGroupName, resourceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateServiceAccountSigningKeysAsync( + String resourceGroupName, String resourceName, Context context) { + return beginRotateServiceAccountSigningKeysAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName) { + rotateServiceAccountSigningKeysAsync(resourceGroupName, resourceName).block(); + } + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName, Context context) { + rotateServiceAccountSigningKeysAsync(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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of run command result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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. The name is case insensitive. + * @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 the {@link PollerFlux} for polling of run command result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of run command result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 the {@link SyncPoller} for polling of run command result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on + * successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link + * Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @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..186823bf81c2d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ManagedClustersImpl.java @@ -0,0 +1,463 @@ +// 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.Format; +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; + +public final class ManagedClustersImpl implements ManagedClusters { + private static 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, Format format, Context context) { + Response inner = + this + .serviceClient() + .listClusterUserCredentialsWithResponse(resourceGroupName, resourceName, serverFqdn, format, 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 delete(String resourceGroupName, String resourceName, String ignorePodDisruptionBudget) { + this.serviceClient().delete(resourceGroupName, resourceName, ignorePodDisruptionBudget); + } + + public void delete(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public void delete( + String resourceGroupName, String resourceName, String ignorePodDisruptionBudget, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, ignorePodDisruptionBudget, 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 rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName) { + this.serviceClient().rotateServiceAccountSigningKeys(resourceGroupName, resourceName); + } + + public void rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().rotateServiceAccountSigningKeys(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))); + } + String localIgnorePodDisruptionBudget = null; + this.delete(resourceGroupName, resourceName, localIgnorePodDisruptionBudget, Context.NONE); + } + + public void deleteByIdWithResponse(String id, String ignorePodDisruptionBudget, 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, ignorePodDisruptionBudget, 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..00c3524ce6b21 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClustersClientImpl.java @@ -0,0 +1,1579 @@ +// 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.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 { + /** 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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 as paginated response with {@link + * PagedFlux}. + */ + @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 as paginated response with {@link + * PagedFlux}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 as paginated response with {@link + * PagedFlux}. + */ + @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 as paginated response with {@link + * PagedFlux}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 as paginated response with {@link + * PagedIterable}. + */ + @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 along with {@link + * Response} on successful completion of {@link Mono}. + */ + @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 on successful + * completion of {@link Mono}. + */ + @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 along with {@link + * Response}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 the {@link PollerFlux} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, + this.client.getContext()); + } + + /** + * 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 the {@link PollerFlux} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 the {@link SyncPoller} for polling of openShift Managed cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 on successful completion of {@link Mono}. + */ + @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 on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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 A {@link Mono} that completes when a successful response is received. + */ + @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 A {@link Mono} that completes when a successful response is received. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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 along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @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..80ffe55839f4a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OpenShiftManagedClustersImpl.java @@ -0,0 +1,183 @@ +// 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; + +public final class OpenShiftManagedClustersImpl implements OpenShiftManagedClusters { + private static 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..1abb428828576 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsClientImpl.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.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.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 { + /** 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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..357a67d93e07a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/OperationsImpl.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.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; + +public final class OperationsImpl implements Operations { + private static 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..cf7d960c60b62 --- /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.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 { + /** 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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, this.client.getContext()); + } + + /** + * Deletes a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + 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. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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..e740dc04f1c28 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,136 @@ +// 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; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static 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..4fcc53c802982 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,221 @@ +// 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.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 { + /** 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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..30c241831ad61 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/PrivateLinkResourcesImpl.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.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; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static 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..4f9ad90553275 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsClientImpl.java @@ -0,0 +1,245 @@ +// 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.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 { + /** 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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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..1ed87f1725e71 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/ResolvePrivateLinkServiceIdsImpl.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.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; + +public final class ResolvePrivateLinkServiceIdsImpl implements ResolvePrivateLinkServiceIds { + private static 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..06cef58f58c7b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotImpl.java @@ -0,0 +1,227 @@ +// 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.OSType; +import com.azure.resourcemanager.containerservice.generated.models.Ossku; +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 String kubernetesVersion() { + return this.innerModel().kubernetesVersion(); + } + + public String nodeImageVersion() { + return this.innerModel().nodeImageVersion(); + } + + public OSType osType() { + return this.innerModel().osType(); + } + + public Ossku osSku() { + return this.innerModel().osSku(); + } + + public String vmSize() { + return this.innerModel().vmSize(); + } + + public Boolean enableFips() { + return this.innerModel().enableFips(); + } + + 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..5f4c0f8763b2a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsClientImpl.java @@ -0,0 +1,1248 @@ +// 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.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 { + /** 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets 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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedFlux}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedFlux}. + */ + @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. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 as paginated response with {@link PagedIterable}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 on successful completion of {@link Mono}. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + @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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @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 = "2022-03-02-preview"; + 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. The name is case insensitive. + * @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 {@link Mono} that completes when a successful response is received. + */ + @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @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..bac47211cfc32 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/implementation/SnapshotsImpl.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.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; + +public final class SnapshotsImpl implements Snapshots { + private static 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); + } + + 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..9edf22df64a4f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPool.java @@ -0,0 +1,1677 @@ +// 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 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 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 workloadRuntime property: Determines the type of workload a node can run. + * + * @return the workloadRuntime value. + */ + WorkloadRuntime workloadRuntime(); + + /** + * Gets the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A base64-encoded string + * which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux + * nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not + * be executed as a script). + * + * @return the messageOfTheDay value. + */ + String messageOfTheDay(); + + /** + * 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 specified by the user. Both patch version + * <major.minor.patch> and <major.minor> are supported. When <major.minor> is specified, the + * latest supported patch version is chosen automatically. Updating the agent pool with the same <major.minor> + * once it has been created will not trigger an upgrade, even if a newer patch version is available. 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 currentOrchestratorVersion property: The version of Kubernetes running on the Agent Pool. If + * orchestratorVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to + * it. If orchestratorVersion was <major.minor>, this field will contain the full <major.minor.patch> + * version being used. + * + * @return the currentOrchestratorVersion value. + */ + String currentOrchestratorVersion(); + + /** + * 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: When an Agent Pool is first created it is initially Running. The Agent Pool can be + * stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing + * charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded. + * + * @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 capacityReservationGroupId property: AKS will associate the specified agent pool with the Capacity + * Reservation Group. + * + * @return the capacityReservationGroupId value. + */ + String capacityReservationGroupId(); + + /** + * Gets the hostGroupId property: The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once set. This is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + * For more information see [Azure dedicated + * hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + * + * @return the hostGroupId value. + */ + String hostGroupId(); + + /** + * 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. The name is case insensitive. + * @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.WithWorkloadRuntime, + DefinitionStages.WithMessageOfTheDay, + 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.WithCurrentOrchestratorVersion, + DefinitionStages.WithUpgradeSettings, + DefinitionStages.WithPowerState, + 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, + DefinitionStages.WithCapacityReservationGroupId, + DefinitionStages.WithHostGroupId { + /** + * 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 workloadRuntime. */ + interface WithWorkloadRuntime { + /** + * Specifies the workloadRuntime property: Determines the type of workload a node can run.. + * + * @param workloadRuntime Determines the type of workload a node can run. + * @return the next definition stage. + */ + WithCreate withWorkloadRuntime(WorkloadRuntime workloadRuntime); + } + /** The stage of the AgentPool definition allowing to specify messageOfTheDay. */ + interface WithMessageOfTheDay { + /** + * Specifies the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A + * base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the + * message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static + * string (i.e., will be printed raw and not be executed as a script).. + * + * @param messageOfTheDay Message of the day for Linux nodes, base64-encoded. A base64-encoded string which + * will be written to /etc/motd after decoding. This allows customization of the message of the day for + * Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be + * printed raw and not be executed as a script). + * @return the next definition stage. + */ + WithCreate withMessageOfTheDay(String messageOfTheDay); + } + /** 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 specified by the user. Both patch + * version <major.minor.patch> and <major.minor> are supported. When <major.minor> is + * specified, the latest supported patch version is chosen automatically. Updating the agent pool with the + * same <major.minor> once it has been created will not trigger an upgrade, even if a newer patch + * version is available. 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 specified by the user. Both patch version + * <major.minor.patch> and <major.minor> are supported. When <major.minor> is + * specified, the latest supported patch version is chosen automatically. Updating the agent pool with + * the same <major.minor> once it has been created will not trigger an upgrade, even if a newer + * patch version is available. 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 currentOrchestratorVersion. */ + interface WithCurrentOrchestratorVersion { + /** + * Specifies the currentOrchestratorVersion property: The version of Kubernetes running on the Agent Pool. + * If orchestratorVersion was a fully specified version <major.minor.patch>, this field will be + * exactly equal to it. If orchestratorVersion was <major.minor>, this field will contain the full + * <major.minor.patch> version being used.. + * + * @param currentOrchestratorVersion The version of Kubernetes running on the Agent Pool. If + * orchestratorVersion was a fully specified version <major.minor.patch>, this field will be + * exactly equal to it. If orchestratorVersion was <major.minor>, this field will contain the full + * <major.minor.patch> version being used. + * @return the next definition stage. + */ + WithCreate withCurrentOrchestratorVersion(String currentOrchestratorVersion); + } + /** 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 powerState. */ + interface WithPowerState { + /** + * Specifies the powerState property: When an Agent Pool is first created it is initially Running. The Agent + * Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does + * not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is + * Succeeded. + * + * @param powerState When an Agent Pool is first created it is initially Running. The Agent Pool can be + * stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not + * accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is + * Succeeded. + * @return the next definition stage. + */ + WithCreate withPowerState(PowerState powerState); + } + /** 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); + } + /** The stage of the AgentPool definition allowing to specify capacityReservationGroupId. */ + interface WithCapacityReservationGroupId { + /** + * Specifies the capacityReservationGroupId property: AKS will associate the specified agent pool with the + * Capacity Reservation Group.. + * + * @param capacityReservationGroupId AKS will associate the specified agent pool with the Capacity + * Reservation Group. + * @return the next definition stage. + */ + WithCreate withCapacityReservationGroupId(String capacityReservationGroupId); + } + /** The stage of the AgentPool definition allowing to specify hostGroupId. */ + interface WithHostGroupId { + /** + * Specifies the hostGroupId property: The fully qualified resource ID of the Dedicated Host Group to + * provision virtual machines from, used only in creation scenario and not allowed to changed once set. This + * is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + * For more information see [Azure dedicated + * hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).. + * + * @param hostGroupId The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once set. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + * For more information see [Azure dedicated + * hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + * @return the next definition stage. + */ + WithCreate withHostGroupId(String hostGroupId); + } + } + /** + * 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.WithWorkloadRuntime, + UpdateStages.WithMessageOfTheDay, + 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.WithCurrentOrchestratorVersion, + UpdateStages.WithUpgradeSettings, + UpdateStages.WithPowerState, + 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, + UpdateStages.WithCapacityReservationGroupId, + UpdateStages.WithHostGroupId { + /** + * 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 workloadRuntime. */ + interface WithWorkloadRuntime { + /** + * Specifies the workloadRuntime property: Determines the type of workload a node can run.. + * + * @param workloadRuntime Determines the type of workload a node can run. + * @return the next definition stage. + */ + Update withWorkloadRuntime(WorkloadRuntime workloadRuntime); + } + /** The stage of the AgentPool update allowing to specify messageOfTheDay. */ + interface WithMessageOfTheDay { + /** + * Specifies the messageOfTheDay property: Message of the day for Linux nodes, base64-encoded. A + * base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the + * message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static + * string (i.e., will be printed raw and not be executed as a script).. + * + * @param messageOfTheDay Message of the day for Linux nodes, base64-encoded. A base64-encoded string which + * will be written to /etc/motd after decoding. This allows customization of the message of the day for + * Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be + * printed raw and not be executed as a script). + * @return the next definition stage. + */ + Update withMessageOfTheDay(String messageOfTheDay); + } + /** 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 specified by the user. Both patch + * version <major.minor.patch> and <major.minor> are supported. When <major.minor> is + * specified, the latest supported patch version is chosen automatically. Updating the agent pool with the + * same <major.minor> once it has been created will not trigger an upgrade, even if a newer patch + * version is available. 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 specified by the user. Both patch version + * <major.minor.patch> and <major.minor> are supported. When <major.minor> is + * specified, the latest supported patch version is chosen automatically. Updating the agent pool with + * the same <major.minor> once it has been created will not trigger an upgrade, even if a newer + * patch version is available. 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 currentOrchestratorVersion. */ + interface WithCurrentOrchestratorVersion { + /** + * Specifies the currentOrchestratorVersion property: The version of Kubernetes running on the Agent Pool. + * If orchestratorVersion was a fully specified version <major.minor.patch>, this field will be + * exactly equal to it. If orchestratorVersion was <major.minor>, this field will contain the full + * <major.minor.patch> version being used.. + * + * @param currentOrchestratorVersion The version of Kubernetes running on the Agent Pool. If + * orchestratorVersion was a fully specified version <major.minor.patch>, this field will be + * exactly equal to it. If orchestratorVersion was <major.minor>, this field will contain the full + * <major.minor.patch> version being used. + * @return the next definition stage. + */ + Update withCurrentOrchestratorVersion(String currentOrchestratorVersion); + } + /** 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 powerState. */ + interface WithPowerState { + /** + * Specifies the powerState property: When an Agent Pool is first created it is initially Running. The Agent + * Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does + * not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is + * Succeeded. + * + * @param powerState When an Agent Pool is first created it is initially Running. The Agent Pool can be + * stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not + * accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is + * Succeeded. + * @return the next definition stage. + */ + Update withPowerState(PowerState powerState); + } + /** 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); + } + /** The stage of the AgentPool update allowing to specify capacityReservationGroupId. */ + interface WithCapacityReservationGroupId { + /** + * Specifies the capacityReservationGroupId property: AKS will associate the specified agent pool with the + * Capacity Reservation Group.. + * + * @param capacityReservationGroupId AKS will associate the specified agent pool with the Capacity + * Reservation Group. + * @return the next definition stage. + */ + Update withCapacityReservationGroupId(String capacityReservationGroupId); + } + /** The stage of the AgentPool update allowing to specify hostGroupId. */ + interface WithHostGroupId { + /** + * Specifies the hostGroupId property: The fully qualified resource ID of the Dedicated Host Group to + * provision virtual machines from, used only in creation scenario and not allowed to changed once set. This + * is of the form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + * For more information see [Azure dedicated + * hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).. + * + * @param hostGroupId The fully qualified resource ID of the Dedicated Host Group to provision virtual + * machines from, used only in creation scenario and not allowed to changed once set. This is of the + * form: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + * For more information see [Azure dedicated + * hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). + * @return the next definition stage. + */ + Update withHostGroupId(String hostGroupId); + } + } + /** + * 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..f879bc7025cce --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.java @@ -0,0 +1,98 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem model. */ +@Fluent +public final class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem { + /* + * 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..3c9b63d0e67fc --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Agent Pools operation. */ +@Fluent +public final class AgentPoolListResult { + /* + * 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..d3ec126776c84 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeProfilePropertiesUpgradesItem.java @@ -0,0 +1,72 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The AgentPoolUpgradeProfilePropertiesUpgradesItem model. */ +@Fluent +public final class AgentPoolUpgradeProfilePropertiesUpgradesItem { + /* + * 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..8f2883e7dbbc1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolUpgradeSettings.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings for upgrading an agentpool. */ +@Fluent +public final class AgentPoolUpgradeSettings { + /* + * 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..54ab4b5452bfb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPools.java @@ -0,0 +1,253 @@ +// 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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + 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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, Context context); + + /** + * Gets the specified managed cluster agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, String ignorePodDisruptionBudget); + + /** + * Deletes an agent pool in the specified managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @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, + String ignorePodDisruptionBudget, + Context context); + + /** + * Gets the upgrade profile for an agent pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @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, String ignorePodDisruptionBudget, 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/AgentPoolsUpgradeNodeImageVersionHeaders.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolsUpgradeNodeImageVersionHeaders.java new file mode 100644 index 0000000000000..313f3a6f1dfc7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolsUpgradeNodeImageVersionHeaders.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.fasterxml.jackson.annotation.JsonProperty; + +/** The AgentPoolsUpgradeNodeImageVersionHeaders model. */ +@Fluent +public final class AgentPoolsUpgradeNodeImageVersionHeaders { + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the AgentPoolsUpgradeNodeImageVersionHeaders object itself. + */ + public AgentPoolsUpgradeNodeImageVersionHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + 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/AgentPoolsUpgradeNodeImageVersionResponse.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolsUpgradeNodeImageVersionResponse.java new file mode 100644 index 0000000000000..4aa132b5cca3d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AgentPoolsUpgradeNodeImageVersionResponse.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.containerservice.generated.fluent.models.AgentPoolInner; + +/** Contains all response data for the upgradeNodeImageVersion operation. */ +public final class AgentPoolsUpgradeNodeImageVersionResponse + extends ResponseBase { + /** + * Creates an instance of AgentPoolsUpgradeNodeImageVersionResponse. + * + * @param request the request which resulted in this AgentPoolsUpgradeNodeImageVersionResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public AgentPoolsUpgradeNodeImageVersionResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + AgentPoolInner value, + AgentPoolsUpgradeNodeImageVersionHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public AgentPoolInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AzureKeyVaultKms.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AzureKeyVaultKms.java new file mode 100644 index 0000000000000..8305da76331cb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/AzureKeyVaultKms.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.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Key Vault key management service settings for the security profile. */ +@Fluent +public final class AzureKeyVaultKms { + /* + * Whether to enable Azure Key Vault key management service. The default is + * false. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Identifier of Azure Key Vault key. See [key identifier + * format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + * for more details. When Azure Key Vault key management service is + * enabled, this field is required and must be a valid key identifier. When + * Azure Key Vault key management service is disabled, leave the field + * empty. + */ + @JsonProperty(value = "keyId") + private String keyId; + + /** + * Get the enabled property: Whether to enable Azure Key Vault key management service. The default is false. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable Azure Key Vault key management service. The default is false. + * + * @param enabled the enabled value to set. + * @return the AzureKeyVaultKms object itself. + */ + public AzureKeyVaultKms withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the keyId property: Identifier of Azure Key Vault key. See [key identifier + * format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + * for more details. When Azure Key Vault key management service is enabled, this field is required and must be a + * valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. + * + * @return the keyId value. + */ + public String keyId() { + return this.keyId; + } + + /** + * Set the keyId property: Identifier of Azure Key Vault key. See [key identifier + * format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) + * for more details. When Azure Key Vault key management service is enabled, this field is required and must be a + * valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. + * + * @param keyId the keyId value to set. + * @return the AzureKeyVaultKms object itself. + */ + public AzureKeyVaultKms withKeyId(String keyId) { + this.keyId = keyId; + 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/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/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..b83679b1bfc97 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceLinuxProfile.java @@ -0,0 +1,89 @@ +// 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.JsonProperty; + +/** Profile for Linux VMs in the container service cluster. */ +@Fluent +public final class ContainerServiceLinuxProfile { + /* + * 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 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: The SSH configuration for Linux-based VMs running on Azure. + * + * @return the ssh value. + */ + public ContainerServiceSshConfiguration 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 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerServiceLinuxProfile.class); +} 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..7d555b8ec25a0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceNetworkProfile.java @@ -0,0 +1,440 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Profile of network configuration. */ +@Fluent +public final class ContainerServiceNetworkProfile { + /* + * 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; + + /* + * The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR + * is expected for single-stack networking. Two CIDRs, one for each IP + * family (IPv4/IPv6), is expected for dual-stack networking. + */ + @JsonProperty(value = "podCidrs") + private List podCidrs; + + /* + * The CIDR notation IP ranges from which to assign service cluster IPs. + * One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one + * for each IP family (IPv4/IPv6), is expected for dual-stack networking. + * They must not overlap with any Subnet IP ranges. + */ + @JsonProperty(value = "serviceCidrs") + private List serviceCidrs; + + /* + * The IP families used to specify IP versions available to the cluster. IP + * families are used to determine single-stack or dual-stack clusters. For + * single-stack, the expected value is IPv4. For dual-stack, the expected + * values are IPv4 and IPv6. + */ + @JsonProperty(value = "ipFamilies") + private List ipFamilies; + + /** + * 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; + } + + /** + * Get the podCidrs property: The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected + * for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack + * networking. + * + * @return the podCidrs value. + */ + public List podCidrs() { + return this.podCidrs; + } + + /** + * Set the podCidrs property: The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected + * for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack + * networking. + * + * @param podCidrs the podCidrs value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withPodCidrs(List podCidrs) { + this.podCidrs = podCidrs; + return this; + } + + /** + * Get the serviceCidrs property: The CIDR notation IP ranges from which to assign service cluster IPs. One IPv4 + * CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for + * dual-stack networking. They must not overlap with any Subnet IP ranges. + * + * @return the serviceCidrs value. + */ + public List serviceCidrs() { + return this.serviceCidrs; + } + + /** + * Set the serviceCidrs property: The CIDR notation IP ranges from which to assign service cluster IPs. One IPv4 + * CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for + * dual-stack networking. They must not overlap with any Subnet IP ranges. + * + * @param serviceCidrs the serviceCidrs value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withServiceCidrs(List serviceCidrs) { + this.serviceCidrs = serviceCidrs; + return this; + } + + /** + * Get the ipFamilies property: The IP families used to specify IP versions available to the cluster. IP families + * are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For + * dual-stack, the expected values are IPv4 and IPv6. + * + * @return the ipFamilies value. + */ + public List ipFamilies() { + return this.ipFamilies; + } + + /** + * Set the ipFamilies property: The IP families used to specify IP versions available to the cluster. IP families + * are used to determine single-stack or dual-stack clusters. For single-stack, the expected value is IPv4. For + * dual-stack, the expected values are IPv4 and IPv6. + * + * @param ipFamilies the ipFamilies value to set. + * @return the ContainerServiceNetworkProfile object itself. + */ + public ContainerServiceNetworkProfile withIpFamilies(List ipFamilies) { + this.ipFamilies = ipFamilies; + 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/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..bfea2b93f2b40 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshConfiguration.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.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSH configuration for Linux-based VMs running on Azure. */ +@Fluent +public final class ContainerServiceSshConfiguration { + /* + * 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 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerServiceSshConfiguration.class); +} 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..8974796b8acf5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServiceSshPublicKey.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.JsonProperty; + +/** Contains information about SSH certificate public key data. */ +@Fluent +public final class ContainerServiceSshPublicKey { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerServiceSshPublicKey.class); +} 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..e94590230ab9c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ContainerServices.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +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 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 along with {@link Response}. + */ + 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/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..2c18ae3777037 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CreationData.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data used when creating a target resource from a source resource. */ +@Fluent +public final class CreationData { + /* + * 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..5fbf6497f08e8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/CredentialResult.java @@ -0,0 +1,51 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The credential result response. */ +@Immutable +public final class CredentialResult { + /* + * 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..35906b003981b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDependency.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A domain name that AKS agent nodes are reaching at. */ +@Fluent +public final class EndpointDependency { + /* + * 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..2d91fc03ce1b3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/EndpointDetail.java @@ -0,0 +1,124 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** connect information from the AKS agent nodes to a single endpoint. */ +@Fluent +public final class EndpointDetail { + /* + * 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..1e9d4f7fae4f6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ExtendedLocation.java @@ -0,0 +1,72 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The complex type of the extended location. */ +@Fluent +public final class ExtendedLocation { + /* + * 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/Format.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Format.java new file mode 100644 index 0000000000000..35b221f1b3c2d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Format.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 Format. */ +public final class Format extends ExpandableStringEnum { + /** Static value azure for Format. */ + public static final Format AZURE = fromString("azure"); + + /** Static value exec for Format. */ + public static final Format EXEC = fromString("exec"); + + /** + * Creates or finds a Format from its string representation. + * + * @param name a name to look for. + * @return the corresponding Format. + */ + @JsonCreator + public static Format fromString(String name) { + return fromString(name, Format.class); + } + + /** @return known Format values. */ + public static Collection values() { + return values(Format.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/IpFamily.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IpFamily.java new file mode 100644 index 0000000000000..1375241374784 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/IpFamily.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 IpFamily. */ +public final class IpFamily extends ExpandableStringEnum { + /** Static value IPv4 for IpFamily. */ + public static final IpFamily IPV4 = fromString("IPv4"); + + /** Static value IPv6 for IpFamily. */ + public static final IpFamily IPV6 = fromString("IPv6"); + + /** + * Creates or finds a IpFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpFamily. + */ + @JsonCreator + public static IpFamily fromString(String name) { + return fromString(name, IpFamily.class); + } + + /** @return known IpFamily values. */ + public static Collection values() { + return values(IpFamily.class); + } +} 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..9ffb4af0f2db0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/KubeletConfig.java @@ -0,0 +1,351 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Kubelet configurations of agent nodes. See [AKS custom node + * configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + */ +@Fluent +public final class KubeletConfig { + /* + * 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..e17e3365d96aa --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/LinuxOSConfig.java @@ -0,0 +1,147 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** + * OS configurations of Linux agent nodes. See [AKS custom node + * configuration](https://docs.microsoft.com/azure/aks/custom-node-configuration) for more details. + */ +@Fluent +public final class LinuxOSConfig { + /* + * 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..765e71c6a740d --- /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 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 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 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. The name is case insensitive. + * @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..3316552e50aac --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurationListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerservice.generated.fluent.models.MaintenanceConfigurationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List maintenance configurations operation. */ +@Fluent +public final class MaintenanceConfigurationListResult { + /* + * 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..ec9dfd7d6ca96 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/MaintenanceConfigurations.java @@ -0,0 +1,148 @@ +// 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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + 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. The name is case insensitive. + * @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 as paginated response with {@link + * PagedIterable}. + */ + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String resourceName, String configName, Context context); + + /** + * Deletes a maintenance configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 {@link 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..b629ae1ecc8be --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedCluster.java @@ -0,0 +1,1096 @@ +// 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.management.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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 creationData property: CreationData to be used to specify the source Snapshot ID if the cluster will be + * created/upgraded using a snapshot. + * + * @return the creationData value. + */ + CreationData creationData(); + + /** + * 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 requested to run. 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 currentKubernetesVersion property: The version of Kubernetes the Managed Cluster is running. + * + * @return the currentKubernetesVersion value. + */ + String currentKubernetesVersion(); + + /** + * 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. + */ + ContainerServiceLinuxProfile 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 oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster. + * + * @return the oidcIssuerProfile value. + */ + ManagedClusterOidcIssuerProfile oidcIssuerProfile(); + + /** + * 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 enableNamespaceResources property: Enable namespace as Azure resource. The default value is false. It + * can be enabled/disabled on creation and updation of the managed cluster. See + * [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM + * Resource. + * + * @return the enableNamespaceResources value. + */ + Boolean enableNamespaceResources(); + + /** + * 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 ingressProfile property: Ingress profile for the managed cluster. + * + * @return the ingressProfile value. + */ + ManagedClusterIngressProfile ingressProfile(); + + /** + * Gets the publicNetworkAccess property: PublicNetworkAccess of the managedCluster Allow or deny public network + * access for AKS. + * + * @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. The name is case insensitive. + * @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.WithCreationData, + DefinitionStages.WithKubernetesVersion, + DefinitionStages.WithDnsPrefix, + DefinitionStages.WithFqdnSubdomain, + DefinitionStages.WithAgentPoolProfiles, + DefinitionStages.WithLinuxProfile, + DefinitionStages.WithWindowsProfile, + DefinitionStages.WithServicePrincipalProfile, + DefinitionStages.WithAddonProfiles, + DefinitionStages.WithPodIdentityProfile, + DefinitionStages.WithOidcIssuerProfile, + DefinitionStages.WithNodeResourceGroup, + DefinitionStages.WithEnableRbac, + DefinitionStages.WithEnablePodSecurityPolicy, + DefinitionStages.WithEnableNamespaceResources, + DefinitionStages.WithNetworkProfile, + DefinitionStages.WithAadProfile, + DefinitionStages.WithAutoUpgradeProfile, + DefinitionStages.WithAutoScalerProfile, + DefinitionStages.WithApiServerAccessProfile, + DefinitionStages.WithDiskEncryptionSetId, + DefinitionStages.WithIdentityProfile, + DefinitionStages.WithPrivateLinkResources, + DefinitionStages.WithDisableLocalAccounts, + DefinitionStages.WithHttpProxyConfig, + DefinitionStages.WithSecurityProfile, + DefinitionStages.WithIngressProfile, + 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 creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: CreationData to be used to specify the source Snapshot ID if the + * cluster will be created/upgraded using a snapshot.. + * + * @param creationData CreationData to be used to specify the source Snapshot ID if the cluster will be + * created/upgraded using a snapshot. + * @return the next definition stage. + */ + WithCreate withCreationData(CreationData creationData); + } + /** The stage of the ManagedCluster definition allowing to specify kubernetesVersion. */ + interface WithKubernetesVersion { + /** + * Specifies the kubernetesVersion property: The version of Kubernetes the Managed Cluster is requested to + * run. 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 requested to run. 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(ContainerServiceLinuxProfile 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 oidcIssuerProfile. */ + interface WithOidcIssuerProfile { + /** + * Specifies the oidcIssuerProfile property: The OIDC issuer profile of the Managed Cluster.. + * + * @param oidcIssuerProfile The OIDC issuer profile of the Managed Cluster. + * @return the next definition stage. + */ + WithCreate withOidcIssuerProfile(ManagedClusterOidcIssuerProfile oidcIssuerProfile); + } + /** 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 enableNamespaceResources. */ + interface WithEnableNamespaceResources { + /** + * Specifies the enableNamespaceResources property: Enable namespace as Azure resource. The default value is + * false. It can be enabled/disabled on creation and updation of the managed cluster. See + * [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace + * as a ARM Resource.. + * + * @param enableNamespaceResources Enable namespace as Azure resource. The default value is false. It can be + * enabled/disabled on creation and updation of the managed cluster. See + * [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on + * Namespace as a ARM Resource. + * @return the next definition stage. + */ + WithCreate withEnableNamespaceResources(Boolean enableNamespaceResources); + } + /** 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 ingressProfile. */ + interface WithIngressProfile { + /** + * Specifies the ingressProfile property: Ingress profile for the managed cluster.. + * + * @param ingressProfile Ingress profile for the managed cluster. + * @return the next definition stage. + */ + WithCreate withIngressProfile(ManagedClusterIngressProfile ingressProfile); + } + /** The stage of the ManagedCluster definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: PublicNetworkAccess of the managedCluster Allow or deny + * public network access for AKS. + * + * @param publicNetworkAccess PublicNetworkAccess of the managedCluster Allow or deny public network access + * for AKS. + * @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 along with {@link 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 format Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return + * azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin + * binary in the path. + * @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 along with {@link Response}. + */ + Response listClusterUserCredentialsWithResponse( + String serverFqdn, Format format, 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 along with {@link 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); + + /** + * Rotates the service account signing keys 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. + */ + void rotateServiceAccountSigningKeys(); + + /** + * Rotates the service account signing keys of a 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 rotateServiceAccountSigningKeys(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..0580d77ae95d6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAadProfile.java @@ -0,0 +1,210 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * AADProfile specifies attributes for Azure Active Directory integration. For more details see [managed AAD on + * AKS](https://docs.microsoft.com/azure/aks/managed-aad). + */ +@Fluent +public final class ManagedClusterAadProfile { + /* + * 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..73ae1109b2a2b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAccessProfile.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.models; + +import com.azure.core.management.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..3a224382dc639 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfile.java @@ -0,0 +1,93 @@ +// 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.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 { + /* + * 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..22609bd2901d6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAddonProfileIdentity.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.models; + +import com.azure.core.annotation.Fluent; + +/** Information of user assigned identity used by this add-on. */ +@Fluent +public class ManagedClusterAddonProfileIdentity extends UserAssignedIdentity { + /** {@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..36f9abe062c5e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAgentPoolProfile.java @@ -0,0 +1,351 @@ +// 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.ManagedClusterAgentPoolProfileProperties; +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 { + /* + * 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 withWorkloadRuntime(WorkloadRuntime workloadRuntime) { + super.withWorkloadRuntime(workloadRuntime); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withMessageOfTheDay(String messageOfTheDay) { + super.withMessageOfTheDay(messageOfTheDay); + 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 withCurrentOrchestratorVersion(String currentOrchestratorVersion) { + super.withCurrentOrchestratorVersion(currentOrchestratorVersion); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withUpgradeSettings(AgentPoolUpgradeSettings upgradeSettings) { + super.withUpgradeSettings(upgradeSettings); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withPowerState(PowerState powerState) { + super.withPowerState(powerState); + 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; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withCapacityReservationGroupId(String capacityReservationGroupId) { + super.withCapacityReservationGroupId(capacityReservationGroupId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedClusterAgentPoolProfile withHostGroupId(String hostGroupId) { + super.withHostGroupId(hostGroupId); + 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterAgentPoolProfile.class); +} 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..14db58f4c6c9c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterApiServerAccessProfile.java @@ -0,0 +1,178 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Access profile for managed cluster API server. */ +@Fluent +public final class ManagedClusterApiServerAccessProfile { + /* + * 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..dfb9b4f5e304c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterAutoUpgradeProfile.java @@ -0,0 +1,52 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Auto upgrade profile for a managed cluster. */ +@Fluent +public final class ManagedClusterAutoUpgradeProfile { + /* + * 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..16e44cea0a126 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterHttpProxyConfig.java @@ -0,0 +1,125 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster HTTP proxy configuration. */ +@Fluent +public final class ManagedClusterHttpProxyConfig { + /* + * 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..bf09d16afc17a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIdentity.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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the managed cluster. */ +@Fluent +public class ManagedClusterIdentity { + /* + * 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/ManagedClusterIngressProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfile.java new file mode 100644 index 0000000000000..9391ebc565ea0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfile.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ingress profile for the container service cluster. */ +@Fluent +public final class ManagedClusterIngressProfile { + /* + * Web App Routing settings for the ingress profile. + */ + @JsonProperty(value = "webAppRouting") + private ManagedClusterIngressProfileWebAppRouting webAppRouting; + + /** + * Get the webAppRouting property: Web App Routing settings for the ingress profile. + * + * @return the webAppRouting value. + */ + public ManagedClusterIngressProfileWebAppRouting webAppRouting() { + return this.webAppRouting; + } + + /** + * Set the webAppRouting property: Web App Routing settings for the ingress profile. + * + * @param webAppRouting the webAppRouting value to set. + * @return the ManagedClusterIngressProfile object itself. + */ + public ManagedClusterIngressProfile withWebAppRouting(ManagedClusterIngressProfileWebAppRouting webAppRouting) { + this.webAppRouting = webAppRouting; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webAppRouting() != null) { + webAppRouting().validate(); + } + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileWebAppRouting.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileWebAppRouting.java new file mode 100644 index 0000000000000..6d8c7e8ecb50a --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterIngressProfileWebAppRouting.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.fasterxml.jackson.annotation.JsonProperty; + +/** Web App Routing settings for the ingress profile. */ +@Fluent +public final class ManagedClusterIngressProfileWebAppRouting { + /* + * Whether to enable Web App Routing. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Resource ID of the DNS Zone to be associated with the web app. Used only + * when Web App Routing is enabled. + */ + @JsonProperty(value = "dnsZoneResourceId") + private String dnsZoneResourceId; + + /** + * Get the enabled property: Whether to enable Web App Routing. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable Web App Routing. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterIngressProfileWebAppRouting object itself. + */ + public ManagedClusterIngressProfileWebAppRouting withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the dnsZoneResourceId property: Resource ID of the DNS Zone to be associated with the web app. Used only when + * Web App Routing is enabled. + * + * @return the dnsZoneResourceId value. + */ + public String dnsZoneResourceId() { + return this.dnsZoneResourceId; + } + + /** + * Set the dnsZoneResourceId property: Resource ID of the DNS Zone to be associated with the web app. Used only when + * Web App Routing is enabled. + * + * @param dnsZoneResourceId the dnsZoneResourceId value to set. + * @return the ManagedClusterIngressProfileWebAppRouting object itself. + */ + public ManagedClusterIngressProfileWebAppRouting withDnsZoneResourceId(String dnsZoneResourceId) { + this.dnsZoneResourceId = dnsZoneResourceId; + 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/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..a5ed63848d7db --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Managed Clusters operation. */ +@Fluent +public final class ManagedClusterListResult { + /* + * 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..26fff868ad1f6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfile.java @@ -0,0 +1,227 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Profile of the managed cluster load balancer. */ +@Fluent +public final class ManagedClusterLoadBalancerProfile { + /* + * 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..313a7d0076a01 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.java @@ -0,0 +1,83 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Desired managed outbound IPs for the cluster load balancer. */ +@Fluent +public final class ManagedClusterLoadBalancerProfileManagedOutboundIPs { + /* + * The desired number of IPv4 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; + + /* + * The desired number of IPv6 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 0 for single-stack and 1 for + * dual-stack. + */ + @JsonProperty(value = "countIPv6") + private Integer countIPv6; + + /** + * Get the count property: The desired number of IPv4 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 IPv4 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; + } + + /** + * Get the countIPv6 property: The desired number of IPv6 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 0 for single-stack + * and 1 for dual-stack. + * + * @return the countIPv6 value. + */ + public Integer countIPv6() { + return this.countIPv6; + } + + /** + * Set the countIPv6 property: The desired number of IPv6 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 0 for single-stack + * and 1 for dual-stack. + * + * @param countIPv6 the countIPv6 value to set. + * @return the ManagedClusterLoadBalancerProfileManagedOutboundIPs object itself. + */ + public ManagedClusterLoadBalancerProfileManagedOutboundIPs withCountIPv6(Integer countIPv6) { + this.countIPv6 = countIPv6; + 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..6186aa6010723 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIPs.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Desired outbound IP resources for the cluster load balancer. */ +@Fluent +public final class ManagedClusterLoadBalancerProfileOutboundIPs { + /* + * 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..79d136748a53c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterLoadBalancerProfileOutboundIpPrefixes.java @@ -0,0 +1,51 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Desired outbound IP Prefix resources for the cluster load balancer. */ +@Fluent +public final class ManagedClusterLoadBalancerProfileOutboundIpPrefixes { + /* + * 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..686879c90b647 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterManagedOutboundIpProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** Profile of the managed outbound IP resources of the managed cluster. */ +@Fluent +public final class ManagedClusterManagedOutboundIpProfile { + /* + * 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..23d62f1f02304 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterNatGatewayProfile.java @@ -0,0 +1,111 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Profile of the managed cluster NAT gateway. */ +@Fluent +public final class ManagedClusterNatGatewayProfile { + /* + * 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/ManagedClusterOidcIssuerProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterOidcIssuerProfile.java new file mode 100644 index 0000000000000..23815bfb90951 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterOidcIssuerProfile.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.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OIDC issuer profile of the Managed Cluster. */ +@Fluent +public final class ManagedClusterOidcIssuerProfile { + /* + * The OIDC issuer url of the Managed Cluster. + */ + @JsonProperty(value = "issuerURL", access = JsonProperty.Access.WRITE_ONLY) + private String issuerUrl; + + /* + * Whether the OIDC issuer is enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the issuerUrl property: The OIDC issuer url of the Managed Cluster. + * + * @return the issuerUrl value. + */ + public String issuerUrl() { + return this.issuerUrl; + } + + /** + * Get the enabled property: Whether the OIDC issuer is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the OIDC issuer is enabled. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterOidcIssuerProfile object itself. + */ + public ManagedClusterOidcIssuerProfile withEnabled(Boolean enabled) { + this.enabled = enabled; + 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/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..cf9bd52d2288b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentity.java @@ -0,0 +1,179 @@ +// 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.JsonProperty; + +/** Details about the pod identity assigned to the Managed Cluster. */ +@Fluent +public class ManagedClusterPodIdentity { + /* + * 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(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterPodIdentity.class); +} 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..9ed2613eca2c5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityException.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * A pod identity exception, which allows pods with certain labels to access the Azure Instance Metadata Service (IMDS) + * endpoint without being intercepted by the node-managed identity (NMI) server. 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 { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterPodIdentityException.class); +} 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..2422631d1c723 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProfile.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * 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 pod identity + * integration. + */ +@Fluent +public final class ManagedClusterPodIdentityProfile { + /* + * 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..5f76952338357 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningError.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An error response from the pod identity provisioning. */ +@Fluent +public final class ManagedClusterPodIdentityProvisioningError { + /* + * 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..24ae6db978220 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningErrorBody.java @@ -0,0 +1,136 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An error response from the pod identity provisioning. */ +@Fluent +public final class ManagedClusterPodIdentityProvisioningErrorBody { + /* + * 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..42ad8171fe38d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPodIdentityProvisioningInfo.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedClusterPodIdentityProvisioningInfo model. */ +@Fluent +public final class ManagedClusterPodIdentityProvisioningInfo { + /* + * 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..faee9211247e8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfile.java @@ -0,0 +1,144 @@ +// 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.JsonProperty; +import java.util.List; + +/** The list of available upgrade versions. */ +@Fluent +public final class ManagedClusterPoolUpgradeProfile { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterPoolUpgradeProfile.class); +} 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..56e0b3767ecd4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPoolUpgradeProfileUpgradesItem.java @@ -0,0 +1,72 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedClusterPoolUpgradeProfileUpgradesItem model. */ +@Fluent +public final class ManagedClusterPoolUpgradeProfileUpgradesItem { + /* + * 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..a8a1da0e60ff1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesAutoScalerProfile.java @@ -0,0 +1,546 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters to be applied to the cluster-autoscaler when enabled. */ +@Fluent +public final class ManagedClusterPropertiesAutoScalerProfile { + /* + * 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/ManagedClusterPropertiesForSnapshot.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesForSnapshot.java new file mode 100644 index 0000000000000..d3f4260bbdef8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterPropertiesForSnapshot.java @@ -0,0 +1,120 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** managed cluster properties for snapshot, these properties are read only. */ +@Fluent +public final class ManagedClusterPropertiesForSnapshot { + /* + * The current kubernetes version. + */ + @JsonProperty(value = "kubernetesVersion") + private String kubernetesVersion; + + /* + * The current managed cluster sku. + */ + @JsonProperty(value = "sku") + private ManagedClusterSku sku; + + /* + * Whether the cluster has enabled Kubernetes Role-Based Access Control or + * not. + */ + @JsonProperty(value = "enableRbac") + private Boolean enableRbac; + + /* + * The current network profile. + */ + @JsonProperty(value = "networkProfile", access = JsonProperty.Access.WRITE_ONLY) + private NetworkProfileForSnapshot networkProfile; + + /** + * Get the kubernetesVersion property: The current kubernetes version. + * + * @return the kubernetesVersion value. + */ + public String kubernetesVersion() { + return this.kubernetesVersion; + } + + /** + * Set the kubernetesVersion property: The current kubernetes version. + * + * @param kubernetesVersion the kubernetesVersion value to set. + * @return the ManagedClusterPropertiesForSnapshot object itself. + */ + public ManagedClusterPropertiesForSnapshot withKubernetesVersion(String kubernetesVersion) { + this.kubernetesVersion = kubernetesVersion; + return this; + } + + /** + * Get the sku property: The current managed cluster sku. + * + * @return the sku value. + */ + public ManagedClusterSku sku() { + return this.sku; + } + + /** + * Set the sku property: The current managed cluster sku. + * + * @param sku the sku value to set. + * @return the ManagedClusterPropertiesForSnapshot object itself. + */ + public ManagedClusterPropertiesForSnapshot withSku(ManagedClusterSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the enableRbac property: Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + * + * @return the enableRbac value. + */ + public Boolean enableRbac() { + return this.enableRbac; + } + + /** + * Set the enableRbac property: Whether the cluster has enabled Kubernetes Role-Based Access Control or not. + * + * @param enableRbac the enableRbac value to set. + * @return the ManagedClusterPropertiesForSnapshot object itself. + */ + public ManagedClusterPropertiesForSnapshot withEnableRbac(Boolean enableRbac) { + this.enableRbac = enableRbac; + return this; + } + + /** + * Get the networkProfile property: The current network profile. + * + * @return the networkProfile value. + */ + public NetworkProfileForSnapshot networkProfile() { + return this.networkProfile; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (networkProfile() != null) { + networkProfile().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..8dee7d3b2cdd7 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfile.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Security profile for the container service cluster. */ +@Fluent +public final class ManagedClusterSecurityProfile { + /* + * Azure Defender settings for the security profile. + */ + @JsonProperty(value = "azureDefender") + private ManagedClusterSecurityProfileAzureDefender azureDefender; + + /* + * Azure Key Vault [key management + * service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) + * settings for the security profile. + */ + @JsonProperty(value = "azureKeyVaultKms") + private AzureKeyVaultKms azureKeyVaultKms; + + /* + * [Workload + * Identity](https://azure.github.io/azure-workload-identity/docs/) + * settings for the security profile. + */ + @JsonProperty(value = "workloadIdentity") + private ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity; + + /** + * 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; + } + + /** + * Get the azureKeyVaultKms property: Azure Key Vault [key management + * service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for the security profile. + * + * @return the azureKeyVaultKms value. + */ + public AzureKeyVaultKms azureKeyVaultKms() { + return this.azureKeyVaultKms; + } + + /** + * Set the azureKeyVaultKms property: Azure Key Vault [key management + * service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for the security profile. + * + * @param azureKeyVaultKms the azureKeyVaultKms value to set. + * @return the ManagedClusterSecurityProfile object itself. + */ + public ManagedClusterSecurityProfile withAzureKeyVaultKms(AzureKeyVaultKms azureKeyVaultKms) { + this.azureKeyVaultKms = azureKeyVaultKms; + return this; + } + + /** + * Get the workloadIdentity property: [Workload Identity](https://azure.github.io/azure-workload-identity/docs/) + * settings for the security profile. + * + * @return the workloadIdentity value. + */ + public ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity() { + return this.workloadIdentity; + } + + /** + * Set the workloadIdentity property: [Workload Identity](https://azure.github.io/azure-workload-identity/docs/) + * settings for the security profile. + * + * @param workloadIdentity the workloadIdentity value to set. + * @return the ManagedClusterSecurityProfile object itself. + */ + public ManagedClusterSecurityProfile withWorkloadIdentity( + ManagedClusterSecurityProfileWorkloadIdentity workloadIdentity) { + this.workloadIdentity = workloadIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureDefender() != null) { + azureDefender().validate(); + } + if (azureKeyVaultKms() != null) { + azureKeyVaultKms().validate(); + } + if (workloadIdentity() != null) { + workloadIdentity().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..5d1e42e291018 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileAzureDefender.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.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Defender settings for the security profile. */ +@Fluent +public final class ManagedClusterSecurityProfileAzureDefender { + /* + * 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/ManagedClusterSecurityProfileWorkloadIdentity.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileWorkloadIdentity.java new file mode 100644 index 0000000000000..73ad3c0c0c6d1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSecurityProfileWorkloadIdentity.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.fasterxml.jackson.annotation.JsonProperty; + +/** Workload Identity settings for the security profile. */ +@Fluent +public class ManagedClusterSecurityProfileWorkloadIdentity { + /* + * Whether to enable Workload Identity + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the enabled property: Whether to enable Workload Identity. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable Workload Identity. + * + * @param enabled the enabled value to set. + * @return the ManagedClusterSecurityProfileWorkloadIdentity object itself. + */ + public ManagedClusterSecurityProfileWorkloadIdentity withEnabled(Boolean enabled) { + this.enabled = enabled; + 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..fd23a5f673e6d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterServicePrincipalProfile.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.JsonProperty; + +/** Information about a service principal identity for the cluster to use for manipulating Azure APIs. */ +@Fluent +public final class ManagedClusterServicePrincipalProfile { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterServicePrincipalProfile.class); +} 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..47429006054fe --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSku.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.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU of a Managed Cluster. */ +@Fluent +public final class ManagedClusterSku { + /* + * 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/ManagedClusterSnapshot.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSnapshot.java new file mode 100644 index 0000000000000..344ed69940377 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSnapshot.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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterSnapshotInner; +import java.util.Map; + +/** An immutable client-side representation of ManagedClusterSnapshot. */ +public interface ManagedClusterSnapshot { + /** + * 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: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the creationData property: CreationData to be used to specify the source 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 managedClusterPropertiesReadOnly property: What the properties will be showed when getting managed + * cluster snapshot. Those properties are read-only. + * + * @return the managedClusterPropertiesReadOnly value. + */ + ManagedClusterPropertiesForSnapshot managedClusterPropertiesReadOnly(); + + /** + * 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.ManagedClusterSnapshotInner + * object. + * + * @return the inner object. + */ + ManagedClusterSnapshotInner innerModel(); + + /** The entirety of the ManagedClusterSnapshot definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ManagedClusterSnapshot definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedClusterSnapshot definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ManagedClusterSnapshot 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 ManagedClusterSnapshot definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ManagedClusterSnapshot 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. + */ + ManagedClusterSnapshot create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedClusterSnapshot create(Context context); + } + /** The stage of the ManagedClusterSnapshot 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 ManagedClusterSnapshot definition allowing to specify creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: CreationData to be used to specify the source resource ID to create + * this snapshot.. + * + * @param creationData CreationData to be used to specify the source resource ID to create this snapshot. + * @return the next definition stage. + */ + WithCreate withCreationData(CreationData creationData); + } + /** The stage of the ManagedClusterSnapshot 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 ManagedClusterSnapshot resource. + * + * @return the stage of resource update. + */ + ManagedClusterSnapshot.Update update(); + + /** The template for ManagedClusterSnapshot update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedClusterSnapshot apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedClusterSnapshot apply(Context context); + } + /** The ManagedClusterSnapshot update stages. */ + interface UpdateStages { + /** The stage of the ManagedClusterSnapshot 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. + */ + ManagedClusterSnapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedClusterSnapshot refresh(Context context); +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSnapshotListResult.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSnapshotListResult.java new file mode 100644 index 0000000000000..016589622e8ff --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSnapshotListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerservice.generated.fluent.models.ManagedClusterSnapshotInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Managed Cluster Snapshots operation. */ +@Fluent +public final class ManagedClusterSnapshotListResult { + /* + * The list of managed cluster snapshots. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of managed cluster snapshot results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of managed cluster snapshots. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of managed cluster snapshots. + * + * @param value the value value to set. + * @return the ManagedClusterSnapshotListResult object itself. + */ + public ManagedClusterSnapshotListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of managed cluster 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/ManagedClusterSnapshots.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSnapshots.java new file mode 100644 index 0000000000000..07c1d1eb23fcb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterSnapshots.java @@ -0,0 +1,162 @@ +// 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 ManagedClusterSnapshots. */ +public interface ManagedClusterSnapshots { + /** + * Gets a list of managed cluster 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 managed cluster snapshots in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of managed cluster 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 managed cluster snapshots in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 Cluster Snapshots operation as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 Cluster Snapshots operation as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot. + */ + ManagedClusterSnapshot getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Gets a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Deletes a managed cluster snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Gets a managed cluster 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 managed cluster snapshot along with {@link Response}. + */ + ManagedClusterSnapshot getById(String id); + + /** + * Gets a managed cluster 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 managed cluster snapshot along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a managed cluster 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 managed cluster 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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagedClusterSnapshot resource. + * + * @param name resource name. + * @return the first stage of the new ManagedClusterSnapshot definition. + */ + ManagedClusterSnapshot.DefinitionStages.Blank define(String name); +} 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..d8d4538d7a72b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusterWindowsProfile.java @@ -0,0 +1,203 @@ +// 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.JsonProperty; + +/** Profile for Windows VMs in the managed cluster. */ +@Fluent +public final class ManagedClusterWindowsProfile { + /* + * 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; + + /* + * The Windows gMSA Profile in the Managed Cluster. + */ + @JsonProperty(value = "gmsaProfile") + private WindowsGmsaProfile gmsaProfile; + + /** + * 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; + } + + /** + * Get the gmsaProfile property: The Windows gMSA Profile in the Managed Cluster. + * + * @return the gmsaProfile value. + */ + public WindowsGmsaProfile gmsaProfile() { + return this.gmsaProfile; + } + + /** + * Set the gmsaProfile property: The Windows gMSA Profile in the Managed Cluster. + * + * @param gmsaProfile the gmsaProfile value to set. + * @return the ManagedClusterWindowsProfile object itself. + */ + public ManagedClusterWindowsProfile withGmsaProfile(WindowsGmsaProfile gmsaProfile) { + this.gmsaProfile = gmsaProfile; + 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")); + } + if (gmsaProfile() != null) { + gmsaProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedClusterWindowsProfile.class); +} 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..327210a8dd935 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedClusters.java @@ -0,0 +1,592 @@ +// 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 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 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 along with {@link Response}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists managed clusters in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets the upgrade profile of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link 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. The name is case insensitive. + * @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. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param serverFqdn server fqdn type for credentials to be returned. + * @param format Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return + * azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin + * binary in the path. + * @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 along with {@link Response}. + */ + Response listClusterUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Format format, Context context); + + /** + * Lists the cluster monitoring user credentials of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response listClusterMonitoringUserCredentialsWithResponse( + String resourceGroupName, String resourceName, String serverFqdn, Context context); + + /** + * Gets a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 ignorePodDisruptionBudget); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 delete(String resourceGroupName, String resourceName); + + /** + * Deletes a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @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 ignorePodDisruptionBudget, 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 rotateServiceAccountSigningKeys(String resourceGroupName, String resourceName); + + /** + * Rotates the service account signing keys of a managed cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 rotateServiceAccountSigningKeys(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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + 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. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 ignorePodDisruptionBudget ignore-pod-disruption-budget=true to delete those pods on a node without + * considering Pod Disruption Budget. + * @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, String ignorePodDisruptionBudget, 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..c1468dc27ed6c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ManagedServiceIdentityUserAssignedIdentitiesValue.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ManagedServiceIdentityUserAssignedIdentitiesValue model. */ +@Immutable +public final class ManagedServiceIdentityUserAssignedIdentitiesValue { + /* + * 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..4d10509c2b787 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkPlugin.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.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"); + + /** Static value none for NetworkPlugin. */ + public static final NetworkPlugin NONE = fromString("none"); + + /** + * 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..7272c93bb3d3f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkProfile.java @@ -0,0 +1,98 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Represents the OpenShift networking configuration. */ +@Fluent +public final class NetworkProfile { + /* + * 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/NetworkProfileForSnapshot.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkProfileForSnapshot.java new file mode 100644 index 0000000000000..216e441e80035 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/NetworkProfileForSnapshot.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.fasterxml.jackson.annotation.JsonProperty; + +/** network profile for managed cluster snapshot, these properties are read only. */ +@Fluent +public final class NetworkProfileForSnapshot { + /* + * networkPlugin for managed cluster snapshot. + */ + @JsonProperty(value = "networkPlugin") + private NetworkPlugin networkPlugin; + + /* + * networkPolicy for managed cluster snapshot. + */ + @JsonProperty(value = "networkPolicy") + private NetworkPolicy networkPolicy; + + /* + * The network mode Azure CNI is configured with. networkMode for managed + * cluster snapshot. + */ + @JsonProperty(value = "networkMode") + private NetworkMode networkMode; + + /* + * The load balancer sku for the managed cluster. loadBalancerSku for + * managed cluster snapshot. + */ + @JsonProperty(value = "loadBalancerSku") + private LoadBalancerSku loadBalancerSku; + + /** + * Get the networkPlugin property: networkPlugin for managed cluster snapshot. + * + * @return the networkPlugin value. + */ + public NetworkPlugin networkPlugin() { + return this.networkPlugin; + } + + /** + * Set the networkPlugin property: networkPlugin for managed cluster snapshot. + * + * @param networkPlugin the networkPlugin value to set. + * @return the NetworkProfileForSnapshot object itself. + */ + public NetworkProfileForSnapshot withNetworkPlugin(NetworkPlugin networkPlugin) { + this.networkPlugin = networkPlugin; + return this; + } + + /** + * Get the networkPolicy property: networkPolicy for managed cluster snapshot. + * + * @return the networkPolicy value. + */ + public NetworkPolicy networkPolicy() { + return this.networkPolicy; + } + + /** + * Set the networkPolicy property: networkPolicy for managed cluster snapshot. + * + * @param networkPolicy the networkPolicy value to set. + * @return the NetworkProfileForSnapshot object itself. + */ + public NetworkProfileForSnapshot withNetworkPolicy(NetworkPolicy networkPolicy) { + this.networkPolicy = networkPolicy; + return this; + } + + /** + * Get the networkMode property: The network mode Azure CNI is configured with. networkMode for managed cluster + * snapshot. + * + * @return the networkMode value. + */ + public NetworkMode networkMode() { + return this.networkMode; + } + + /** + * Set the networkMode property: The network mode Azure CNI is configured with. networkMode for managed cluster + * snapshot. + * + * @param networkMode the networkMode value to set. + * @return the NetworkProfileForSnapshot object itself. + */ + public NetworkProfileForSnapshot withNetworkMode(NetworkMode networkMode) { + this.networkMode = networkMode; + return this; + } + + /** + * Get the loadBalancerSku property: The load balancer sku for the managed cluster. loadBalancerSku for managed + * cluster snapshot. + * + * @return the loadBalancerSku value. + */ + public LoadBalancerSku loadBalancerSku() { + return this.loadBalancerSku; + } + + /** + * Set the loadBalancerSku property: The load balancer sku for the managed cluster. loadBalancerSku for managed + * cluster snapshot. + * + * @param loadBalancerSku the loadBalancerSku value to set. + * @return the NetworkProfileForSnapshot object itself. + */ + public NetworkProfileForSnapshot withLoadBalancerSku(LoadBalancerSku loadBalancerSku) { + this.loadBalancerSku = loadBalancerSku; + 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..c36a946109839 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OSOptionProperty.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.JsonProperty; + +/** OS option property. */ +@Fluent +public final class OSOptionProperty { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OSOptionProperty.class); +} 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..f08905fc110e3 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAadIdentityProvider.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.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 { + /* + * 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..e53a3158d0266 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAgentPoolProfile.java @@ -0,0 +1,193 @@ +// 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.JsonProperty; + +/** Defines the configuration of the OpenShift cluster VMs. */ +@Fluent +public final class OpenShiftManagedClusterAgentPoolProfile { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OpenShiftManagedClusterAgentPoolProfile.class); +} 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..4faf11784117e --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterAuthProfile.java @@ -0,0 +1,51 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines all possible authentication profiles for the OpenShift cluster. */ +@Fluent +public final class OpenShiftManagedClusterAuthProfile { + /* + * 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..3260757b6e023 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterBaseIdentityProvider.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.annotation.Immutable; +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 { + /** + * 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..ff4e144142733 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterIdentityProvider.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.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the configuration of the identity providers to be used in the OpenShift cluster. */ +@Fluent +public final class OpenShiftManagedClusterIdentityProvider { + /* + * 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..077b467677378 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OpenShiftManagedClusterInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List OpenShift Managed Clusters operation. */ +@Fluent +public final class OpenShiftManagedClusterListResult { + /* + * 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..f95ece81b0f83 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusterMasterPoolProfile.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OpenShiftManagedClusterMaterPoolProfile contains configuration for OpenShift master VMs. */ +@Fluent +public final class OpenShiftManagedClusterMasterPoolProfile { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OpenShiftManagedClusterMasterPoolProfile.class); +} 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..8e10bd511b8fb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftManagedClusters.java @@ -0,0 +1,167 @@ +// 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 as paginated response with {@link + * PagedIterable}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + 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 as paginated response with {@link + * PagedIterable}. + */ + 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 along with {@link + * Response}. + */ + 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 along with {@link + * Response}. + */ + 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 along with {@link + * Response}. + */ + 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..7c3f6fe9549e5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OpenShiftRouterProfile.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.fasterxml.jackson.annotation.JsonProperty; + +/** Represents an OpenShift router. */ +@Fluent +public final class OpenShiftRouterProfile { + /* + * 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..2bbcc84ed1a3c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OperationListResult.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.annotation.Immutable; +import com.azure.resourcemanager.containerservice.generated.fluent.models.OperationValueInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Operation response. */ +@Immutable +public final class OperationListResult { + /* + * 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..472628d41dfed --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + 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..a155b4fe760a5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorProfile.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.JsonProperty; + +/** Contains information about orchestrator. */ +@Fluent +public final class OrchestratorProfile { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OrchestratorProfile.class); +} 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..cd0ff64fb4e26 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OrchestratorVersionProfile.java @@ -0,0 +1,169 @@ +// 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.JsonProperty; +import java.util.List; + +/** The profile of an orchestrator and its available versions. */ +@Fluent +public final class OrchestratorVersionProfile { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OrchestratorVersionProfile.class); +} 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..f3882e8d060b0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/OutboundEnvironmentEndpointCollection.java @@ -0,0 +1,74 @@ +// 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.JsonProperty; +import java.util.List; + +/** Collection of OutboundEnvironmentEndpoint. */ +@Fluent +public final class OutboundEnvironmentEndpointCollection { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OutboundEnvironmentEndpointCollection.class); +} 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..3031d27391c86 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PowerState.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.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the Power State of the cluster. */ +@Fluent +public final class PowerState { + /* + * 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..eda10052781f6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateEndpoint.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.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint which a connection belongs to. */ +@Fluent +public final class PrivateEndpoint { + /* + * 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..5d2d4d684c0eb --- /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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Updates a private endpoint connection. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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. The name is case insensitive. + * @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. The name is case insensitive. + * @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..9a9d68507ec6f --- /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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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..f52a7eb1621b0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,72 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The state of a private link service connection. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * 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..7e4cb2d0648b8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/PurchasePlan.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Used for establishing the purchase context of any 3rd Party artifact through MarketPlace. */ +@Fluent +public final class PurchasePlan { + /* + * 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..c8b0d30dc842a --- /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. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + 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..c9edc69444117 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/ResourceReference.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.fasterxml.jackson.annotation.JsonProperty; + +/** A reference to an Azure resource. */ +@Fluent +public final class ResourceReference { + /* + * 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..0102b8e7a056c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/RunCommandRequest.java @@ -0,0 +1,106 @@ +// 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.JsonProperty; + +/** A run command request. */ +@Fluent +public final class RunCommandRequest { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RunCommandRequest.class); +} 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..d41fe518e1890 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/Snapshot.java @@ -0,0 +1,280 @@ +// 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: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @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 kubernetesVersion property: The version of Kubernetes. + * + * @return the kubernetesVersion value. + */ + String kubernetesVersion(); + + /** + * Gets the nodeImageVersion property: The version of node image. + * + * @return the nodeImageVersion value. + */ + String nodeImageVersion(); + + /** + * 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 vmSize property: The size of the VM. + * + * @return the vmSize value. + */ + String vmSize(); + + /** + * Gets the enableFips property: Whether to use a FIPS-enabled OS. + * + * @return the enableFips value. + */ + Boolean enableFips(); + + /** + * 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. The name is case insensitive. + * @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..88cebf4071fc1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotListResult.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.containerservice.generated.fluent.models.SnapshotInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the List Snapshots operation. */ +@Fluent +public final class SnapshotListResult { + /* + * 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..bd6442e7e94af --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SnapshotType.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 SnapshotType. */ +public final class SnapshotType extends ExpandableStringEnum { + /** Static value NodePool for SnapshotType. */ + public static final SnapshotType NODE_POOL = fromString("NodePool"); + + /** Static value ManagedCluster for SnapshotType. */ + public static final SnapshotType MANAGED_CLUSTER = fromString("ManagedCluster"); + + /** + * 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..399b87ed60f42 --- /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 as paginated response with {@link PagedIterable}. + */ + 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists snapshots in the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Deletes a snapshot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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. The name is case insensitive. + * @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 {@link 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 along with {@link Response}. + */ + 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 along with {@link Response}. + */ + 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 {@link 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..f13dc8b6616c5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/SysctlConfig.java @@ -0,0 +1,748 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Sysctl settings for Linux agent nodes. */ +@Fluent +public final class SysctlConfig { + /* + * 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..2c6d48096e67d --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TagsObject.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.annotation.Fluent; +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 { + /* + * 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..561435504d999 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeInWeek.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Time in a week. */ +@Fluent +public final class TimeInWeek { + /* + * 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..6cc6a882d58b8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/TimeSpan.java @@ -0,0 +1,73 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A time range. For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. */ +@Fluent +public final class TimeSpan { + /* + * 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..c40ad7e84d2b6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/UserAssignedIdentity.java @@ -0,0 +1,98 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Details about a user assigned identity. */ +@Fluent +public class UserAssignedIdentity { + /* + * 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/WindowsGmsaProfile.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WindowsGmsaProfile.java new file mode 100644 index 0000000000000..9cf91fa8fd215 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WindowsGmsaProfile.java @@ -0,0 +1,109 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Windows gMSA Profile in the managed cluster. */ +@Fluent +public final class WindowsGmsaProfile { + /* + * Whether to enable Windows gMSA. Specifies whether to enable Windows gMSA + * in the managed cluster. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Specifies the DNS server for Windows gMSA.

Set it to empty if + * you have configured the DNS server in the vnet which is used to create + * the managed cluster. + */ + @JsonProperty(value = "dnsServer") + private String dnsServer; + + /* + * Specifies the root domain name for Windows gMSA.

Set it to + * empty if you have configured the DNS server in the vnet which is used to + * create the managed cluster. + */ + @JsonProperty(value = "rootDomainName") + private String rootDomainName; + + /** + * Get the enabled property: Whether to enable Windows gMSA. Specifies whether to enable Windows gMSA in the managed + * cluster. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether to enable Windows gMSA. Specifies whether to enable Windows gMSA in the managed + * cluster. + * + * @param enabled the enabled value to set. + * @return the WindowsGmsaProfile object itself. + */ + public WindowsGmsaProfile withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the dnsServer property: Specifies the DNS server for Windows gMSA. <br><br> Set it to empty if + * you have configured the DNS server in the vnet which is used to create the managed cluster. + * + * @return the dnsServer value. + */ + public String dnsServer() { + return this.dnsServer; + } + + /** + * Set the dnsServer property: Specifies the DNS server for Windows gMSA. <br><br> Set it to empty if + * you have configured the DNS server in the vnet which is used to create the managed cluster. + * + * @param dnsServer the dnsServer value to set. + * @return the WindowsGmsaProfile object itself. + */ + public WindowsGmsaProfile withDnsServer(String dnsServer) { + this.dnsServer = dnsServer; + return this; + } + + /** + * Get the rootDomainName property: Specifies the root domain name for Windows gMSA. <br><br> Set it to + * empty if you have configured the DNS server in the vnet which is used to create the managed cluster. + * + * @return the rootDomainName value. + */ + public String rootDomainName() { + return this.rootDomainName; + } + + /** + * Set the rootDomainName property: Specifies the root domain name for Windows gMSA. <br><br> Set it to + * empty if you have configured the DNS server in the vnet which is used to create the managed cluster. + * + * @param rootDomainName the rootDomainName value to set. + * @return the WindowsGmsaProfile object itself. + */ + public WindowsGmsaProfile withRootDomainName(String rootDomainName) { + this.rootDomainName = rootDomainName; + 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/WorkloadRuntime.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WorkloadRuntime.java new file mode 100644 index 0000000000000..0cd205b934099 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/main/java/com/azure/resourcemanager/containerservice/generated/models/WorkloadRuntime.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 WorkloadRuntime. */ +public final class WorkloadRuntime extends ExpandableStringEnum { + /** Static value OCIContainer for WorkloadRuntime. */ + public static final WorkloadRuntime OCICONTAINER = fromString("OCIContainer"); + + /** Static value WasmWasi for WorkloadRuntime. */ + public static final WorkloadRuntime WASM_WASI = fromString("WasmWasi"); + + /** + * Creates or finds a WorkloadRuntime from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkloadRuntime. + */ + @JsonCreator + public static WorkloadRuntime fromString(String name) { + return fromString(name, WorkloadRuntime.class); + } + + /** @return known WorkloadRuntime values. */ + public static Collection values() { + return values(WorkloadRuntime.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/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..4b4d21d1fcec1 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsCreateOrUpdateSamples.java @@ -0,0 +1,515 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.AgentPool; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.Code; +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.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.ScaleSetEvictionPolicy; +import com.azure.resourcemanager.containerservice.generated.models.ScaleSetPriority; +import com.azure.resourcemanager.containerservice.generated.models.SysctlConfig; +import com.azure.resourcemanager.containerservice.generated.models.WorkloadRuntime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AgentPools CreateOrUpdate. */ +public final class AgentPoolsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableFIPS.json + */ + /** + * Sample code: Create Agent Pool with FIPS enabled OS. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithFIPSEnabledOS( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableFips(true) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_GPUMIG.json + */ + /** + * Sample code: Create Agent Pool with GPUMIG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithGPUMIG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_ND96asr_v4") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withKubeletConfig( + new KubeletConfig() + .withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig( + new LinuxOSConfig() + .withSysctls( + new SysctlConfig() + .withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .withGpuInstanceProfile(GpuInstanceProfile.MIG2G) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json + */ + /** + * Sample code: Create Agent Pool with Dedicated Host Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithDedicatedHostGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withHostGroupId( + "/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Update.json + */ + /** + * Sample code: Create/Update Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("name1", "val1")) + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeLabels(mapOf("key1", "val1")) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Start.json + */ + /** + * Sample code: Start Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void startAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withPowerState(new PowerState().withCode(Code.RUNNING)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Spot.json + */ + /** + * Sample code: Create Spot Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createSpotAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withTags(mapOf("name1", "val1")) + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeLabels(mapOf("key1", "val1")) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Ephemeral.json + */ + /** + * Sample code: Create Agent Pool with Ephemeral OS Disk. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithEphemeralOSDisk( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withOsDiskType(OSDiskType.EPHEMERAL) + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsAssociate_CRG.json + */ + /** + * Sample code: Associate Agent Pool with Capacity Reservation Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void associateAgentPoolWithCapacityReservationGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withCapacityReservationGroupId( + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/CapacityReservationGroups/crg1") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + */ + /** + * Sample code: Create Agent Pool with EncryptionAtHost enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithEncryptionAtHostEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableEncryptionAtHost(true) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableUltraSSD.json + */ + /** + * Sample code: Create Agent Pool with UltraSSD enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithUltraSSDEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableUltraSsd(true) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_WasmWasi.json + */ + /** + * Sample code: Create Agent Pool with Krustlet and the WASI runtime. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithKrustletAndTheWASIRuntime( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withWorkloadRuntime(WorkloadRuntime.WASM_WASI) + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Snapshot.json + */ + /** + * Sample code: Create Agent Pool using an agent pool snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolUsingAnAgentPoolSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withEnableFips(true) + .withCreationData( + new CreationData() + .withSourceResourceId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_PPG.json + */ + /** + * Sample code: Create Agent Pool with PPG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithPPG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withProximityPlacementGroupId( + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_CustomNodeConfig.json + */ + /** + * Sample code: Create Agent Pool with KubeletConfig and LinuxOSConfig. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithKubeletConfigAndLinuxOSConfig( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOrchestratorVersion("") + .withKubeletConfig( + new KubeletConfig() + .withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig( + new LinuxOSConfig() + .withSysctls( + new SysctlConfig() + .withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Stop.json + */ + /** + * Sample code: Stop Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void stopAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withPowerState(new PowerState().withCode(Code.STOPPED)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_MessageOfTheDay.json + */ + /** + * Sample code: Create Agent Pool with Message of the Day. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithMessageOfTheDay( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsDiskSizeGB(64) + .withMessageOfTheDay("Zm9vCg==") + .withOsType(OSType.LINUX) + .withMode(AgentPoolMode.USER) + .withOrchestratorVersion("") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_OSSKU.json + */ + /** + * Sample code: Create Agent Pool with OSSKU. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createAgentPoolWithOSSKU( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .agentPools() + .define("agentpool1") + .withExistingManagedCluster("rg1", "clustername1") + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOsSku(Ossku.CBLMARINER) + .withOrchestratorVersion("") + .withKubeletConfig( + new KubeletConfig() + .withCpuManagerPolicy("static") + .withCpuCfsQuota(true) + .withCpuCfsQuotaPeriod("200ms") + .withImageGcHighThreshold(90) + .withImageGcLowThreshold(70) + .withTopologyManagerPolicy("best-effort") + .withAllowedUnsafeSysctls(Arrays.asList("kernel.msg*", "net.core.somaxconn")) + .withFailSwapOn(false)) + .withLinuxOSConfig( + new LinuxOSConfig() + .withSysctls( + new SysctlConfig() + .withNetCoreWmemDefault(12345) + .withNetIpv4TcpTwReuse(true) + .withNetIpv4IpLocalPortRange("20000 60000") + .withKernelThreadsMax(99999)) + .withTransparentHugePageEnabled("always") + .withTransparentHugePageDefrag("madvise") + .withSwapFileSizeMB(1500)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Update.json + */ + /** + * Sample code: Update Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + AgentPool resource = + manager.agentPools().getWithResponse("rg1", "clustername1", "agentpool1", Context.NONE).getValue(); + resource + .update() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withMaxCount(2) + .withMinCount(2) + .withEnableAutoScaling(true) + .withOrchestratorVersion("") + .withScaleSetPriority(ScaleSetPriority.SPOT) + .withScaleSetEvictionPolicy(ScaleSetEvictionPolicy.DELETE) + .withNodeTaints(Arrays.asList("Key1=Value1:NoSchedule")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteSamples.java new file mode 100644 index 0000000000000..a8c881c4cc708 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsDeleteSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for AgentPools Delete. */ +public final class AgentPoolsDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.json + */ + /** + * Sample code: Delete Agent Pool by ignoring PodDisruptionBudget. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteAgentPoolByIgnoringPodDisruptionBudget( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().delete("rg1", "clustername1", "agentpool1", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete.json + */ + /** + * Sample code: Delete Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().delete("rg1", "clustername1", "agentpool1", null, Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsSamples.java new file mode 100644 index 0000000000000..b32c743b2d719 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetAvailableAgentPoolVersionsSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for AgentPools GetAvailableAgentPoolVersions. */ +public final class AgentPoolsGetAvailableAgentPoolVersionsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json + */ + /** + * Sample code: Get available versions for agent pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getAvailableVersionsForAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().getAvailableAgentPoolVersionsWithResponse("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetSamples.java new file mode 100644 index 0000000000000..2b0edd30cb0e8 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for AgentPools Get. */ +public final class AgentPoolsGetSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGet.json + */ + /** + * Sample code: Get Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().getWithResponse("rg1", "clustername1", "agentpool1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileSamples.java new file mode 100644 index 0000000000000..d75d570afd642 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsGetUpgradeProfileSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for AgentPools GetUpgradeProfile. */ +public final class AgentPoolsGetUpgradeProfileSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetUpgradeProfile.json + */ + /** + * Sample code: Get Upgrade Profile for Agent Pool. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getUpgradeProfileForAgentPool( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().getUpgradeProfileWithResponse("rg1", "clustername1", "agentpool1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsListSamples.java new file mode 100644 index 0000000000000..7cc733c5d23b9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for AgentPools List. */ +public final class AgentPoolsListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsList.json + */ + /** + * Sample code: List Agent Pools by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listAgentPoolsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().list("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionSamples.java new file mode 100644 index 0000000000000..e2fe1e741a555 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/AgentPoolsUpgradeNodeImageVersionSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for AgentPools UpgradeNodeImageVersion. */ +public final class AgentPoolsUpgradeNodeImageVersionSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json + */ + /** + * Sample code: Upgrade Agent Pool Node Image Version. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void upgradeAgentPoolNodeImageVersion( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.agentPools().upgradeNodeImageVersion("rg1", "clustername1", "agentpool1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ContainerServicesListOrchestratorsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ContainerServicesListOrchestratorsSamples.java new file mode 100644 index 0000000000000..c90a50c9347c4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ContainerServicesListOrchestratorsSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerServices ListOrchestrators. */ +public final class ContainerServicesListOrchestratorsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-08-01/examples/ContainerServiceListOrchestrators.json + */ + /** + * Sample code: List Container Service Orchestrators. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listContainerServiceOrchestrators( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.containerServices().listOrchestratorsWithResponse("location1", null, Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..fc52f25eb1263 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerservice.generated.generated; + +import com.azure.resourcemanager.containerservice.generated.models.TimeInWeek; +import com.azure.resourcemanager.containerservice.generated.models.TimeSpan; +import com.azure.resourcemanager.containerservice.generated.models.WeekDay; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** Samples for MaintenanceConfigurations CreateOrUpdate. */ +public final class MaintenanceConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsCreate_Update.json + */ + /** + * Sample code: Create/Update Maintenance Configuration. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateMaintenanceConfiguration( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .maintenanceConfigurations() + .define("default") + .withExistingManagedCluster("rg1", "clustername1") + .withTimeInWeek(Arrays.asList(new TimeInWeek().withDay(WeekDay.MONDAY).withHourSlots(Arrays.asList(1, 2)))) + .withNotAllowedTime( + Arrays + .asList( + new TimeSpan() + .withStart(OffsetDateTime.parse("2020-11-26T03:00:00Z")) + .withEnd(OffsetDateTime.parse("2020-11-30T12:00:00Z")))) + .create(); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteSamples.java new file mode 100644 index 0000000000000..55fa9f77c6668 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsDeleteSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for MaintenanceConfigurations Delete. */ +public final class MaintenanceConfigurationsDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsDelete.json + */ + /** + * Sample code: Delete Maintenance Configuration. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteMaintenanceConfiguration( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations().deleteWithResponse("rg1", "clustername1", "default", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetSamples.java new file mode 100644 index 0000000000000..9730565366d4b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsGetSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for MaintenanceConfigurations Get. */ +public final class MaintenanceConfigurationsGetSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsGet.json + */ + /** + * Sample code: Get Maintenance Configuration. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getMaintenanceConfiguration( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations().getWithResponse("rg1", "clustername1", "default", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterSamples.java new file mode 100644 index 0000000000000..8b38fd878fab4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/MaintenanceConfigurationsListByManagedClusterSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for MaintenanceConfigurations ListByManagedCluster. */ +public final class MaintenanceConfigurationsListByManagedClusterSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsList.json + */ + /** + * Sample code: List maintenance configurations by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listMaintenanceConfigurationsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.maintenanceConfigurations().listByManagedCluster("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..77f226f95eb46 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedClusterSnapshots CreateOrUpdate. */ +public final class ManagedClusterSnapshotsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsCreate.json + */ + /** + * Sample code: Create/Update Managed Cluster Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusterSnapshots() + .define("snapshot1") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "val1", "key2", "val2")) + .withCreationData( + new CreationData() + .withSourceResourceId( + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsDeleteSamples.java new file mode 100644 index 0000000000000..ab59bfa6499f5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsDeleteSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusterSnapshots Delete. */ +public final class ManagedClusterSnapshotsDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsDelete.json + */ + /** + * Sample code: Delete Managed Cluster Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteManagedClusterSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusterSnapshots().deleteWithResponse("rg1", "snapshot1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsGetByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..11bffd59f4048 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusterSnapshots GetByResourceGroup. */ +public final class ManagedClusterSnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsGet.json + */ + /** + * Sample code: Get Managed Cluster Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedClusterSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusterSnapshots().getByResourceGroupWithResponse("rg1", "snapshot1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsListByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..d6f8890c79b01 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusterSnapshots ListByResourceGroup. */ +public final class ManagedClusterSnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json + */ + /** + * Sample code: List Managed Cluster Snapshots by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listManagedClusterSnapshotsByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusterSnapshots().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsListSamples.java new file mode 100644 index 0000000000000..80c85936cf844 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusterSnapshots List. */ +public final class ManagedClusterSnapshotsListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsList.json + */ + /** + * Sample code: List Managed Cluster Snapshots. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listManagedClusterSnapshots( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusterSnapshots().list(Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsUpdateTagsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsUpdateTagsSamples.java new file mode 100644 index 0000000000000..3baff53cf3d52 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClusterSnapshotsUpdateTagsSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSnapshot; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedClusterSnapshots UpdateTags. */ +public final class ManagedClusterSnapshotsUpdateTagsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json + */ + /** + * Sample code: Update Managed Cluster Snapshot Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateManagedClusterSnapshotTags( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + ManagedClusterSnapshot resource = + manager + .managedClusterSnapshots() + .getByResourceGroupWithResponse("rg1", "snapshot1", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key2", "new-val2", "key3", "val3")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..e0fb0eaf5032f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersCreateOrUpdateSamples.java @@ -0,0 +1,1732 @@ +// 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.generated; + +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolMode; +import com.azure.resourcemanager.containerservice.generated.models.AgentPoolType; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceLinuxProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceNetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceSshConfiguration; +import com.azure.resourcemanager.containerservice.generated.models.ContainerServiceSshPublicKey; +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import com.azure.resourcemanager.containerservice.generated.models.Expander; +import com.azure.resourcemanager.containerservice.generated.models.GpuInstanceProfile; +import com.azure.resourcemanager.containerservice.generated.models.IpFamily; +import com.azure.resourcemanager.containerservice.generated.models.LicenseType; +import com.azure.resourcemanager.containerservice.generated.models.LoadBalancerSku; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAadProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterApiServerAccessProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterHttpProxyConfig; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIdentity; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterIngressProfileWebAppRouting; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterManagedOutboundIpProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterNatGatewayProfile; +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.ManagedClusterSecurityProfileAzureDefender; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSku; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSkuName; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterSkuTier; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterWindowsProfile; +import com.azure.resourcemanager.containerservice.generated.models.ManagedServiceIdentityUserAssignedIdentitiesValue; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.Ossku; +import com.azure.resourcemanager.containerservice.generated.models.OutboundType; +import com.azure.resourcemanager.containerservice.generated.models.ResourceIdentityType; +import com.azure.resourcemanager.containerservice.generated.models.ScaleDownMode; +import com.azure.resourcemanager.containerservice.generated.models.WindowsGmsaProfile; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedClusters CreateOrUpdate. */ +public final class ManagedClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json + */ + /** + * Sample code: Create/Update Managed Cluster with dual-stack networking. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithDualStackNetworking( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withIdentity( + new ManagedClusterIdentity() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withScaleDownMode(ScaleDownMode.DEALLOCATE) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2))) + .withIpFamilies(Arrays.asList(IpFamily.IPV4, IpFamily.IPV6))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withBalanceSimilarNodeGroups("true") + .withExpander(Expander.PRIORITY) + .withMaxNodeProvisionTime("15m") + .withNewPodScaleUpDelay("1m") + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m") + .withSkipNodesWithSystemPods("false")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PodIdentity.json + */ + /** + * Sample code: Create Managed Cluster with PodIdentity enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithPodIdentityEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withPodIdentityProfile( + new ManagedClusterPodIdentityProfile().withEnabled(true).withAllowNetworkPluginKubenet(true)) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json + */ + /** + * Sample code: Create Managed Cluster with user-assigned NAT gateway as outbound type. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithUserAssignedNATGatewayAsOutboundType( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(false) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.USER_ASSIGNED_NATGATEWAY) + .withLoadBalancerSku(LoadBalancerSku.STANDARD)) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_MCSnapshot.json + */ + /** + * Sample code: Create Managed Cluster using a managed cluster snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterUsingAManagedClusterSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withCreationData( + new CreationData() + .withSourceResourceId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1")) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableFips(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_Update.json + */ + /** + * Sample code: Create/Update Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withIdentity( + new ManagedClusterIdentity() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withScaleDownMode(ScaleDownMode.DEALLOCATE) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withBalanceSimilarNodeGroups("true") + .withExpander(Expander.PRIORITY) + .withMaxNodeProvisionTime("15m") + .withNewPodScaleUpDelay("1m") + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m") + .withSkipNodesWithSystemPods("false")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + */ + /** + * Sample code: Create Managed Private Cluster with fqdn subdomain specified. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedPrivateClusterWithFqdnSubdomainSpecified( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withFqdnSubdomain("domain1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile( + new ManagedClusterApiServerAccessProfile() + .withEnablePrivateCluster(true) + .withPrivateDnsZone( + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json + */ + /** + * Sample code: Create Managed Cluster with AKS-managed NAT gateway as outbound type. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithAKSManagedNATGatewayAsOutboundType( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(false) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.MANAGED_NATGATEWAY) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withNatGatewayProfile( + new ManagedClusterNatGatewayProfile() + .withManagedOutboundIpProfile(new ManagedClusterManagedOutboundIpProfile().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersAssociate_CRG.json + */ + /** + * Sample code: Associate Managed Cluster with Capacity Reservation Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void associateManagedClusterWithCapacityReservationGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withCapacityReservationGroupId( + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/capacityReservationGroups/crg1") + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_NodePublicIPPrefix.json + */ + /** + * Sample code: Create Managed Cluster with Node Public IP Prefix. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithNodePublicIPPrefix( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withNodePublicIpPrefixId( + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix") + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnableEncryptionAtHost.json + */ + /** + * Sample code: Create Managed Cluster with EncryptionAtHost enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithEncryptionAtHostEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json + */ + /** + * Sample code: Create Managed Private Cluster with Public FQDN specified. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedPrivateClusterWithPublicFQDNSpecified( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile( + new ManagedClusterApiServerAccessProfile() + .withEnablePrivateCluster(true) + .withEnablePrivateClusterPublicFqdn(true)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_HTTPProxy.json + */ + /** + * Sample code: Create Managed Cluster with HTTP proxy configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithHTTPProxyConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig( + new ManagedClusterHttpProxyConfig() + .withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithEnableNamespaceResources.json + */ + /** + * Sample code: Create/Update Managed Cluster with EnableNamespaceResources. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithEnableNamespaceResources( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withEnableNamespaceResources(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DedicatedHostGroup.json + */ + /** + * Sample code: Create Managed Cluster with Dedicated Host Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithDedicatedHostGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withEnableNodePublicIp(true) + .withHostGroupId( + "/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1") + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(false) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnabledFIPS.json + */ + /** + * Sample code: Create Managed Cluster with FIPS enabled OS. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithFIPSEnabledOS( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableFips(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(false) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_SecurityProfile.json + */ + /** + * Sample code: Create Managed Cluster with Security Profile configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithSecurityProfileConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withSecurityProfile( + new ManagedClusterSecurityProfile() + .withAzureDefender( + new ManagedClusterSecurityProfileAzureDefender() + .withEnabled(true) + .withLogAnalyticsWorkspaceResourceId( + "/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME"))) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PPG.json + */ + /** + * Sample code: Create Managed Cluster with PPG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithPPG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withProximityPlacementGroupId( + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1") + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json + */ + /** + * Sample code: Create Managed Cluster with Web App Routing Ingress Profile configured. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithWebAppRoutingIngressProfileConfigured( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withIngressProfile( + new ManagedClusterIngressProfile() + .withWebAppRouting( + new ManagedClusterIngressProfileWebAppRouting() + .withEnabled(true) + .withDnsZoneResourceId( + "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME"))) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithAHUB.json + */ + /** + * Sample code: Create/Update Managed Cluster with EnableAHUB. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithEnableAHUB( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withIdentity( + new ManagedClusterIdentity() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$") + .withLicenseType(LicenseType.WINDOWS_SERVER)) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DisableRunCommand.json + */ + /** + * Sample code: Create Managed Cluster with RunCommand disabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithRunCommandDisabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableEncryptionAtHost(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withApiServerAccessProfile(new ManagedClusterApiServerAccessProfile().withDisableRunCommand(true)) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_Snapshot.json + */ + /** + * Sample code: Create Managed Cluster using an agent pool snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterUsingAnAgentPoolSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableFips(true) + .withCreationData( + new CreationData() + .withSourceResourceId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1")) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(false) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_OSSKU.json + */ + /** + * Sample code: Create Managed Cluster with OSSKU. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithOSSKU( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withOsSku(Ossku.CBLMARINER) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig( + new ManagedClusterHttpProxyConfig() + .withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + */ + /** + * Sample code: Create/Update AAD Managed Cluster with EnableAzureRBAC. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateAADManagedClusterWithEnableAzureRBAC( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAadProfile(new ManagedClusterAadProfile().withManaged(true).withEnableAzureRbac(true)) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnableUltraSSD.json + */ + /** + * Sample code: Create Managed Cluster with UltraSSD enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithUltraSSDEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS2_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withEnableUltraSsd(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWindowsGmsa.json + */ + /** + * Sample code: Create/Update Managed Cluster with Windows gMSA enabled. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateManagedClusterWithWindowsGMSAEnabled( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withIdentity( + new ManagedClusterIdentity() + .withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/subid1/resourceGroups/rgName1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", + new ManagedServiceIdentityUserAssignedIdentitiesValue()))) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_DS1_v2") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withAvailabilityZones(Arrays.asList("1", "2", "3")) + .withEnableNodePublicIp(true) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$") + .withGmsaProfile(new WindowsGmsaProfile().withEnabled(true))) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .create(); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_GPUMIG.json + */ + /** + * Sample code: Create Managed Cluster with GPUMIG. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createManagedClusterWithGPUMIG( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withSku(new ManagedClusterSku().withName(ManagedClusterSkuName.BASIC).withTier(ManagedClusterSkuTier.FREE)) + .withKubernetesVersion("") + .withDnsPrefix("dnsprefix1") + .withAgentPoolProfiles( + Arrays + .asList( + new ManagedClusterAgentPoolProfile() + .withCount(3) + .withVmSize("Standard_ND96asr_v4") + .withOsType(OSType.LINUX) + .withType(AgentPoolType.VIRTUAL_MACHINE_SCALE_SETS) + .withMode(AgentPoolMode.SYSTEM) + .withEnableNodePublicIp(true) + .withGpuInstanceProfile(GpuInstanceProfile.MIG3G) + .withName("nodepool1"))) + .withLinuxProfile( + new ContainerServiceLinuxProfile() + .withAdminUsername("azureuser") + .withSsh( + new ContainerServiceSshConfiguration() + .withPublicKeys(Arrays.asList(new ContainerServiceSshPublicKey().withKeyData("keydata"))))) + .withWindowsProfile( + new ManagedClusterWindowsProfile() + .withAdminUsername("azureuser") + .withAdminPassword("replacePassword1234$")) + .withServicePrincipalProfile( + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret")) + .withAddonProfiles(mapOf()) + .withEnableRbac(true) + .withEnablePodSecurityPolicy(true) + .withNetworkProfile( + new ContainerServiceNetworkProfile() + .withOutboundType(OutboundType.LOAD_BALANCER) + .withLoadBalancerSku(LoadBalancerSku.STANDARD) + .withLoadBalancerProfile( + new ManagedClusterLoadBalancerProfile() + .withManagedOutboundIPs( + new ManagedClusterLoadBalancerProfileManagedOutboundIPs().withCount(2)))) + .withAutoScalerProfile( + new ManagedClusterPropertiesAutoScalerProfile() + .withScanInterval("20s") + .withScaleDownDelayAfterAdd("15m")) + .withDiskEncryptionSetId( + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des") + .withHttpProxyConfig( + new ManagedClusterHttpProxyConfig() + .withHttpProxy("http://myproxy.server.com:8080") + .withHttpsProxy("https://myproxy.server.com:8080") + .withNoProxy(Arrays.asList("localhost", "127.0.0.1")) + .withTrustedCa("Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersDeleteSamples.java new file mode 100644 index 0000000000000..471b14ce66611 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersDeleteSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters Delete. */ +public final class ManagedClustersDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersDelete.json + */ + /** + * Sample code: Delete Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().delete("rg1", "clustername1", null, Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileSamples.java new file mode 100644 index 0000000000000..48e43a6d8f363 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetAccessProfileSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters GetAccessProfile. */ +public final class ManagedClustersGetAccessProfileSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetAccessProfile.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().getAccessProfileWithResponse("rg1", "clustername1", "clusterUser", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..d1207208e87c2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters GetByResourceGroup. */ +public final class ManagedClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGet.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().getByResourceGroupWithResponse("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetCommandResultSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetCommandResultSamples.java new file mode 100644 index 0000000000000..b21db24dde1d6 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetCommandResultSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters GetCommandResult. */ +public final class ManagedClustersGetCommandResultSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultFailed.json + */ + /** + * Sample code: commandFailedResult. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void commandFailedResult( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .getCommandResultWithResponse("rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", Context.NONE); + } + + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultSucceed.json + */ + /** + * Sample code: commandSucceedResult. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void commandSucceedResult( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .getCommandResultWithResponse("rg1", "clustername1", "def7b3ea71bd4f7e9d226ddbc0f00ad9", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetOSOptionsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetOSOptionsSamples.java new file mode 100644 index 0000000000000..7aff693fb051f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetOSOptionsSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters GetOSOptions. */ +public final class ManagedClustersGetOSOptionsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ContainerServiceGetOSOptions.json + */ + /** + * Sample code: Get Container Service OS Options. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getContainerServiceOSOptions( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().getOSOptionsWithResponse("location1", null, Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileSamples.java new file mode 100644 index 0000000000000..290a3e3b33554 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersGetUpgradeProfileSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters GetUpgradeProfile. */ +public final class ManagedClustersGetUpgradeProfileSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetUpgradeProfile.json + */ + /** + * Sample code: Get Upgrade Profile for Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getUpgradeProfileForManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().getUpgradeProfileWithResponse("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..0ae8c7a236fd4 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters ListByResourceGroup. */ +public final class ManagedClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListByResourceGroup.json + */ + /** + * Sample code: Get Managed Clusters by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedClustersByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsSamples.java new file mode 100644 index 0000000000000..4a1fbbaad1aff --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterAdminCredentialsSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters ListClusterAdminCredentials. */ +public final class ManagedClustersListClusterAdminCredentialsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listClusterAdminCredentialsWithResponse("rg1", "clustername1", null, Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsSamples.java new file mode 100644 index 0000000000000..e017130124045 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterMonitoringUserCredentialsSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters ListClusterMonitoringUserCredentials. */ +public final class ManagedClustersListClusterMonitoringUserCredentialsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .listClusterMonitoringUserCredentialsWithResponse("rg1", "clustername1", null, Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsSamples.java new file mode 100644 index 0000000000000..db93055cf2cee --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListClusterUserCredentialsSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters ListClusterUserCredentials. */ +public final class ManagedClustersListClusterUserCredentialsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ + /** + * Sample code: Get Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .listClusterUserCredentialsWithResponse("rg1", "clustername1", null, null, Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsSamples.java new file mode 100644 index 0000000000000..f0a16e9fe8b9f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListOutboundNetworkDependenciesEndpointsSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters ListOutboundNetworkDependenciesEndpoints. */ +public final class ManagedClustersListOutboundNetworkDependenciesEndpointsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json + */ + /** + * Sample code: List OutboundNetworkDependenciesEndpoints by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listOutboundNetworkDependenciesEndpointsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().listOutboundNetworkDependenciesEndpoints("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListSamples.java new file mode 100644 index 0000000000000..77273d7ae1d4c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters List. */ +public final class ManagedClustersListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersList.json + */ + /** + * Sample code: List Managed Clusters. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listManagedClusters( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().list(Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetAadProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetAadProfileSamples.java new file mode 100644 index 0000000000000..1df587b327fc2 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetAadProfileSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterAadProfile; + +/** Samples for ManagedClusters ResetAadProfile. */ +public final class ManagedClustersResetAadProfileSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetAADProfile.json + */ + /** + * Sample code: Reset AAD Profile. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void resetAADProfile( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .resetAadProfile( + "rg1", + "clustername1", + new ManagedClusterAadProfile() + .withClientAppId("clientappid") + .withServerAppId("serverappid") + .withServerAppSecret("serverappsecret") + .withTenantId("tenantid"), + Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetServicePrincipalProfileSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetServicePrincipalProfileSamples.java new file mode 100644 index 0000000000000..b67ce156eacb5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersResetServicePrincipalProfileSamples.java @@ -0,0 +1,30 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.ManagedClusterServicePrincipalProfile; + +/** Samples for ManagedClusters ResetServicePrincipalProfile. */ +public final class ManagedClustersResetServicePrincipalProfileSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json + */ + /** + * Sample code: Reset Service Principal Profile. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void resetServicePrincipalProfile( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .resetServicePrincipalProfile( + "rg1", + "clustername1", + new ManagedClusterServicePrincipalProfile().withClientId("clientid").withSecret("secret"), + Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateClusterCertificatesSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateClusterCertificatesSamples.java new file mode 100644 index 0000000000000..a9e7732f783e5 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateClusterCertificatesSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters RotateClusterCertificates. */ +public final class ManagedClustersRotateClusterCertificatesSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateClusterCertificates.json + */ + /** + * Sample code: Rotate Cluster Certificates. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void rotateClusterCertificates( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().rotateClusterCertificates("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateServiceAccountSigningKeysSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateServiceAccountSigningKeysSamples.java new file mode 100644 index 0000000000000..b88bd909cac22 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRotateServiceAccountSigningKeysSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters RotateServiceAccountSigningKeys. */ +public final class ManagedClustersRotateServiceAccountSigningKeysSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json + */ + /** + * Sample code: Rotate Cluster Service Account Signing Keys. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void rotateClusterServiceAccountSigningKeys( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().rotateServiceAccountSigningKeys("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRunCommandSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRunCommandSamples.java new file mode 100644 index 0000000000000..3e0d0fd30cc0b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersRunCommandSamples.java @@ -0,0 +1,30 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.RunCommandRequest; + +/** Samples for ManagedClusters RunCommand. */ +public final class ManagedClustersRunCommandSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandRequest.json + */ + /** + * Sample code: submitNewCommand. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void submitNewCommand( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .managedClusters() + .runCommand( + "rg1", + "clustername1", + new RunCommandRequest().withCommand("kubectl apply -f ns.yaml").withContext("").withClusterToken(""), + Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStartSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStartSamples.java new file mode 100644 index 0000000000000..e5740bae6904b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStartSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters Start. */ +public final class ManagedClustersStartSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStart.json + */ + /** + * Sample code: Start Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void startManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().start("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStopSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStopSamples.java new file mode 100644 index 0000000000000..6766a4cd20742 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersStopSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedClusters Stop. */ +public final class ManagedClustersStopSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStop.json + */ + /** + * Sample code: Stop Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void stopManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.managedClusters().stop("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersUpdateTagsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersUpdateTagsSamples.java new file mode 100644 index 0000000000000..936ec74dc9d21 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ManagedClustersUpdateTagsSamples.java @@ -0,0 +1,39 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.ManagedCluster; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedClusters UpdateTags. */ +public final class ManagedClustersUpdateTagsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersUpdateTags.json + */ + /** + * Sample code: Update Managed Cluster Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateManagedClusterTags( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + ManagedCluster resource = + manager.managedClusters().getByResourceGroupWithResponse("rg1", "clustername1", Context.NONE).getValue(); + resource.update().withTags(mapOf("archv3", "", "tier", "testing")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..14a58efeef420 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersCreateOrUpdateSamples.java @@ -0,0 +1,92 @@ +// 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.generated; + +import com.azure.resourcemanager.containerservice.generated.models.NetworkProfile; +import com.azure.resourcemanager.containerservice.generated.models.OSType; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftAgentPoolProfileRole; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftContainerServiceVMSize; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterAadIdentityProvider; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterAgentPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterAuthProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterIdentityProvider; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedClusterMasterPoolProfile; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftRouterProfile; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for OpenShiftManagedClusters CreateOrUpdate. */ +public final class OpenShiftManagedClustersCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersCreate_Update.json + */ + /** + * Sample code: Create/Update OpenShift Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateOpenShiftManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .openShiftManagedClusters() + .define("clustername1") + .withRegion("location1") + .withExistingResourceGroup("rg1") + .withTags(mapOf("archv2", "", "tier", "production")) + .withOpenShiftVersion("v3.11") + .withNetworkProfile(new NetworkProfile().withVnetCidr("10.0.0.0/8")) + .withRouterProfiles(Arrays.asList(new OpenShiftRouterProfile().withName("default"))) + .withMasterPoolProfile( + new OpenShiftManagedClusterMasterPoolProfile() + .withName("master") + .withCount(3) + .withVmSize(OpenShiftContainerServiceVMSize.STANDARD_D4S_V3) + .withSubnetCidr("10.0.0.0/24") + .withOsType(OSType.LINUX)) + .withAgentPoolProfiles( + Arrays + .asList( + new OpenShiftManagedClusterAgentPoolProfile() + .withName("infra") + .withCount(2) + .withVmSize(OpenShiftContainerServiceVMSize.STANDARD_D4S_V3) + .withSubnetCidr("10.0.0.0/24") + .withOsType(OSType.LINUX) + .withRole(OpenShiftAgentPoolProfileRole.INFRA), + new OpenShiftManagedClusterAgentPoolProfile() + .withName("compute") + .withCount(4) + .withVmSize(OpenShiftContainerServiceVMSize.STANDARD_D4S_V3) + .withSubnetCidr("10.0.0.0/24") + .withOsType(OSType.LINUX) + .withRole(OpenShiftAgentPoolProfileRole.COMPUTE))) + .withAuthProfile( + new OpenShiftManagedClusterAuthProfile() + .withIdentityProviders( + Arrays + .asList( + new OpenShiftManagedClusterIdentityProvider() + .withName("Azure AD") + .withProvider( + new OpenShiftManagedClusterAadIdentityProvider() + .withClientId("clientId") + .withSecret("secret") + .withTenantId("tenantId") + .withCustomerAdminGroupId("customerAdminGroupId"))))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersDeleteSamples.java new file mode 100644 index 0000000000000..6136e345b06f0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersDeleteSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for OpenShiftManagedClusters Delete. */ +public final class OpenShiftManagedClustersDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersDelete.json + */ + /** + * Sample code: Delete OpenShift Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteOpenShiftManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.openShiftManagedClusters().delete("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersGetByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..79ecd68dc7bcb --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for OpenShiftManagedClusters GetByResourceGroup. */ +public final class OpenShiftManagedClustersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersGet.json + */ + /** + * Sample code: Get OpenShift Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getOpenShiftManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.openShiftManagedClusters().getByResourceGroupWithResponse("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersListByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersListByResourceGroupSamples.java new file mode 100644 index 0000000000000..dacb90b096619 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for OpenShiftManagedClusters ListByResourceGroup. */ +public final class OpenShiftManagedClustersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersListByResourceGroup.json + */ + /** + * Sample code: Get Managed Clusters by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getManagedClustersByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.openShiftManagedClusters().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersListSamples.java new file mode 100644 index 0000000000000..cd8cbfefa50cc --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for OpenShiftManagedClusters List. */ +public final class OpenShiftManagedClustersListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersList.json + */ + /** + * Sample code: List Managed Clusters. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listManagedClusters( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.openShiftManagedClusters().list(Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersUpdateTagsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersUpdateTagsSamples.java new file mode 100644 index 0000000000000..76d9bafa00f0b --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OpenShiftManagedClustersUpdateTagsSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.OpenShiftManagedCluster; +import java.util.HashMap; +import java.util.Map; + +/** Samples for OpenShiftManagedClusters UpdateTags. */ +public final class OpenShiftManagedClustersUpdateTagsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2019-04-30/examples/OpenShiftManagedClustersUpdateTags.json + */ + /** + * Sample code: Update OpenShift Managed Cluster Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateOpenShiftManagedClusterTags( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + OpenShiftManagedCluster resource = + manager + .openShiftManagedClusters() + .getByResourceGroupWithResponse("rg1", "clustername1", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("archv3", "", "tier", "testing")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..5699ff82f71be --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/Operation_List.json + */ + /** + * Sample code: List available operations for the container service resource provider. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listAvailableOperationsForTheContainerServiceResourceProvider( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..7d6c42c75d3df --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsDelete.json + */ + /** + * Sample code: Delete Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deletePrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections().delete("rg1", "clustername1", "privateendpointconnection1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..a5e34f5c0b90f --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsGet.json + */ + /** + * Sample code: Get Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getPrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("rg1", "clustername1", "privateendpointconnection1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..0fe56924817d0 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsList.json + */ + /** + * Sample code: List Private Endpoint Connections by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listPrivateEndpointConnectionsByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateEndpointConnections().listWithResponse("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateSamples.java new file mode 100644 index 0000000000000..df8948cd0db84 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateEndpointConnectionsUpdateSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.containerservice.generated.models.ConnectionStatus; +import com.azure.resourcemanager.containerservice.generated.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Update. */ +public final class PrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsUpdate.json + */ + /** + * Sample code: Update Private Endpoint Connection. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updatePrivateEndpointConnection( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .privateEndpointConnections() + .updateWithResponse( + "rg1", + "clustername1", + "privateendpointconnection1", + new PrivateEndpointConnectionInner() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(ConnectionStatus.APPROVED)), + Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListSamples.java new file mode 100644 index 0000000000000..7cc1de5c14c26 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/PrivateLinkResourcesListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources List. */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateLinkResourcesList.json + */ + /** + * Sample code: List Private Link Resources by Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listPrivateLinkResourcesByManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.privateLinkResources().listWithResponse("rg1", "clustername1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdPostSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdPostSamples.java new file mode 100644 index 0000000000000..591953e35d79c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/ResolvePrivateLinkServiceIdPostSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.fluent.models.PrivateLinkResourceInner; + +/** Samples for ResolvePrivateLinkServiceId Post. */ +public final class ResolvePrivateLinkServiceIdPostSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ResolvePrivateLinkServiceId.json + */ + /** + * Sample code: Resolve the Private Link Service ID for Managed Cluster. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void resolveThePrivateLinkServiceIDForManagedCluster( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .resolvePrivateLinkServiceIds() + .postWithResponse( + "rg1", "clustername1", new PrivateLinkResourceInner().withName("management"), Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..29e2b01743da9 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.containerservice.generated.models.CreationData; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Snapshots CreateOrUpdate. */ +public final class SnapshotsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsCreate.json + */ + /** + * Sample code: Create/Update Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void createUpdateSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager + .snapshots() + .define("snapshot1") + .withRegion("westus") + .withExistingResourceGroup("rg1") + .withTags(mapOf("key1", "val1", "key2", "val2")) + .withCreationData( + new CreationData() + .withSourceResourceId( + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteSamples.java new file mode 100644 index 0000000000000..f0d3b3a9f3588 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsDeleteSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Snapshots Delete. */ +public final class SnapshotsDeleteSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsDelete.json + */ + /** + * Sample code: Delete Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void deleteSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().deleteWithResponse("rg1", "snapshot1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..e482ccea7f92c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Snapshots GetByResourceGroup. */ +public final class SnapshotsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsGet.json + */ + /** + * Sample code: Get Snapshot. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void getSnapshot( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().getByResourceGroupWithResponse("rg1", "snapshot1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..02bcc71ac6a1c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Snapshots ListByResourceGroup. */ +public final class SnapshotsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsListByResourceGroup.json + */ + /** + * Sample code: List Snapshots by Resource Group. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listSnapshotsByResourceGroup( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().listByResourceGroup("rg1", Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListSamples.java new file mode 100644 index 0000000000000..19f89a221859c --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Snapshots List. */ +public final class SnapshotsListSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsList.json + */ + /** + * Sample code: List Snapshots. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void listSnapshots( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + manager.snapshots().list(Context.NONE); + } +} diff --git a/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsUpdateTagsSamples.java b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsUpdateTagsSamples.java new file mode 100644 index 0000000000000..bcc384fba1181 --- /dev/null +++ b/sdk/containerservice/azure-resourcemanager-containerservice-generated/src/samples/java/com/azure/resourcemanager/containerservice/generated/generated/SnapshotsUpdateTagsSamples.java @@ -0,0 +1,39 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.containerservice.generated.models.Snapshot; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Snapshots UpdateTags. */ +public final class SnapshotsUpdateTagsSamples { + /* + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsUpdateTags.json + */ + /** + * Sample code: Update Snapshot Tags. + * + * @param manager Entry point to ContainerServiceManager. + */ + public static void updateSnapshotTags( + com.azure.resourcemanager.containerservice.generated.ContainerServiceManager manager) { + Snapshot resource = + manager.snapshots().getByResourceGroupWithResponse("rg1", "snapshot1", Context.NONE).getValue(); + resource.update().withTags(mapOf("key2", "new-val2", "key3", "val3")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/containerservice/ci.yml b/sdk/containerservice/ci.yml new file mode 100644 index 0000000000000..4540963f52071 --- /dev/null +++ b/sdk/containerservice/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.yml + - sdk/containerservice/azure-resourcemanager-containerservice-generated/ + exclude: + - sdk/containerservice/pom.xml + - sdk/containerservice/azure-resourcemanager-containerservice-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.yml + - sdk/containerservice/azure-resourcemanager-containerservice-generated/ + exclude: + - sdk/containerservice/pom.xml + - sdk/containerservice/azure-resourcemanager-containerservice-generated/pom.xml + +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 + + + +