diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 680ac777e062..3473f3e351b4 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -424,6 +424,7 @@ com.azure.resourcemanager:azure-resourcemanager-iotfirmwaredefense;1.0.0-beta.1; com.azure.resourcemanager:azure-resourcemanager-quantum;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-sphere;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-chaos;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 diff --git a/pom.xml b/pom.xml index 2cdc248532cc..03db66fa7143 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,7 @@ sdk/hanaonazure sdk/hardwaresecuritymodules sdk/hdinsight + sdk/hdinsightmicrosofthdinsighthdinsightonaks sdk/healthbot sdk/healthcareapis sdk/healthinsights diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/CHANGELOG.md b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/CHANGELOG.md new file mode 100644 index 000000000000..f00a3b493841 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-08-04) + +- Azure Resource Manager HDInsightOnAks client library for Java. This package contains Microsoft Azure SDK for HDInsightOnAks Management SDK. HDInsight On Aks Management Client. Package tag package-2023-06-preview. 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/README.md b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/README.md new file mode 100644 index 000000000000..c696692ea195 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/README.md @@ -0,0 +1,107 @@ +# Azure Resource Manager HDInsightOnAks client library for Java + +Azure Resource Manager HDInsightOnAks client library for Java. + +This package contains Microsoft Azure SDK for HDInsightOnAks Management SDK. HDInsight On Aks Management Client. Package tag package-2023-06-preview. 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-hdinsightmicrosofthdinsighthdinsightonaks;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks + 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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the 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 `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +HDInsightOnAksManager manager = HDInsightOnAksManager + .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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fhdinsightmicrosofthdinsighthdinsightonaks%2Fazure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks%2FREADME.png) diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/SAMPLE.md b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/SAMPLE.md new file mode 100644 index 000000000000..426007111063 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/SAMPLE.md @@ -0,0 +1,876 @@ +# Code snippets and samples + + +## AvailableClusterPoolVersions + +- [ListByLocation](#availableclusterpoolversions_listbylocation) + +## AvailableClusterVersions + +- [ListByLocation](#availableclusterversions_listbylocation) + +## ClusterJobs + +- [List](#clusterjobs_list) +- [RunJob](#clusterjobs_runjob) + +## ClusterPools + +- [CreateOrUpdate](#clusterpools_createorupdate) +- [Delete](#clusterpools_delete) +- [GetByResourceGroup](#clusterpools_getbyresourcegroup) +- [List](#clusterpools_list) +- [ListByResourceGroup](#clusterpools_listbyresourcegroup) +- [UpdateTags](#clusterpools_updatetags) + +## Clusters + +- [Create](#clusters_create) +- [Delete](#clusters_delete) +- [Get](#clusters_get) +- [GetInstanceView](#clusters_getinstanceview) +- [ListByClusterPoolName](#clusters_listbyclusterpoolname) +- [ListInstanceViews](#clusters_listinstanceviews) +- [ListServiceConfigs](#clusters_listserviceconfigs) +- [Resize](#clusters_resize) +- [Update](#clusters_update) + +## Locations + +- [CheckNameAvailability](#locations_checknameavailability) + +## Operations + +- [List](#operations_list) +### AvailableClusterPoolVersions_ListByLocation + +```java +/** Samples for AvailableClusterPoolVersions ListByLocation. */ +public final class Availabl { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListAvailableClusterPoolVersions.json + */ + /** + * Sample code: ClusterPoolVersionListResult. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void clusterPoolVersionListResult( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.availableClusterPoolVersions().listByLocation("westus2", com.azure.core.util.Context.NONE); + } +} +``` + +### AvailableClusterVersions_ListByLocation + +```java +/** Samples for AvailableClusterVersions ListByLocation. */ +public final class Availabl { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListAvailableClusterVersions.json + */ + /** + * Sample code: ClusterVersionListResult. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void clusterVersionListResult( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.availableClusterVersions().listByLocation("westus2", com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterJobs_List + +```java +/** Samples for ClusterJobs List. */ +public final class ClusterJ { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClusterJobs.json + */ + /** + * Sample code: ListClusterJobs. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void listClusterJobs( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.clusterJobs().list("hiloResourcegroup", "clusterPool1", "cluster1", com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterJobs_RunJob + +```java +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterJobInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Action; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.FlinkJobProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ClusterJobs RunJob. */ +public final class ClusterJ { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/RunClusterJob.json + */ + /** + * Sample code: RunClusterJob. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void runClusterJob( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .clusterJobs() + .runJob( + "hiloResourcegroup", + "clusterpool1", + "cluster1", + new ClusterJobInner() + .withProperties( + new FlinkJobProperties() + .withJobName("flink-job-name") + .withJobJarDirectory("abfs://flinkjob@hilosa.dfs.core.windows.net/jars") + .withJarName("flink-sleep-job-0.0.1-SNAPSHOT.jar") + .withEntryClass("com.microsoft.hilo.flink.job.streaming.SleepJob") + .withAction(Action.START) + .withFlinkConfiguration( + mapOf( + "parallelism", + "1", + "savepoint.directory", + "abfs://flinkjob@hilosa.dfs.core.windows.net/savepoint"))), + com.azure.core.util.Context.NONE); + } + + @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; + } +} +``` + +### ClusterPools_CreateOrUpdate + +```java +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesClusterPoolProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesComputeProfile; + +/** Samples for ClusterPools CreateOrUpdate. */ +public final class ClusterP { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/CreateClusterPool.json + */ + /** + * Sample code: ClusterPoolPut. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void clusterPoolPut( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .clusterPools() + .define("clusterpool1") + .withRegion("West US 2") + .withExistingResourceGroup("hiloResourcegroup") + .withClusterPoolProfile(new ClusterPoolResourcePropertiesClusterPoolProfile().withClusterPoolVersion("1.2")) + .withComputeProfile(new ClusterPoolResourcePropertiesComputeProfile().withVmSize("Standard_D3_v2")) + .create(); + } +} +``` + +### ClusterPools_Delete + +```java +/** Samples for ClusterPools Delete. */ +public final class ClusterP { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/DeleteClusterPool.json + */ + /** + * Sample code: ClusterPoolDelete. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void clusterPoolDelete( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.clusterPools().delete("rg1", "clusterpool1", com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterPools_GetByResourceGroup + +```java +/** Samples for ClusterPools GetByResourceGroup. */ +public final class ClusterP { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/GetClusterPool.json + */ + /** + * Sample code: ClusterPoolGet. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void clusterPoolGet( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .clusterPools() + .getByResourceGroupWithResponse("hiloResourcegroup", "clusterpool1", com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterPools_List + +```java +/** Samples for ClusterPools List. */ +public final class ClusterP { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClusterPoolsSubscription.json + */ + /** + * Sample code: ClusterPoolsListBySubscription. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void clusterPoolsListBySubscription( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.clusterPools().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterPools_ListByResourceGroup + +```java +/** Samples for ClusterPools ListByResourceGroup. */ +public final class ClusterP { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClusterPools.json + */ + /** + * Sample code: ClusterPoolsListByResourceGroup. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void clusterPoolsListByResourceGroup( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.clusterPools().listByResourceGroup("hiloResourcegroup", com.azure.core.util.Context.NONE); + } +} +``` + +### ClusterPools_UpdateTags + +```java +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPool; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ClusterPools UpdateTags. */ +public final class ClusterP { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/PatchClusterPool.json + */ + /** + * Sample code: ClusterPoolsPatchTags. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void clusterPoolsPatchTags( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + ClusterPool resource = + manager + .clusterPools() + .getByResourceGroupWithResponse("hiloResourcegroup", "clusterpool1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; + } +} +``` + +### Clusters_Create + +```java +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AuthorizationProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AutoscaleProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AutoscaleType; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterConfigFile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterServiceConfig; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterServiceConfigsProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ComparisonOperator; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ComparisonRule; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ComputeProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.IdentityProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.LoadBasedConfig; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.NodeProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ScaleActionType; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ScalingRule; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Schedule; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ScheduleBasedConfig; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ScheduleDay; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.SparkProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.SshProfile; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Create. */ +public final class Clusters { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/CreateSparkCluster.json + */ + /** + * Sample code: HDInsightSparkClusterPut. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightSparkClusterPut( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .clusters() + .define("cluster1") + .withRegion("West US 2") + .withExistingClusterpool("hiloResourcegroup", "clusterpool1") + .withClusterType("spark") + .withComputeProfile( + new ComputeProfile() + .withNodes( + Arrays.asList(new NodeProfile().withType("worker").withVmSize("Standard_D3_v2").withCount(4)))) + .withClusterProfile( + new ClusterProfile() + .withClusterVersion("0.0.1") + .withOssVersion("2.2.3") + .withIdentityProfile( + new IdentityProfile() + .withMsiResourceId( + "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") + .withMsiClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") + .withMsiObjectId("40491351-c240-4042-91e0-f644a1d2b441")) + .withAuthorizationProfile( + new AuthorizationProfile().withUserIds(Arrays.asList("testuser1", "testuser2"))) + .withServiceConfigsProfiles( + Arrays + .asList( + new ClusterServiceConfigsProfile() + .withServiceName("spark-service") + .withConfigs( + Arrays + .asList( + new ClusterServiceConfig() + .withComponent("spark-config") + .withFiles( + Arrays + .asList( + new ClusterConfigFile() + .withFileName("spark-defaults.conf") + .withValues( + mapOf("spark.eventLog.enabled", "true")))))), + new ClusterServiceConfigsProfile() + .withServiceName("yarn-service") + .withConfigs( + Arrays + .asList( + new ClusterServiceConfig() + .withComponent("yarn-config") + .withFiles( + Arrays + .asList( + new ClusterConfigFile() + .withFileName("core-site.xml") + .withValues( + mapOf( + "fs.defaultFS", + "wasb://testcontainer@teststorage.dfs.core.windows.net/", + "storage.container", + "testcontainer", + "storage.key", + "fakeTokenPlaceholder", + "storage.name", + "teststorage", + "storage.protocol", + "wasb")), + new ClusterConfigFile() + .withFileName("yarn-site.xml") + .withValues( + mapOf("yarn.webapp.ui2.enable", "false")))))))) + .withSshProfile(new SshProfile().withCount(2)) + .withSparkProfile(new SparkProfile())) + .create(); + } + + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/CreateAutoscaleCluster.json + */ + /** + * Sample code: HDInsightClusterPut. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightClusterPut( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .clusters() + .define("cluster1") + .withRegion("West US 2") + .withExistingClusterpool("hiloResourcegroup", "clusterpool1") + .withClusterType("kafka") + .withComputeProfile( + new ComputeProfile() + .withNodes( + Arrays.asList(new NodeProfile().withType("worker").withVmSize("Standard_D3_v2").withCount(4)))) + .withClusterProfile( + new ClusterProfile() + .withClusterVersion("1.0.1") + .withOssVersion("2.4.1") + .withIdentityProfile( + new IdentityProfile() + .withMsiResourceId( + "/subscriptions/subid/resourceGroups/hiloResourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-msi") + .withMsiClientId("de91f1d8-767f-460a-ac11-3cf103f74b34") + .withMsiObjectId("40491351-c240-4042-91e0-f644a1d2b441")) + .withAuthorizationProfile( + new AuthorizationProfile().withUserIds(Arrays.asList("testuser1", "testuser2"))) + .withSshProfile(new SshProfile().withCount(2)) + .withAutoscaleProfile( + new AutoscaleProfile() + .withEnabled(true) + .withGracefulDecommissionTimeout(3600) + .withAutoscaleType(AutoscaleType.SCHEDULE_BASED) + .withScheduleBasedConfig( + new ScheduleBasedConfig() + .withTimeZone("Cen. Australia Standard Time") + .withDefaultCount(10) + .withSchedules( + Arrays + .asList( + new Schedule() + .withStartTime("00:00") + .withEndTime("12:00") + .withCount(20) + .withDays(Arrays.asList(ScheduleDay.MONDAY)), + new Schedule() + .withStartTime("00:00") + .withEndTime("12:00") + .withCount(25) + .withDays(Arrays.asList(ScheduleDay.SUNDAY))))) + .withLoadBasedConfig( + new LoadBasedConfig() + .withMinNodes(10) + .withMaxNodes(20) + .withPollInterval(60) + .withCooldownPeriod(300) + .withScalingRules( + Arrays + .asList( + new ScalingRule() + .withActionType(ScaleActionType.SCALEUP) + .withEvaluationCount(3) + .withScalingMetric("cpu") + .withComparisonRule( + new ComparisonRule() + .withOperator(ComparisonOperator.GREATER_THAN) + .withThreshold(90f)), + new ScalingRule() + .withActionType(ScaleActionType.SCALEDOWN) + .withEvaluationCount(3) + .withScalingMetric("cpu") + .withComparisonRule( + new ComparisonRule() + .withOperator(ComparisonOperator.LESS_THAN) + .withThreshold(20f)))))) + .withKafkaProfile(mapOf())) + .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; + } +} +``` + +### Clusters_Delete + +```java +/** Samples for Clusters Delete. */ +public final class Clusters { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/DeleteCluster.json + */ + /** + * Sample code: HDInsightClustersDelete. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightClustersDelete( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.clusters().delete("rg1", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_Get + +```java +/** Samples for Clusters Get. */ +public final class Clusters { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/GetCluster.json + */ + /** + * Sample code: HDInsightClusterGet. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightClusterGet( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .clusters() + .getWithResponse("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_GetInstanceView + +```java +/** Samples for Clusters GetInstanceView. */ +public final class Clusters { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/GetClusterInstanceView.json + */ + /** + * Sample code: HDInsightClusterGetInstanceView. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightClusterGetInstanceView( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .clusters() + .getInstanceViewWithResponse("rg1", "clusterPool1", "cluster1", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_ListByClusterPoolName + +```java +/** Samples for Clusters ListByClusterPoolName. */ +public final class Clusters { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClustersByClusterPoolName.json + */ + /** + * Sample code: HDInsightClustersListByClusterPoolName. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightClustersListByClusterPoolName( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.clusters().listByClusterPoolName("hiloResourcegroup", "clusterpool1", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_ListInstanceViews + +```java +/** Samples for Clusters ListInstanceViews. */ +public final class Clusters { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClusterInstanceViews.json + */ + /** + * Sample code: HDInsightClusterGetInstanceViews. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightClusterGetInstanceViews( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.clusters().listInstanceViews("rg1", "clusterPool1", "cluster1", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_ListServiceConfigs + +```java +/** Samples for Clusters ListServiceConfigs. */ +public final class Clusters { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListClusterServiceConfigs.json + */ + /** + * Sample code: HDInsightClusterGetServiceConfigs. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightClusterGetServiceConfigs( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.clusters().listServiceConfigs("rg1", "clusterPool1", "cluster1", com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_Resize + +```java +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterResizeData; + +/** Samples for Clusters Resize. */ +public final class Clusters { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ResizeCluster.json + */ + /** + * Sample code: HDInsightClusterResize. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightClusterResize( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .clusters() + .resize( + "hiloResourcegroup", + "clusterpool1", + "cluster1", + new ClusterResizeData().withLocation("West US 2").withTargetWorkerNodeCount(5), + com.azure.core.util.Context.NONE); + } +} +``` + +### Clusters_Update + +```java +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AuthorizationProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AutoscaleProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AutoscaleType; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Cluster; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterConfigFile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterLogAnalyticsApplicationLogs; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterLogAnalyticsProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterServiceConfig; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterServiceConfigsProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Schedule; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ScheduleBasedConfig; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ScheduleDay; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.SshProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.UpdatableClusterProfile; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Update. */ +public final class Clusters { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/PatchCluster.json + */ + /** + * Sample code: HDInsightClustersPatchTags. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightClustersPatchTags( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + Cluster resource = + manager + .clusters() + .getWithResponse("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withClusterProfile( + new UpdatableClusterProfile() + .withServiceConfigsProfiles( + Arrays + .asList( + new ClusterServiceConfigsProfile() + .withServiceName("TestService1") + .withConfigs( + Arrays + .asList( + new ClusterServiceConfig() + .withComponent("TestComp1") + .withFiles( + Arrays + .asList( + new ClusterConfigFile() + .withFileName("TestFile1") + .withValues( + mapOf( + "Test.config.1", + "1", + "Test.config.2", + "2")), + new ClusterConfigFile() + .withFileName("TestFile2") + .withValues( + mapOf( + "Test.config.3", + "3", + "Test.config.4", + "4")))), + new ClusterServiceConfig() + .withComponent("TestComp2") + .withFiles( + Arrays + .asList( + new ClusterConfigFile() + .withFileName("TestFile3") + .withContent("TestContent") + .withPath("TestPath"), + new ClusterConfigFile() + .withFileName("TestFile4") + .withValues( + mapOf( + "Test.config.7", + "7", + "Test.config.8", + "8")))))), + new ClusterServiceConfigsProfile() + .withServiceName("TestService2") + .withConfigs( + Arrays + .asList( + new ClusterServiceConfig() + .withComponent("TestComp3") + .withFiles( + Arrays + .asList( + new ClusterConfigFile() + .withFileName("TestFile5") + .withValues(mapOf("Test.config.9", "9")))))))) + .withSshProfile(new SshProfile().withCount(2)) + .withAutoscaleProfile( + new AutoscaleProfile() + .withEnabled(true) + .withGracefulDecommissionTimeout(-1) + .withAutoscaleType(AutoscaleType.SCHEDULE_BASED) + .withScheduleBasedConfig( + new ScheduleBasedConfig() + .withTimeZone("Cen. Australia Standard Time") + .withDefaultCount(3) + .withSchedules( + Arrays + .asList( + new Schedule() + .withStartTime("00:00") + .withEndTime("12:00") + .withCount(3) + .withDays( + Arrays + .asList( + ScheduleDay.fromString("Monday, Tuesday, Wednesday"))), + new Schedule() + .withStartTime("00:00") + .withEndTime("12:00") + .withCount(3) + .withDays(Arrays.asList(ScheduleDay.SUNDAY)))))) + .withAuthorizationProfile( + new AuthorizationProfile().withUserIds(Arrays.asList("Testuser1", "Testuser2"))) + .withLogAnalyticsProfile( + new ClusterLogAnalyticsProfile() + .withEnabled(true) + .withApplicationLogs( + new ClusterLogAnalyticsApplicationLogs() + .withStdOutEnabled(true) + .withStdErrorEnabled(true)) + .withMetricsEnabled(true))) + .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; + } +} +``` + +### Locations_CheckNameAvailability + +```java +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.NameAvailabilityParameters; + +/** Samples for Locations CheckNameAvailability. */ +public final class Location { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/LocationsNameAvailability.json + */ + /** + * Sample code: LocationsNameAvailability. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void locationsNameAvailability( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .locations() + .checkNameAvailabilityWithResponse( + "southeastasia", + new NameAvailabilityParameters() + .withName("contosemember1") + .withType("Microsoft.HDInsight/clusterPools/clusters"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class Operatio { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/GetOperations.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void listOperations( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/pom.xml b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/pom.xml new file mode 100644 index 000000000000..c86445df4f19 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for HDInsightOnAks Management + This package contains Microsoft Azure SDK for HDInsightOnAks Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HDInsight On Aks Management Client. Package tag package-2023-06-preview. + 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 + 0 + 0 + + + + com.azure + azure-core + 1.41.0 + + + com.azure + azure-core-management + 1.11.3 + + + diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/HDInsightOnAksManager.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/HDInsightOnAksManager.java new file mode 100644 index 000000000000..c30cff6edfd6 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/HDInsightOnAksManager.java @@ -0,0 +1,380 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks; + +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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.HDInsightOnAksManagementClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation.AvailableClusterPoolVersionsImpl; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation.AvailableClusterVersionsImpl; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation.ClusterJobsImpl; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation.ClusterPoolsImpl; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation.ClustersImpl; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation.HDInsightOnAksManagementClientBuilder; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation.LocationsImpl; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation.OperationsImpl; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AvailableClusterPoolVersions; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AvailableClusterVersions; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterJobs; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPools; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Clusters; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Locations; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Operations; +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 HDInsightOnAksManager. HDInsight On Aks Management Client. */ +public final class HDInsightOnAksManager { + private ClusterPools clusterPools; + + private Clusters clusters; + + private ClusterJobs clusterJobs; + + private Locations locations; + + private Operations operations; + + private AvailableClusterPoolVersions availableClusterPoolVersions; + + private AvailableClusterVersions availableClusterVersions; + + private final HDInsightOnAksManagementClient clientObject; + + private HDInsightOnAksManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new HDInsightOnAksManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of HDInsightOnAks service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HDInsightOnAks service API instance. + */ + public static HDInsightOnAksManager 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 HDInsightOnAks service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the HDInsightOnAks service API instance. + */ + public static HDInsightOnAksManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new HDInsightOnAksManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create HDInsightOnAksManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new HDInsightOnAksManager.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 HDInsightOnAks service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HDInsightOnAks service API instance. + */ + public HDInsightOnAksManager 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.hdinsightmicrosofthdinsighthdinsightonaks") + .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 HDInsightOnAksManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of ClusterPools. It manages ClusterPool. + * + * @return Resource collection API of ClusterPools. + */ + public ClusterPools clusterPools() { + if (this.clusterPools == null) { + this.clusterPools = new ClusterPoolsImpl(clientObject.getClusterPools(), this); + } + return clusterPools; + } + + /** + * Gets the resource collection API of Clusters. It manages Cluster. + * + * @return Resource collection API of Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); + } + return clusters; + } + + /** + * Gets the resource collection API of ClusterJobs. + * + * @return Resource collection API of ClusterJobs. + */ + public ClusterJobs clusterJobs() { + if (this.clusterJobs == null) { + this.clusterJobs = new ClusterJobsImpl(clientObject.getClusterJobs(), this); + } + return clusterJobs; + } + + /** + * Gets the resource collection API of Locations. + * + * @return Resource collection API of Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(clientObject.getLocations(), this); + } + return locations; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of AvailableClusterPoolVersions. + * + * @return Resource collection API of AvailableClusterPoolVersions. + */ + public AvailableClusterPoolVersions availableClusterPoolVersions() { + if (this.availableClusterPoolVersions == null) { + this.availableClusterPoolVersions = + new AvailableClusterPoolVersionsImpl(clientObject.getAvailableClusterPoolVersions(), this); + } + return availableClusterPoolVersions; + } + + /** + * Gets the resource collection API of AvailableClusterVersions. + * + * @return Resource collection API of AvailableClusterVersions. + */ + public AvailableClusterVersions availableClusterVersions() { + if (this.availableClusterVersions == null) { + this.availableClusterVersions = + new AvailableClusterVersionsImpl(clientObject.getAvailableClusterVersions(), this); + } + return availableClusterVersions; + } + + /** + * @return Wrapped service client HDInsightOnAksManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + public HDInsightOnAksManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/AvailableClusterPoolVersionsClient.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/AvailableClusterPoolVersionsClient.java new file mode 100644 index 000000000000..289aabcd3477 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/AvailableClusterPoolVersionsClient.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.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolVersionInner; + +/** An instance of this class provides access to all the operations defined in AvailableClusterPoolVersionsClient. */ +public interface AvailableClusterPoolVersionsClient { + /** + * Returns a list of available cluster pool versions. + * + * @param location The name of the 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 represents a list of cluster pool versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location); + + /** + * Returns a list of available cluster pool versions. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location, Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/AvailableClusterVersionsClient.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/AvailableClusterVersionsClient.java new file mode 100644 index 000000000000..5709b41cc5cb --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/AvailableClusterVersionsClient.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.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterVersionInner; + +/** An instance of this class provides access to all the operations defined in AvailableClusterVersionsClient. */ +public interface AvailableClusterVersionsClient { + /** + * Returns a list of available cluster versions. + * + * @param location The name of the 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 represents a list of cluster versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location); + + /** + * Returns a list of available cluster versions. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByLocation(String location, Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/ClusterJobsClient.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/ClusterJobsClient.java new file mode 100644 index 000000000000..23245bf796b2 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/ClusterJobsClient.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterJobInner; + +/** An instance of this class provides access to all the operations defined in ClusterJobsClient. */ +public interface ClusterJobsClient { + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cluster job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterJobInner> beginRunJob( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterJobInner clusterJob); + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cluster job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterJobInner> beginRunJob( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterJobInner clusterJob, + Context context); + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterJobInner runJob( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterJobInner clusterJob); + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterJobInner runJob( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterJobInner clusterJob, + Context context); + + /** + * Get jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 jobs of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Get jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 jobs of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/ClusterPoolsClient.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/ClusterPoolsClient.java new file mode 100644 index 000000000000..958616109cb8 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/ClusterPoolsClient.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.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.TagsObject; + +/** An instance of this class provides access to all the operations defined in ClusterPoolsClient. */ +public interface ClusterPoolsClient { + /** + * Gets a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 a cluster pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterPoolName, Context context); + + /** + * Gets a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 a cluster pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPoolInner getByResourceGroup(String resourceGroupName, String clusterPoolName); + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterPoolInner> beginCreateOrUpdate( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool); + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterPoolInner> beginCreateOrUpdate( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool, Context context); + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPoolInner createOrUpdate(String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool); + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPoolInner createOrUpdate( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool, Context context); + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterPoolInner> beginUpdateTags( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags); + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterPoolInner> beginUpdateTags( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags, Context context); + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPoolInner updateTags(String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags); + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterPoolInner updateTags( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags, Context context); + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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, Void> beginDelete(String resourceGroupName, String clusterPoolName); + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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, Void> beginDelete(String resourceGroupName, String clusterPoolName, Context context); + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 clusterPoolName); + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterPoolName, Context context); + + /** + * Gets the list of Cluster Pools within a 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 the list of Cluster Pools within a Subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets the list of Cluster Pools within a 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 the list of Cluster Pools within a Subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Lists the HDInsight cluster pools under a 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 list cluster pools operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the HDInsight cluster pools under a 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 list cluster pools operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/ClustersClient.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/ClustersClient.java new file mode 100644 index 000000000000..61b6e29b8152 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/ClustersClient.java @@ -0,0 +1,452 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInstanceViewResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ServiceConfigResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPatch; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterResizeData; + +/** An instance of this class provides access to all the operations defined in ClustersClient. */ +public interface ClustersClient { + /** + * Lists the HDInsight cluster pools under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 list cluster operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByClusterPoolName(String resourceGroupName, String clusterPoolName); + + /** + * Lists the HDInsight cluster pools under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 list cluster operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByClusterPoolName( + String resourceGroupName, String clusterPoolName, Context context); + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginResize( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterResizeData clusterResizeRequest); + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize 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. + * @return the {@link SyncPoller} for polling of the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginResize( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterResizeData clusterResizeRequest, + Context context); + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner resize( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterResizeData clusterResizeRequest); + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize 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. + * @return the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner resize( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterResizeData clusterResizeRequest, + Context context); + + /** + * Gets a HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 HDInsight cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Gets a HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 a HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner get(String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginCreate( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterInner hDInsightCluster); + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginCreate( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterInner hDInsightCluster, + Context context); + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner create( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterInner hDInsightCluster); + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner create( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterInner hDInsightCluster, + Context context); + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterPatch clusterPatchRequest); + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch 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. + * @return the {@link SyncPoller} for polling of the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterPatch clusterPatchRequest, + Context context); + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterPatch clusterPatchRequest); + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch 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. + * @return the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterPatch clusterPatchRequest, + Context context); + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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> beginDelete( + String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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> beginDelete( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 delete(String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 delete(String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Lists the config dump of all services running in cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 cluster instance service configs api response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listServiceConfigs( + String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Lists the config dump of all services running in cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 cluster instance service configs api response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listServiceConfigs( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Lists the lists of instance views. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 instance view of a HDInsight Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listInstanceViews( + String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Lists the lists of instance views. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 instance view of a HDInsight Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listInstanceViews( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Gets the status of a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 status of a cluster instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getInstanceViewWithResponse( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Gets the status of a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 status of a cluster instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInstanceViewResultInner getInstanceView( + String resourceGroupName, String clusterPoolName, String clusterName); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/HDInsightOnAksManagementClient.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/HDInsightOnAksManagementClient.java new file mode 100644 index 000000000000..6fd976d234d7 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/HDInsightOnAksManagementClient.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for HDInsightOnAksManagementClient class. */ +public interface HDInsightOnAksManagementClient { + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * 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 ClusterPoolsClient object to access its operations. + * + * @return the ClusterPoolsClient object. + */ + ClusterPoolsClient getClusterPools(); + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + ClustersClient getClusters(); + + /** + * Gets the ClusterJobsClient object to access its operations. + * + * @return the ClusterJobsClient object. + */ + ClusterJobsClient getClusterJobs(); + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + LocationsClient getLocations(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the AvailableClusterPoolVersionsClient object to access its operations. + * + * @return the AvailableClusterPoolVersionsClient object. + */ + AvailableClusterPoolVersionsClient getAvailableClusterPoolVersions(); + + /** + * Gets the AvailableClusterVersionsClient object to access its operations. + * + * @return the AvailableClusterVersionsClient object. + */ + AvailableClusterVersionsClient getAvailableClusterVersions(); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/LocationsClient.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/LocationsClient.java new file mode 100644 index 000000000000..f8ccad50e3bb --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/LocationsClient.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.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.NameAvailabilityResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.NameAvailabilityParameters; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public interface LocationsClient { + /** + * Check the availability of the resource name. + * + * @param location The name of the Azure region. + * @param nameAvailabilityParameters The name and type of the 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 result of check name availability along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters nameAvailabilityParameters, Context context); + + /** + * Check the availability of the resource name. + * + * @param location The name of the Azure region. + * @param nameAvailabilityParameters The name and type of the 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 result of check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NameAvailabilityResultInner checkNameAvailability( + String location, NameAvailabilityParameters nameAvailabilityParameters); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/OperationsClient.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/OperationsClient.java new file mode 100644 index 000000000000..2e826ccc4d9f --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/OperationsClient.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.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Returns 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterInner.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterInner.java new file mode 100644 index 000000000000..cea83fa91de1 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterInner.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ComputeProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ProvisioningStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The cluster. */ +@Fluent +public final class ClusterInner extends Resource { + /* + * Gets or sets the properties. Define cluster specific properties. + */ + @JsonProperty(value = "properties") + private ClusterResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterInner class. */ + public ClusterInner() { + } + + /** + * Get the innerProperties property: Gets or sets the properties. Define cluster specific properties. + * + * @return the innerProperties value. + */ + private ClusterResourceProperties 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 ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStatus provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the clusterType property: The type of cluster. + * + * @return the clusterType value. + */ + public String clusterType() { + return this.innerProperties() == null ? null : this.innerProperties().clusterType(); + } + + /** + * Set the clusterType property: The type of cluster. + * + * @param clusterType the clusterType value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterType(String clusterType) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterResourceProperties(); + } + this.innerProperties().withClusterType(clusterType); + return this; + } + + /** + * Get the deploymentId property: A unique id generated by the RP to identify the resource. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentId(); + } + + /** + * Get the computeProfile property: The compute profile. + * + * @return the computeProfile value. + */ + public ComputeProfile computeProfile() { + return this.innerProperties() == null ? null : this.innerProperties().computeProfile(); + } + + /** + * Set the computeProfile property: The compute profile. + * + * @param computeProfile the computeProfile value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withComputeProfile(ComputeProfile computeProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterResourceProperties(); + } + this.innerProperties().withComputeProfile(computeProfile); + return this; + } + + /** + * Get the clusterProfile property: Cluster profile. + * + * @return the clusterProfile value. + */ + public ClusterProfile clusterProfile() { + return this.innerProperties() == null ? null : this.innerProperties().clusterProfile(); + } + + /** + * Set the clusterProfile property: Cluster profile. + * + * @param clusterProfile the clusterProfile value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withClusterProfile(ClusterProfile clusterProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterResourceProperties(); + } + this.innerProperties().withClusterProfile(clusterProfile); + return this; + } + + /** + * Get the status property: Business status of the resource. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterInstanceViewResultInner.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterInstanceViewResultInner.java new file mode 100644 index 000000000000..b63383122ab3 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterInstanceViewResultInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterInstanceViewPropertiesStatus; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ServiceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster Instance View. */ +@Fluent +public final class ClusterInstanceViewResultInner { + /* + * Name of the instance view. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Properties of the instance view. + */ + @JsonProperty(value = "properties", required = true) + private ClusterInstanceViewResultProperties innerProperties = new ClusterInstanceViewResultProperties(); + + /** Creates an instance of ClusterInstanceViewResultInner class. */ + public ClusterInstanceViewResultInner() { + } + + /** + * Get the name property: Name of the instance view. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the instance view. + * + * @param name the name value to set. + * @return the ClusterInstanceViewResultInner object itself. + */ + public ClusterInstanceViewResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the innerProperties property: Properties of the instance view. + * + * @return the innerProperties value. + */ + private ClusterInstanceViewResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the status property: Status of the instance view. + * + * @return the status value. + */ + public ClusterInstanceViewPropertiesStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Set the status property: Status of the instance view. + * + * @param status the status value to set. + * @return the ClusterInstanceViewResultInner object itself. + */ + public ClusterInstanceViewResultInner withStatus(ClusterInstanceViewPropertiesStatus status) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterInstanceViewResultProperties(); + } + this.innerProperties().withStatus(status); + return this; + } + + /** + * Get the serviceStatuses property: List of statuses of relevant services that make up the HDInsight on aks cluster + * to surface to the customer. + * + * @return the serviceStatuses value. + */ + public List serviceStatuses() { + return this.innerProperties() == null ? null : this.innerProperties().serviceStatuses(); + } + + /** + * Set the serviceStatuses property: List of statuses of relevant services that make up the HDInsight on aks cluster + * to surface to the customer. + * + * @param serviceStatuses the serviceStatuses value to set. + * @return the ClusterInstanceViewResultInner object itself. + */ + public ClusterInstanceViewResultInner withServiceStatuses(List serviceStatuses) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterInstanceViewResultProperties(); + } + this.innerProperties().withServiceStatuses(serviceStatuses); + 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 ClusterInstanceViewResultInner")); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ClusterInstanceViewResultInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterInstanceViewResultInner.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterInstanceViewResultProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterInstanceViewResultProperties.java new file mode 100644 index 000000000000..eccdc7d37752 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterInstanceViewResultProperties.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterInstanceViewProperties; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterInstanceViewPropertiesStatus; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ServiceStatus; +import java.util.List; + +/** Properties of the instance view. */ +@Fluent +public final class ClusterInstanceViewResultProperties extends ClusterInstanceViewProperties { + /** Creates an instance of ClusterInstanceViewResultProperties class. */ + public ClusterInstanceViewResultProperties() { + } + + /** {@inheritDoc} */ + @Override + public ClusterInstanceViewResultProperties withStatus(ClusterInstanceViewPropertiesStatus status) { + super.withStatus(status); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInstanceViewResultProperties withServiceStatuses(List serviceStatuses) { + super.withServiceStatuses(serviceStatuses); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterJobInner.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterJobInner.java new file mode 100644 index 000000000000..66392d6116e7 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterJobInner.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterJobProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster job. */ +@Fluent +public final class ClusterJobInner extends ProxyResource { + /* + * Properties of cluster job. + */ + @JsonProperty(value = "properties", required = true) + private ClusterJobProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterJobInner class. */ + public ClusterJobInner() { + } + + /** + * Get the properties property: Properties of cluster job. + * + * @return the properties value. + */ + public ClusterJobProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of cluster job. + * + * @param properties the properties value to set. + * @return the ClusterJobInner object itself. + */ + public ClusterJobInner withProperties(ClusterJobProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model ClusterJobInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterJobInner.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPatchProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPatchProperties.java new file mode 100644 index 000000000000..8e4c7622dc3d --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPatchProperties.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.UpdatableClusterProfile; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster resource patch data. */ +@Fluent +public final class ClusterPatchProperties { + /* + * Cluster resource patch properties. + */ + @JsonProperty(value = "clusterProfile") + private UpdatableClusterProfile clusterProfile; + + /** Creates an instance of ClusterPatchProperties class. */ + public ClusterPatchProperties() { + } + + /** + * Get the clusterProfile property: Cluster resource patch properties. + * + * @return the clusterProfile value. + */ + public UpdatableClusterProfile clusterProfile() { + return this.clusterProfile; + } + + /** + * Set the clusterProfile property: Cluster resource patch properties. + * + * @param clusterProfile the clusterProfile value to set. + * @return the ClusterPatchProperties object itself. + */ + public ClusterPatchProperties withClusterProfile(UpdatableClusterProfile clusterProfile) { + this.clusterProfile = clusterProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterProfile() != null) { + clusterProfile().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolInner.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolInner.java new file mode 100644 index 000000000000..5e31b238a738 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolInner.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesAksClusterProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesClusterPoolProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesComputeProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesLogAnalyticsProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesNetworkProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ProvisioningStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Cluster pool. */ +@Fluent +public final class ClusterPoolInner extends Resource { + /* + * Gets or sets the properties. Define cluster pool specific properties. + */ + @JsonProperty(value = "properties") + private ClusterPoolResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterPoolInner class. */ + public ClusterPoolInner() { + } + + /** + * Get the innerProperties property: Gets or sets the properties. Define cluster pool specific properties. + * + * @return the innerProperties value. + */ + private ClusterPoolResourceProperties 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 ClusterPoolInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterPoolInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStatus provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the deploymentId property: A unique id generated by the RP to identify the resource. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentId(); + } + + /** + * Get the managedResourceGroupName property: A resource group created by RP, to hold the resources created by RP + * on-behalf of customers. It will also be used to generate aksManagedResourceGroupName by pattern: + * MC_{managedResourceGroupName}_{clusterPoolName}_{region}. Please make sure it meets resource group name + * restriction. + * + * @return the managedResourceGroupName value. + */ + public String managedResourceGroupName() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupName(); + } + + /** + * Set the managedResourceGroupName property: A resource group created by RP, to hold the resources created by RP + * on-behalf of customers. It will also be used to generate aksManagedResourceGroupName by pattern: + * MC_{managedResourceGroupName}_{clusterPoolName}_{region}. Please make sure it meets resource group name + * restriction. + * + * @param managedResourceGroupName the managedResourceGroupName value to set. + * @return the ClusterPoolInner object itself. + */ + public ClusterPoolInner withManagedResourceGroupName(String managedResourceGroupName) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPoolResourceProperties(); + } + this.innerProperties().withManagedResourceGroupName(managedResourceGroupName); + return this; + } + + /** + * Get the aksManagedResourceGroupName property: A resource group created by AKS, to hold the infrastructure + * resources created by AKS on-behalf of customers. It is generated by cluster pool name and managed resource group + * name by pattern: MC_{managedResourceGroupName}_{clusterPoolName}_{region}. + * + * @return the aksManagedResourceGroupName value. + */ + public String aksManagedResourceGroupName() { + return this.innerProperties() == null ? null : this.innerProperties().aksManagedResourceGroupName(); + } + + /** + * Get the clusterPoolProfile property: CLuster pool profile. + * + * @return the clusterPoolProfile value. + */ + public ClusterPoolResourcePropertiesClusterPoolProfile clusterPoolProfile() { + return this.innerProperties() == null ? null : this.innerProperties().clusterPoolProfile(); + } + + /** + * Set the clusterPoolProfile property: CLuster pool profile. + * + * @param clusterPoolProfile the clusterPoolProfile value to set. + * @return the ClusterPoolInner object itself. + */ + public ClusterPoolInner withClusterPoolProfile(ClusterPoolResourcePropertiesClusterPoolProfile clusterPoolProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPoolResourceProperties(); + } + this.innerProperties().withClusterPoolProfile(clusterPoolProfile); + return this; + } + + /** + * Get the computeProfile property: CLuster pool compute profile. + * + * @return the computeProfile value. + */ + public ClusterPoolResourcePropertiesComputeProfile computeProfile() { + return this.innerProperties() == null ? null : this.innerProperties().computeProfile(); + } + + /** + * Set the computeProfile property: CLuster pool compute profile. + * + * @param computeProfile the computeProfile value to set. + * @return the ClusterPoolInner object itself. + */ + public ClusterPoolInner withComputeProfile(ClusterPoolResourcePropertiesComputeProfile computeProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPoolResourceProperties(); + } + this.innerProperties().withComputeProfile(computeProfile); + return this; + } + + /** + * Get the aksClusterProfile property: Properties of underlying AKS cluster. + * + * @return the aksClusterProfile value. + */ + public ClusterPoolResourcePropertiesAksClusterProfile aksClusterProfile() { + return this.innerProperties() == null ? null : this.innerProperties().aksClusterProfile(); + } + + /** + * Get the networkProfile property: Cluster pool network profile. + * + * @return the networkProfile value. + */ + public ClusterPoolResourcePropertiesNetworkProfile networkProfile() { + return this.innerProperties() == null ? null : this.innerProperties().networkProfile(); + } + + /** + * Set the networkProfile property: Cluster pool network profile. + * + * @param networkProfile the networkProfile value to set. + * @return the ClusterPoolInner object itself. + */ + public ClusterPoolInner withNetworkProfile(ClusterPoolResourcePropertiesNetworkProfile networkProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPoolResourceProperties(); + } + this.innerProperties().withNetworkProfile(networkProfile); + return this; + } + + /** + * Get the logAnalyticsProfile property: Cluster pool log analytics profile to enable OMS agent for AKS cluster. + * + * @return the logAnalyticsProfile value. + */ + public ClusterPoolResourcePropertiesLogAnalyticsProfile logAnalyticsProfile() { + return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsProfile(); + } + + /** + * Set the logAnalyticsProfile property: Cluster pool log analytics profile to enable OMS agent for AKS cluster. + * + * @param logAnalyticsProfile the logAnalyticsProfile value to set. + * @return the ClusterPoolInner object itself. + */ + public ClusterPoolInner withLogAnalyticsProfile( + ClusterPoolResourcePropertiesLogAnalyticsProfile logAnalyticsProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPoolResourceProperties(); + } + this.innerProperties().withLogAnalyticsProfile(logAnalyticsProfile); + return this; + } + + /** + * Get the status property: Business status of the resource. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolResourceProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolResourceProperties.java new file mode 100644 index 000000000000..91afb9acf749 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolResourceProperties.java @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesAksClusterProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesClusterPoolProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesComputeProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesLogAnalyticsProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesNetworkProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ProvisioningStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster pool resource properties. */ +@Fluent +public final class ClusterPoolResourceProperties { + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStatus provisioningState; + + /* + * A unique id generated by the RP to identify the resource. + */ + @JsonProperty(value = "deploymentId", access = JsonProperty.Access.WRITE_ONLY) + private String deploymentId; + + /* + * A resource group created by RP, to hold the resources created by RP on-behalf of customers. It will also be used + * to generate aksManagedResourceGroupName by pattern: MC_{managedResourceGroupName}_{clusterPoolName}_{region}. + * Please make sure it meets resource group name restriction. + */ + @JsonProperty(value = "managedResourceGroupName") + private String managedResourceGroupName; + + /* + * A resource group created by AKS, to hold the infrastructure resources created by AKS on-behalf of customers. It + * is generated by cluster pool name and managed resource group name by pattern: + * MC_{managedResourceGroupName}_{clusterPoolName}_{region} + */ + @JsonProperty(value = "aksManagedResourceGroupName", access = JsonProperty.Access.WRITE_ONLY) + private String aksManagedResourceGroupName; + + /* + * CLuster pool profile. + */ + @JsonProperty(value = "clusterPoolProfile") + private ClusterPoolResourcePropertiesClusterPoolProfile clusterPoolProfile; + + /* + * CLuster pool compute profile. + */ + @JsonProperty(value = "computeProfile", required = true) + private ClusterPoolResourcePropertiesComputeProfile computeProfile; + + /* + * Properties of underlying AKS cluster. + */ + @JsonProperty(value = "aksClusterProfile", access = JsonProperty.Access.WRITE_ONLY) + private ClusterPoolResourcePropertiesAksClusterProfile aksClusterProfile; + + /* + * Cluster pool network profile. + */ + @JsonProperty(value = "networkProfile") + private ClusterPoolResourcePropertiesNetworkProfile networkProfile; + + /* + * Cluster pool log analytics profile to enable OMS agent for AKS cluster. + */ + @JsonProperty(value = "logAnalyticsProfile") + private ClusterPoolResourcePropertiesLogAnalyticsProfile logAnalyticsProfile; + + /* + * Business status of the resource. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** Creates an instance of ClusterPoolResourceProperties class. */ + public ClusterPoolResourceProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the deploymentId property: A unique id generated by the RP to identify the resource. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.deploymentId; + } + + /** + * Get the managedResourceGroupName property: A resource group created by RP, to hold the resources created by RP + * on-behalf of customers. It will also be used to generate aksManagedResourceGroupName by pattern: + * MC_{managedResourceGroupName}_{clusterPoolName}_{region}. Please make sure it meets resource group name + * restriction. + * + * @return the managedResourceGroupName value. + */ + public String managedResourceGroupName() { + return this.managedResourceGroupName; + } + + /** + * Set the managedResourceGroupName property: A resource group created by RP, to hold the resources created by RP + * on-behalf of customers. It will also be used to generate aksManagedResourceGroupName by pattern: + * MC_{managedResourceGroupName}_{clusterPoolName}_{region}. Please make sure it meets resource group name + * restriction. + * + * @param managedResourceGroupName the managedResourceGroupName value to set. + * @return the ClusterPoolResourceProperties object itself. + */ + public ClusterPoolResourceProperties withManagedResourceGroupName(String managedResourceGroupName) { + this.managedResourceGroupName = managedResourceGroupName; + return this; + } + + /** + * Get the aksManagedResourceGroupName property: A resource group created by AKS, to hold the infrastructure + * resources created by AKS on-behalf of customers. It is generated by cluster pool name and managed resource group + * name by pattern: MC_{managedResourceGroupName}_{clusterPoolName}_{region}. + * + * @return the aksManagedResourceGroupName value. + */ + public String aksManagedResourceGroupName() { + return this.aksManagedResourceGroupName; + } + + /** + * Get the clusterPoolProfile property: CLuster pool profile. + * + * @return the clusterPoolProfile value. + */ + public ClusterPoolResourcePropertiesClusterPoolProfile clusterPoolProfile() { + return this.clusterPoolProfile; + } + + /** + * Set the clusterPoolProfile property: CLuster pool profile. + * + * @param clusterPoolProfile the clusterPoolProfile value to set. + * @return the ClusterPoolResourceProperties object itself. + */ + public ClusterPoolResourceProperties withClusterPoolProfile( + ClusterPoolResourcePropertiesClusterPoolProfile clusterPoolProfile) { + this.clusterPoolProfile = clusterPoolProfile; + return this; + } + + /** + * Get the computeProfile property: CLuster pool compute profile. + * + * @return the computeProfile value. + */ + public ClusterPoolResourcePropertiesComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the computeProfile property: CLuster pool compute profile. + * + * @param computeProfile the computeProfile value to set. + * @return the ClusterPoolResourceProperties object itself. + */ + public ClusterPoolResourceProperties withComputeProfile( + ClusterPoolResourcePropertiesComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the aksClusterProfile property: Properties of underlying AKS cluster. + * + * @return the aksClusterProfile value. + */ + public ClusterPoolResourcePropertiesAksClusterProfile aksClusterProfile() { + return this.aksClusterProfile; + } + + /** + * Get the networkProfile property: Cluster pool network profile. + * + * @return the networkProfile value. + */ + public ClusterPoolResourcePropertiesNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Cluster pool network profile. + * + * @param networkProfile the networkProfile value to set. + * @return the ClusterPoolResourceProperties object itself. + */ + public ClusterPoolResourceProperties withNetworkProfile( + ClusterPoolResourcePropertiesNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the logAnalyticsProfile property: Cluster pool log analytics profile to enable OMS agent for AKS cluster. + * + * @return the logAnalyticsProfile value. + */ + public ClusterPoolResourcePropertiesLogAnalyticsProfile logAnalyticsProfile() { + return this.logAnalyticsProfile; + } + + /** + * Set the logAnalyticsProfile property: Cluster pool log analytics profile to enable OMS agent for AKS cluster. + * + * @param logAnalyticsProfile the logAnalyticsProfile value to set. + * @return the ClusterPoolResourceProperties object itself. + */ + public ClusterPoolResourceProperties withLogAnalyticsProfile( + ClusterPoolResourcePropertiesLogAnalyticsProfile logAnalyticsProfile) { + this.logAnalyticsProfile = logAnalyticsProfile; + return this; + } + + /** + * Get the status property: Business status of the resource. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterPoolProfile() != null) { + clusterPoolProfile().validate(); + } + if (computeProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property computeProfile in model ClusterPoolResourceProperties")); + } else { + computeProfile().validate(); + } + if (aksClusterProfile() != null) { + aksClusterProfile().validate(); + } + if (networkProfile() != null) { + networkProfile().validate(); + } + if (logAnalyticsProfile() != null) { + logAnalyticsProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolResourceProperties.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolVersionInner.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolVersionInner.java new file mode 100644 index 000000000000..89b8e33c4aaa --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolVersionInner.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Available cluster pool version. */ +@Fluent +public final class ClusterPoolVersionInner extends ProxyResource { + /* + * Cluster pool version properties. + */ + @JsonProperty(value = "properties") + private ClusterPoolVersionProperties innerProperties; + + /** Creates an instance of ClusterPoolVersionInner class. */ + public ClusterPoolVersionInner() { + } + + /** + * Get the innerProperties property: Cluster pool version properties. + * + * @return the innerProperties value. + */ + private ClusterPoolVersionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the clusterPoolVersion property: Cluster pool version is a 2-part version. + * + * @return the clusterPoolVersion value. + */ + public String clusterPoolVersion() { + return this.innerProperties() == null ? null : this.innerProperties().clusterPoolVersion(); + } + + /** + * Set the clusterPoolVersion property: Cluster pool version is a 2-part version. + * + * @param clusterPoolVersion the clusterPoolVersion value to set. + * @return the ClusterPoolVersionInner object itself. + */ + public ClusterPoolVersionInner withClusterPoolVersion(String clusterPoolVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPoolVersionProperties(); + } + this.innerProperties().withClusterPoolVersion(clusterPoolVersion); + return this; + } + + /** + * Get the aksVersion property: AKS version. + * + * @return the aksVersion value. + */ + public String aksVersion() { + return this.innerProperties() == null ? null : this.innerProperties().aksVersion(); + } + + /** + * Set the aksVersion property: AKS version. + * + * @param aksVersion the aksVersion value to set. + * @return the ClusterPoolVersionInner object itself. + */ + public ClusterPoolVersionInner withAksVersion(String aksVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPoolVersionProperties(); + } + this.innerProperties().withAksVersion(aksVersion); + return this; + } + + /** + * Get the isPreview property: Indicate if this version is in preview or not. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.innerProperties() == null ? null : this.innerProperties().isPreview(); + } + + /** + * Set the isPreview property: Indicate if this version is in preview or not. + * + * @param isPreview the isPreview value to set. + * @return the ClusterPoolVersionInner object itself. + */ + public ClusterPoolVersionInner withIsPreview(Boolean isPreview) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPoolVersionProperties(); + } + this.innerProperties().withIsPreview(isPreview); + 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolVersionProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolVersionProperties.java new file mode 100644 index 000000000000..c18187649643 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterPoolVersionProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster pool version properties. */ +@Fluent +public final class ClusterPoolVersionProperties { + /* + * Cluster pool version is a 2-part version. + */ + @JsonProperty(value = "clusterPoolVersion") + private String clusterPoolVersion; + + /* + * AKS version. + */ + @JsonProperty(value = "aksVersion") + private String aksVersion; + + /* + * Indicate if this version is in preview or not. + */ + @JsonProperty(value = "isPreview") + private Boolean isPreview; + + /** Creates an instance of ClusterPoolVersionProperties class. */ + public ClusterPoolVersionProperties() { + } + + /** + * Get the clusterPoolVersion property: Cluster pool version is a 2-part version. + * + * @return the clusterPoolVersion value. + */ + public String clusterPoolVersion() { + return this.clusterPoolVersion; + } + + /** + * Set the clusterPoolVersion property: Cluster pool version is a 2-part version. + * + * @param clusterPoolVersion the clusterPoolVersion value to set. + * @return the ClusterPoolVersionProperties object itself. + */ + public ClusterPoolVersionProperties withClusterPoolVersion(String clusterPoolVersion) { + this.clusterPoolVersion = clusterPoolVersion; + return this; + } + + /** + * Get the aksVersion property: AKS version. + * + * @return the aksVersion value. + */ + public String aksVersion() { + return this.aksVersion; + } + + /** + * Set the aksVersion property: AKS version. + * + * @param aksVersion the aksVersion value to set. + * @return the ClusterPoolVersionProperties object itself. + */ + public ClusterPoolVersionProperties withAksVersion(String aksVersion) { + this.aksVersion = aksVersion; + return this; + } + + /** + * Get the isPreview property: Indicate if this version is in preview or not. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Indicate if this version is in preview or not. + * + * @param isPreview the isPreview value to set. + * @return the ClusterPoolVersionProperties object itself. + */ + public ClusterPoolVersionProperties 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterResizeProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterResizeProperties.java new file mode 100644 index 000000000000..f04020ecc1c7 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterResizeProperties.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties for resizing a cluster. */ +@Fluent +public final class ClusterResizeProperties { + /* + * Target node count of worker node. + */ + @JsonProperty(value = "targetWorkerNodeCount", required = true) + private int targetWorkerNodeCount; + + /** Creates an instance of ClusterResizeProperties class. */ + public ClusterResizeProperties() { + } + + /** + * Get the targetWorkerNodeCount property: Target node count of worker node. + * + * @return the targetWorkerNodeCount value. + */ + public int targetWorkerNodeCount() { + return this.targetWorkerNodeCount; + } + + /** + * Set the targetWorkerNodeCount property: Target node count of worker node. + * + * @param targetWorkerNodeCount the targetWorkerNodeCount value to set. + * @return the ClusterResizeProperties object itself. + */ + public ClusterResizeProperties withTargetWorkerNodeCount(int targetWorkerNodeCount) { + this.targetWorkerNodeCount = targetWorkerNodeCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterResourceProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterResourceProperties.java new file mode 100644 index 000000000000..68edd0d4a701 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterResourceProperties.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ComputeProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ProvisioningStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster resource properties. */ +@Fluent +public final class ClusterResourceProperties { + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStatus provisioningState; + + /* + * The type of cluster. + */ + @JsonProperty(value = "clusterType", required = true) + private String clusterType; + + /* + * A unique id generated by the RP to identify the resource. + */ + @JsonProperty(value = "deploymentId", access = JsonProperty.Access.WRITE_ONLY) + private String deploymentId; + + /* + * The compute profile. + */ + @JsonProperty(value = "computeProfile", required = true) + private ComputeProfile computeProfile; + + /* + * Cluster profile. + */ + @JsonProperty(value = "clusterProfile", required = true) + private ClusterProfile clusterProfile; + + /* + * Business status of the resource. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** Creates an instance of ClusterResourceProperties class. */ + public ClusterResourceProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the clusterType property: The type of cluster. + * + * @return the clusterType value. + */ + public String clusterType() { + return this.clusterType; + } + + /** + * Set the clusterType property: The type of cluster. + * + * @param clusterType the clusterType value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withClusterType(String clusterType) { + this.clusterType = clusterType; + return this; + } + + /** + * Get the deploymentId property: A unique id generated by the RP to identify the resource. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.deploymentId; + } + + /** + * Get the computeProfile property: The compute profile. + * + * @return the computeProfile value. + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the computeProfile property: The compute profile. + * + * @param computeProfile the computeProfile value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the clusterProfile property: Cluster profile. + * + * @return the clusterProfile value. + */ + public ClusterProfile clusterProfile() { + return this.clusterProfile; + } + + /** + * Set the clusterProfile property: Cluster profile. + * + * @param clusterProfile the clusterProfile value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withClusterProfile(ClusterProfile clusterProfile) { + this.clusterProfile = clusterProfile; + return this; + } + + /** + * Get the status property: Business status of the resource. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clusterType in model ClusterResourceProperties")); + } + if (computeProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property computeProfile in model ClusterResourceProperties")); + } else { + computeProfile().validate(); + } + if (clusterProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clusterProfile in model ClusterResourceProperties")); + } else { + clusterProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterResourceProperties.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterVersionInner.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterVersionInner.java new file mode 100644 index 000000000000..7cc138139818 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterVersionInner.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterComponentsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Available cluster version. */ +@Fluent +public final class ClusterVersionInner extends ProxyResource { + /* + * Cluster version properties. + */ + @JsonProperty(value = "properties") + private ClusterVersionProperties innerProperties; + + /** Creates an instance of ClusterVersionInner class. */ + public ClusterVersionInner() { + } + + /** + * Get the innerProperties property: Cluster version properties. + * + * @return the innerProperties value. + */ + private ClusterVersionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the clusterType property: The type of cluster. + * + * @return the clusterType value. + */ + public String clusterType() { + return this.innerProperties() == null ? null : this.innerProperties().clusterType(); + } + + /** + * Set the clusterType property: The type of cluster. + * + * @param clusterType the clusterType value to set. + * @return the ClusterVersionInner object itself. + */ + public ClusterVersionInner withClusterType(String clusterType) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterVersionProperties(); + } + this.innerProperties().withClusterType(clusterType); + return this; + } + + /** + * Get the clusterVersion property: Version with three part. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.innerProperties() == null ? null : this.innerProperties().clusterVersion(); + } + + /** + * Set the clusterVersion property: Version with three part. + * + * @param clusterVersion the clusterVersion value to set. + * @return the ClusterVersionInner object itself. + */ + public ClusterVersionInner withClusterVersion(String clusterVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterVersionProperties(); + } + this.innerProperties().withClusterVersion(clusterVersion); + return this; + } + + /** + * Get the ossVersion property: Version with three part. + * + * @return the ossVersion value. + */ + public String ossVersion() { + return this.innerProperties() == null ? null : this.innerProperties().ossVersion(); + } + + /** + * Set the ossVersion property: Version with three part. + * + * @param ossVersion the ossVersion value to set. + * @return the ClusterVersionInner object itself. + */ + public ClusterVersionInner withOssVersion(String ossVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterVersionProperties(); + } + this.innerProperties().withOssVersion(ossVersion); + return this; + } + + /** + * Get the clusterPoolVersion property: The two part cluster pool version. If the cluster version is before cluster + * pool version on-board, the return value will be empty string. + * + * @return the clusterPoolVersion value. + */ + public String clusterPoolVersion() { + return this.innerProperties() == null ? null : this.innerProperties().clusterPoolVersion(); + } + + /** + * Set the clusterPoolVersion property: The two part cluster pool version. If the cluster version is before cluster + * pool version on-board, the return value will be empty string. + * + * @param clusterPoolVersion the clusterPoolVersion value to set. + * @return the ClusterVersionInner object itself. + */ + public ClusterVersionInner withClusterPoolVersion(String clusterPoolVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterVersionProperties(); + } + this.innerProperties().withClusterPoolVersion(clusterPoolVersion); + return this; + } + + /** + * Get the isPreview property: Indicate if this version is in preview or not. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.innerProperties() == null ? null : this.innerProperties().isPreview(); + } + + /** + * Set the isPreview property: Indicate if this version is in preview or not. + * + * @param isPreview the isPreview value to set. + * @return the ClusterVersionInner object itself. + */ + public ClusterVersionInner withIsPreview(Boolean isPreview) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterVersionProperties(); + } + this.innerProperties().withIsPreview(isPreview); + return this; + } + + /** + * Get the components property: Component list of this cluster type and version. + * + * @return the components value. + */ + public List components() { + return this.innerProperties() == null ? null : this.innerProperties().components(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterVersionProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterVersionProperties.java new file mode 100644 index 000000000000..284b65f44aeb --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ClusterVersionProperties.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterComponentsItem; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster version properties. */ +@Fluent +public final class ClusterVersionProperties { + /* + * The type of cluster. + */ + @JsonProperty(value = "clusterType") + private String clusterType; + + /* + * Version with three part. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /* + * Version with three part. + */ + @JsonProperty(value = "ossVersion") + private String ossVersion; + + /* + * The two part cluster pool version. If the cluster version is before cluster pool version on-board, the return + * value will be empty string + */ + @JsonProperty(value = "clusterPoolVersion") + private String clusterPoolVersion; + + /* + * Indicate if this version is in preview or not. + */ + @JsonProperty(value = "isPreview") + private Boolean isPreview; + + /* + * Component list of this cluster type and version. + */ + @JsonProperty(value = "components", access = JsonProperty.Access.WRITE_ONLY) + private List components; + + /** Creates an instance of ClusterVersionProperties class. */ + public ClusterVersionProperties() { + } + + /** + * Get the clusterType property: The type of cluster. + * + * @return the clusterType value. + */ + public String clusterType() { + return this.clusterType; + } + + /** + * Set the clusterType property: The type of cluster. + * + * @param clusterType the clusterType value to set. + * @return the ClusterVersionProperties object itself. + */ + public ClusterVersionProperties withClusterType(String clusterType) { + this.clusterType = clusterType; + return this; + } + + /** + * Get the clusterVersion property: Version with three part. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the clusterVersion property: Version with three part. + * + * @param clusterVersion the clusterVersion value to set. + * @return the ClusterVersionProperties object itself. + */ + public ClusterVersionProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the ossVersion property: Version with three part. + * + * @return the ossVersion value. + */ + public String ossVersion() { + return this.ossVersion; + } + + /** + * Set the ossVersion property: Version with three part. + * + * @param ossVersion the ossVersion value to set. + * @return the ClusterVersionProperties object itself. + */ + public ClusterVersionProperties withOssVersion(String ossVersion) { + this.ossVersion = ossVersion; + return this; + } + + /** + * Get the clusterPoolVersion property: The two part cluster pool version. If the cluster version is before cluster + * pool version on-board, the return value will be empty string. + * + * @return the clusterPoolVersion value. + */ + public String clusterPoolVersion() { + return this.clusterPoolVersion; + } + + /** + * Set the clusterPoolVersion property: The two part cluster pool version. If the cluster version is before cluster + * pool version on-board, the return value will be empty string. + * + * @param clusterPoolVersion the clusterPoolVersion value to set. + * @return the ClusterVersionProperties object itself. + */ + public ClusterVersionProperties withClusterPoolVersion(String clusterPoolVersion) { + this.clusterPoolVersion = clusterPoolVersion; + return this; + } + + /** + * Get the isPreview property: Indicate if this version is in preview or not. + * + * @return the isPreview value. + */ + public Boolean isPreview() { + return this.isPreview; + } + + /** + * Set the isPreview property: Indicate if this version is in preview or not. + * + * @param isPreview the isPreview value to set. + * @return the ClusterVersionProperties object itself. + */ + public ClusterVersionProperties withIsPreview(Boolean isPreview) { + this.isPreview = isPreview; + return this; + } + + /** + * Get the components property: Component list of this cluster type and version. + * + * @return the components value. + */ + public List components() { + return this.components; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (components() != null) { + components().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/NameAvailabilityResultInner.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/NameAvailabilityResultInner.java new file mode 100644 index 000000000000..85c7d24df281 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/NameAvailabilityResultInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Result of check name availability. */ +@Fluent +public final class NameAvailabilityResultInner { + /* + * Indicator of availability of the Microsoft.HDInsight resource name. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * The reason of unavailability. + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * The error message of unavailability. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of NameAvailabilityResultInner class. */ + public NameAvailabilityResultInner() { + } + + /** + * Get the nameAvailable property: Indicator of availability of the Microsoft.HDInsight resource name. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Indicator of availability of the Microsoft.HDInsight resource name. + * + * @param nameAvailable the nameAvailable value to set. + * @return the NameAvailabilityResultInner object itself. + */ + public NameAvailabilityResultInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: The reason of unavailability. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: The reason of unavailability. + * + * @param reason the reason value to set. + * @return the NameAvailabilityResultInner object itself. + */ + public NameAvailabilityResultInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: The error message of unavailability. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The error message of unavailability. + * + * @param message the message value to set. + * @return the NameAvailabilityResultInner object itself. + */ + public NameAvailabilityResultInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/OperationInner.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/OperationInner.java new file mode 100644 index 000000000000..8b4ce69a1861 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/OperationInner.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ActionType; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.OperationDisplay; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ServiceConfigResultInner.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ServiceConfigResultInner.java new file mode 100644 index 000000000000..82cab87e12cc --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ServiceConfigResultInner.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ServiceConfigListResultValueEntity; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Cluster instance service config. */ +@Fluent +public final class ServiceConfigResultInner { + /* + * Cluster instance service config properties. + */ + @JsonProperty(value = "properties") + private ServiceConfigResultProperties innerProperties; + + /** Creates an instance of ServiceConfigResultInner class. */ + public ServiceConfigResultInner() { + } + + /** + * Get the innerProperties property: Cluster instance service config properties. + * + * @return the innerProperties value. + */ + private ServiceConfigResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the serviceName property: Service Config Name. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.innerProperties() == null ? null : this.innerProperties().serviceName(); + } + + /** + * Set the serviceName property: Service Config Name. + * + * @param serviceName the serviceName value to set. + * @return the ServiceConfigResultInner object itself. + */ + public ServiceConfigResultInner withServiceName(String serviceName) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceConfigResultProperties(); + } + this.innerProperties().withServiceName(serviceName); + return this; + } + + /** + * Get the fileName property: File Name. + * + * @return the fileName value. + */ + public String fileName() { + return this.innerProperties() == null ? null : this.innerProperties().fileName(); + } + + /** + * Set the fileName property: File Name. + * + * @param fileName the fileName value to set. + * @return the ServiceConfigResultInner object itself. + */ + public ServiceConfigResultInner withFileName(String fileName) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceConfigResultProperties(); + } + this.innerProperties().withFileName(fileName); + return this; + } + + /** + * Get the content property: Content in the service config file. + * + * @return the content value. + */ + public String content() { + return this.innerProperties() == null ? null : this.innerProperties().content(); + } + + /** + * Set the content property: Content in the service config file. + * + * @param content the content value to set. + * @return the ServiceConfigResultInner object itself. + */ + public ServiceConfigResultInner withContent(String content) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceConfigResultProperties(); + } + this.innerProperties().withContent(content); + return this; + } + + /** + * Get the componentName property: Component Name. + * + * @return the componentName value. + */ + public String componentName() { + return this.innerProperties() == null ? null : this.innerProperties().componentName(); + } + + /** + * Set the componentName property: Component Name. + * + * @param componentName the componentName value to set. + * @return the ServiceConfigResultInner object itself. + */ + public ServiceConfigResultInner withComponentName(String componentName) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceConfigResultProperties(); + } + this.innerProperties().withComponentName(componentName); + return this; + } + + /** + * Get the type property: Config type. + * + * @return the type value. + */ + public String type() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Config type. + * + * @param type the type value to set. + * @return the ServiceConfigResultInner object itself. + */ + public ServiceConfigResultInner withType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceConfigResultProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the path property: Config file path. + * + * @return the path value. + */ + public String path() { + return this.innerProperties() == null ? null : this.innerProperties().path(); + } + + /** + * Set the path property: Config file path. + * + * @param path the path value to set. + * @return the ServiceConfigResultInner object itself. + */ + public ServiceConfigResultInner withPath(String path) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceConfigResultProperties(); + } + this.innerProperties().withPath(path); + return this; + } + + /** + * Get the customKeys property: The custom keys. + * + * @return the customKeys value. + */ + public Map customKeys() { + return this.innerProperties() == null ? null : this.innerProperties().customKeys(); + } + + /** + * Set the customKeys property: The custom keys. + * + * @param customKeys the customKeys value to set. + * @return the ServiceConfigResultInner object itself. + */ + public ServiceConfigResultInner withCustomKeys(Map customKeys) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceConfigResultProperties(); + } + this.innerProperties().withCustomKeys(customKeys); + return this; + } + + /** + * Get the defaultKeys property: The default keys. + * + * @return the defaultKeys value. + */ + public Map defaultKeys() { + return this.innerProperties() == null ? null : this.innerProperties().defaultKeys(); + } + + /** + * Set the defaultKeys property: The default keys. + * + * @param defaultKeys the defaultKeys value to set. + * @return the ServiceConfigResultInner object itself. + */ + public ServiceConfigResultInner withDefaultKeys(Map defaultKeys) { + if (this.innerProperties() == null) { + this.innerProperties = new ServiceConfigResultProperties(); + } + this.innerProperties().withDefaultKeys(defaultKeys); + 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ServiceConfigResultProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ServiceConfigResultProperties.java new file mode 100644 index 000000000000..3fdc7b489fca --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/ServiceConfigResultProperties.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ServiceConfigListResultProperties; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ServiceConfigListResultValueEntity; +import java.util.Map; + +/** Cluster instance service config properties. */ +@Fluent +public final class ServiceConfigResultProperties extends ServiceConfigListResultProperties { + /** Creates an instance of ServiceConfigResultProperties class. */ + public ServiceConfigResultProperties() { + } + + /** {@inheritDoc} */ + @Override + public ServiceConfigResultProperties withServiceName(String serviceName) { + super.withServiceName(serviceName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceConfigResultProperties withFileName(String fileName) { + super.withFileName(fileName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceConfigResultProperties withContent(String content) { + super.withContent(content); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceConfigResultProperties withComponentName(String componentName) { + super.withComponentName(componentName); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceConfigResultProperties withType(String type) { + super.withType(type); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceConfigResultProperties withPath(String path) { + super.withPath(path); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceConfigResultProperties withCustomKeys(Map customKeys) { + super.withCustomKeys(customKeys); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceConfigResultProperties withDefaultKeys(Map defaultKeys) { + super.withDefaultKeys(defaultKeys); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/TrinoDebugConfig.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/TrinoDebugConfig.java new file mode 100644 index 000000000000..5cdbf57a9c9a --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/TrinoDebugConfig.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trino debug configuration. */ +@Fluent +public final class TrinoDebugConfig { + /* + * The flag that if enable debug or not. + */ + @JsonProperty(value = "enable") + private Boolean enable; + + /* + * The debug port. + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * The flag that if suspend debug or not. + */ + @JsonProperty(value = "suspend") + private Boolean suspend; + + /** Creates an instance of TrinoDebugConfig class. */ + public TrinoDebugConfig() { + } + + /** + * Get the enable property: The flag that if enable debug or not. + * + * @return the enable value. + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set the enable property: The flag that if enable debug or not. + * + * @param enable the enable value to set. + * @return the TrinoDebugConfig object itself. + */ + public TrinoDebugConfig withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get the port property: The debug port. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The debug port. + * + * @param port the port value to set. + * @return the TrinoDebugConfig object itself. + */ + public TrinoDebugConfig withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the suspend property: The flag that if suspend debug or not. + * + * @return the suspend value. + */ + public Boolean suspend() { + return this.suspend; + } + + /** + * Set the suspend property: The flag that if suspend debug or not. + * + * @param suspend the suspend value to set. + * @return the TrinoDebugConfig object itself. + */ + public TrinoDebugConfig withSuspend(Boolean suspend) { + this.suspend = suspend; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/package-info.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/models/package-info.java new file mode 100644 index 000000000000..4c518fa2c123 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/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 HDInsightOnAksManagementClient. HDInsight On Aks Management Client. */ +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/package-info.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/fluent/package-info.java new file mode 100644 index 000000000000..b7f15e95cac4 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/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 HDInsightOnAksManagementClient. HDInsight On Aks Management Client. */ +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent; diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterPoolVersionsClientImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterPoolVersionsClientImpl.java new file mode 100644 index 000000000000..23a76cccdce7 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterPoolVersionsClientImpl.java @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.AvailableClusterPoolVersionsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolVersionInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolVersionsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailableClusterPoolVersionsClient. */ +public final class AvailableClusterPoolVersionsClientImpl implements AvailableClusterPoolVersionsClient { + /** The proxy service used to perform REST calls. */ + private final AvailableClusterPoolVersionsService service; + + /** The service client containing this operation class. */ + private final HDInsightOnAksManagementClientImpl client; + + /** + * Initializes an instance of AvailableClusterPoolVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableClusterPoolVersionsClientImpl(HDInsightOnAksManagementClientImpl client) { + this.service = + RestProxy + .create( + AvailableClusterPoolVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightOnAksManagementClientAvailableClusterPoolVersions to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightOnAksManage") + public interface AvailableClusterPoolVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/availableClusterPoolVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocation( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of available cluster pool versions. + * + * @param location The name of the 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 represents a list of cluster pool versions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location) { + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByLocation( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + 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())); + } + + /** + * Returns a list of available cluster pool versions. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool versions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync( + String location, 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByLocation( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of available cluster pool versions. + * + * @param location The name of the 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 represents a list of cluster pool versions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location) { + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location), nextLink -> listByLocationNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of available cluster pool versions. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool versions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location, Context context) { + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location, context), + nextLink -> listByLocationNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of available cluster pool versions. + * + * @param location The name of the 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 represents a list of cluster pool versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location) { + return new PagedIterable<>(listByLocationAsync(location)); + } + + /** + * Returns a list of available cluster pool versions. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location, Context context) { + return new PagedIterable<>(listByLocationAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 represents a list of cluster pool versions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync(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.listByLocationNext(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 URL to get the next list of items + *

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 represents a list of cluster pool versions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync( + 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 + .listByLocationNext(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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterPoolVersionsImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterPoolVersionsImpl.java new file mode 100644 index 000000000000..58e26844bfdb --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterPoolVersionsImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.AvailableClusterPoolVersionsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolVersionInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AvailableClusterPoolVersions; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolVersion; + +public final class AvailableClusterPoolVersionsImpl implements AvailableClusterPoolVersions { + private static final ClientLogger LOGGER = new ClientLogger(AvailableClusterPoolVersionsImpl.class); + + private final AvailableClusterPoolVersionsClient innerClient; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + public AvailableClusterPoolVersionsImpl( + AvailableClusterPoolVersionsClient innerClient, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLocation(String location) { + PagedIterable inner = this.serviceClient().listByLocation(location); + return Utils.mapPage(inner, inner1 -> new ClusterPoolVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByLocation(String location, Context context) { + PagedIterable inner = this.serviceClient().listByLocation(location, context); + return Utils.mapPage(inner, inner1 -> new ClusterPoolVersionImpl(inner1, this.manager())); + } + + private AvailableClusterPoolVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterVersionsClientImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterVersionsClientImpl.java new file mode 100644 index 000000000000..43cb68399293 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterVersionsClientImpl.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.AvailableClusterVersionsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterVersionInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterVersionsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AvailableClusterVersionsClient. */ +public final class AvailableClusterVersionsClientImpl implements AvailableClusterVersionsClient { + /** The proxy service used to perform REST calls. */ + private final AvailableClusterVersionsService service; + + /** The service client containing this operation class. */ + private final HDInsightOnAksManagementClientImpl client; + + /** + * Initializes an instance of AvailableClusterVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AvailableClusterVersionsClientImpl(HDInsightOnAksManagementClientImpl client) { + this.service = + RestProxy + .create(AvailableClusterVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightOnAksManagementClientAvailableClusterVersions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightOnAksManage") + public interface AvailableClusterVersionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/availableClusterVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocation( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByLocationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of available cluster versions. + * + * @param location The name of the 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 represents a list of cluster versions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location) { + 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByLocation( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + 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())); + } + + /** + * Returns a list of available cluster versions. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster versions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationSinglePageAsync(String location, 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByLocation( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of available cluster versions. + * + * @param location The name of the 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 represents a list of cluster versions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location) { + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location), nextLink -> listByLocationNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of available cluster versions. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster versions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByLocationAsync(String location, Context context) { + return new PagedFlux<>( + () -> listByLocationSinglePageAsync(location, context), + nextLink -> listByLocationNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of available cluster versions. + * + * @param location The name of the 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 represents a list of cluster versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location) { + return new PagedIterable<>(listByLocationAsync(location)); + } + + /** + * Returns a list of available cluster versions. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByLocation(String location, Context context) { + return new PagedIterable<>(listByLocationAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 represents a list of cluster versions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync(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.listByLocationNext(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 URL to get the next list of items + *

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 represents a list of cluster versions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByLocationNextSinglePageAsync( + 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 + .listByLocationNext(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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterVersionsImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterVersionsImpl.java new file mode 100644 index 000000000000..67b6039cd2e5 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/AvailableClusterVersionsImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.AvailableClusterVersionsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterVersionInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AvailableClusterVersions; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterVersion; + +public final class AvailableClusterVersionsImpl implements AvailableClusterVersions { + private static final ClientLogger LOGGER = new ClientLogger(AvailableClusterVersionsImpl.class); + + private final AvailableClusterVersionsClient innerClient; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + public AvailableClusterVersionsImpl( + AvailableClusterVersionsClient innerClient, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByLocation(String location) { + PagedIterable inner = this.serviceClient().listByLocation(location); + return Utils.mapPage(inner, inner1 -> new ClusterVersionImpl(inner1, this.manager())); + } + + public PagedIterable listByLocation(String location, Context context) { + PagedIterable inner = this.serviceClient().listByLocation(location, context); + return Utils.mapPage(inner, inner1 -> new ClusterVersionImpl(inner1, this.manager())); + } + + private AvailableClusterVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterImpl.java new file mode 100644 index 000000000000..bcde8f339946 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Cluster; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPatch; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterResizeData; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ComputeProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ProvisioningStatus; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.UpdatableClusterProfile; +import java.util.Collections; +import java.util.Map; + +public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterInner innerObject; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + 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 ProvisioningStatus provisioningState() { + return this.innerModel().provisioningState(); + } + + public String clusterType() { + return this.innerModel().clusterType(); + } + + public String deploymentId() { + return this.innerModel().deploymentId(); + } + + public ComputeProfile computeProfile() { + return this.innerModel().computeProfile(); + } + + public ClusterProfile clusterProfile() { + return this.innerModel().clusterProfile(); + } + + public String status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ClusterInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterPoolName; + + private String clusterName; + + private ClusterPatch updateClusterPatchRequest; + + public ClusterImpl withExistingClusterpool(String resourceGroupName, String clusterPoolName) { + this.resourceGroupName = resourceGroupName; + this.clusterPoolName = clusterPoolName; + return this; + } + + public Cluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .create(resourceGroupName, clusterPoolName, clusterName, this.innerModel(), Context.NONE); + return this; + } + + public Cluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .create(resourceGroupName, clusterPoolName, clusterName, this.innerModel(), context); + return this; + } + + ClusterImpl( + String name, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerObject = new ClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + } + + public ClusterImpl update() { + this.updateClusterPatchRequest = new ClusterPatch(); + return this; + } + + public Cluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, clusterPoolName, clusterName, updateClusterPatchRequest, Context.NONE); + return this; + } + + public Cluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .update(resourceGroupName, clusterPoolName, clusterName, updateClusterPatchRequest, context); + return this; + } + + ClusterImpl( + ClusterInner innerObject, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterPoolName = Utils.getValueFromIdByName(innerObject.id(), "clusterpools"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + } + + public Cluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getWithResponse(resourceGroupName, clusterPoolName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public Cluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getWithResponse(resourceGroupName, clusterPoolName, clusterName, context) + .getValue(); + return this; + } + + public Cluster resize(ClusterResizeData clusterResizeRequest) { + return serviceManager.clusters().resize(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest); + } + + public Cluster resize(ClusterResizeData clusterResizeRequest, Context context) { + return serviceManager + .clusters() + .resize(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, context); + } + + public ClusterImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ClusterImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateClusterPatchRequest.withTags(tags); + return this; + } + } + + public ClusterImpl withClusterType(String clusterType) { + this.innerModel().withClusterType(clusterType); + return this; + } + + public ClusterImpl withComputeProfile(ComputeProfile computeProfile) { + this.innerModel().withComputeProfile(computeProfile); + return this; + } + + public ClusterImpl withClusterProfile(ClusterProfile clusterProfile) { + this.innerModel().withClusterProfile(clusterProfile); + return this; + } + + public ClusterImpl withClusterProfile(UpdatableClusterProfile clusterProfile) { + this.updateClusterPatchRequest.withClusterProfile(clusterProfile); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterInstanceViewResultImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterInstanceViewResultImpl.java new file mode 100644 index 000000000000..3c4947952377 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterInstanceViewResultImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.implementation; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInstanceViewResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterInstanceViewPropertiesStatus; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterInstanceViewResult; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ServiceStatus; +import java.util.Collections; +import java.util.List; + +public final class ClusterInstanceViewResultImpl implements ClusterInstanceViewResult { + private ClusterInstanceViewResultInner innerObject; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + ClusterInstanceViewResultImpl( + ClusterInstanceViewResultInner innerObject, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public ClusterInstanceViewPropertiesStatus status() { + return this.innerModel().status(); + } + + public List serviceStatuses() { + List inner = this.innerModel().serviceStatuses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ClusterInstanceViewResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterJobImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterJobImpl.java new file mode 100644 index 000000000000..16e751781786 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterJobImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterJobInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterJob; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterJobProperties; + +public final class ClusterJobImpl implements ClusterJob { + private ClusterJobInner innerObject; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + ClusterJobImpl( + ClusterJobInner innerObject, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager 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 ClusterJobProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ClusterJobInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterJobsClientImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterJobsClientImpl.java new file mode 100644 index 000000000000..aa9e3966b4e3 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterJobsClientImpl.java @@ -0,0 +1,687 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation; + +import com.azure.core.annotation.BodyParam; +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.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.ClusterJobsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterJobInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterJobList; +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 ClusterJobsClient. */ +public final class ClusterJobsClientImpl implements ClusterJobsClient { + /** The proxy service used to perform REST calls. */ + private final ClusterJobsService service; + + /** The service client containing this operation class. */ + private final HDInsightOnAksManagementClientImpl client; + + /** + * Initializes an instance of ClusterJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClusterJobsClientImpl(HDInsightOnAksManagementClientImpl client) { + this.service = + RestProxy.create(ClusterJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightOnAksManagementClientClusterJobs to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightOnAksManage") + public interface ClusterJobsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/runJob") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> runJob( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterJobInner clusterJob, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/jobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @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); + } + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runJobWithResponseAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterJobInner clusterJob) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterJob == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterJob is required and cannot be null.")); + } else { + clusterJob.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .runJob( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + clusterJob, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> runJobWithResponseAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterJobInner clusterJob, + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterJob == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterJob is required and cannot be null.")); + } else { + clusterJob.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .runJob( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + clusterJob, + accept, + context); + } + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterJobInner> beginRunJobAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterJobInner clusterJob) { + Mono>> mono = + runJobWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, clusterJob); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterJobInner.class, + ClusterJobInner.class, + this.client.getContext()); + } + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterJobInner> beginRunJobAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterJobInner clusterJob, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + runJobWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, clusterJob, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterJobInner.class, ClusterJobInner.class, context); + } + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterJobInner> beginRunJob( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterJobInner clusterJob) { + return this.beginRunJobAsync(resourceGroupName, clusterPoolName, clusterName, clusterJob).getSyncPoller(); + } + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterJobInner> beginRunJob( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterJobInner clusterJob, + Context context) { + return this + .beginRunJobAsync(resourceGroupName, clusterPoolName, clusterName, clusterJob, context) + .getSyncPoller(); + } + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runJobAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterJobInner clusterJob) { + return beginRunJobAsync(resourceGroupName, clusterPoolName, clusterName, clusterJob) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono runJobAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterJobInner clusterJob, + Context context) { + return beginRunJobAsync(resourceGroupName, clusterPoolName, clusterName, clusterJob, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterJobInner runJob( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterJobInner clusterJob) { + return runJobAsync(resourceGroupName, clusterPoolName, clusterName, clusterJob).block(); + } + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterJobInner runJob( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterJobInner clusterJob, + Context context) { + return runJobAsync(resourceGroupName, clusterPoolName, clusterName, clusterJob, context).block(); + } + + /** + * Get jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 jobs of HDInsight on AKS cluster along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterPoolName, String clusterName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + 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 jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 jobs of HDInsight on AKS cluster along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 jobs of HDInsight on AKS cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterPoolName, String clusterName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterPoolName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 jobs of HDInsight on AKS cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, clusterPoolName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 jobs of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterPoolName, clusterName)); + } + + /** + * Get jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 jobs of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterPoolName, clusterName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 cluster job 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 URL to get the next list of items + *

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 cluster job 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterJobsImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterJobsImpl.java new file mode 100644 index 000000000000..6ac12f6732c4 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterJobsImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.ClusterJobsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterJobInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterJob; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterJobs; + +public final class ClusterJobsImpl implements ClusterJobs { + private static final ClientLogger LOGGER = new ClientLogger(ClusterJobsImpl.class); + + private final ClusterJobsClient innerClient; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + public ClusterJobsImpl( + ClusterJobsClient innerClient, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ClusterJob runJob( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterJobInner clusterJob) { + ClusterJobInner inner = + this.serviceClient().runJob(resourceGroupName, clusterPoolName, clusterName, clusterJob); + if (inner != null) { + return new ClusterJobImpl(inner, this.manager()); + } else { + return null; + } + } + + public ClusterJob runJob( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterJobInner clusterJob, + Context context) { + ClusterJobInner inner = + this.serviceClient().runJob(resourceGroupName, clusterPoolName, clusterName, clusterJob, context); + if (inner != null) { + return new ClusterJobImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterPoolName, clusterName); + return Utils.mapPage(inner, inner1 -> new ClusterJobImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, clusterPoolName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new ClusterJobImpl(inner1, this.manager())); + } + + private ClusterJobsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolImpl.java new file mode 100644 index 000000000000..2ca774a42e6a --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolImpl.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPool; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesAksClusterProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesClusterPoolProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesComputeProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesLogAnalyticsProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolResourcePropertiesNetworkProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ProvisioningStatus; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.TagsObject; +import java.util.Collections; +import java.util.Map; + +public final class ClusterPoolImpl implements ClusterPool, ClusterPool.Definition, ClusterPool.Update { + private ClusterPoolInner innerObject; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + 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 ProvisioningStatus provisioningState() { + return this.innerModel().provisioningState(); + } + + public String deploymentId() { + return this.innerModel().deploymentId(); + } + + public String managedResourceGroupName() { + return this.innerModel().managedResourceGroupName(); + } + + public String aksManagedResourceGroupName() { + return this.innerModel().aksManagedResourceGroupName(); + } + + public ClusterPoolResourcePropertiesClusterPoolProfile clusterPoolProfile() { + return this.innerModel().clusterPoolProfile(); + } + + public ClusterPoolResourcePropertiesComputeProfile computeProfile() { + return this.innerModel().computeProfile(); + } + + public ClusterPoolResourcePropertiesAksClusterProfile aksClusterProfile() { + return this.innerModel().aksClusterProfile(); + } + + public ClusterPoolResourcePropertiesNetworkProfile networkProfile() { + return this.innerModel().networkProfile(); + } + + public ClusterPoolResourcePropertiesLogAnalyticsProfile logAnalyticsProfile() { + return this.innerModel().logAnalyticsProfile(); + } + + public String status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ClusterPoolInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterPoolName; + + private TagsObject updateClusterPoolTags; + + public ClusterPoolImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ClusterPool create() { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPools() + .createOrUpdate(resourceGroupName, clusterPoolName, this.innerModel(), Context.NONE); + return this; + } + + public ClusterPool create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPools() + .createOrUpdate(resourceGroupName, clusterPoolName, this.innerModel(), context); + return this; + } + + ClusterPoolImpl( + String name, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerObject = new ClusterPoolInner(); + this.serviceManager = serviceManager; + this.clusterPoolName = name; + } + + public ClusterPoolImpl update() { + this.updateClusterPoolTags = new TagsObject(); + return this; + } + + public ClusterPool apply() { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPools() + .updateTags(resourceGroupName, clusterPoolName, updateClusterPoolTags, Context.NONE); + return this; + } + + public ClusterPool apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPools() + .updateTags(resourceGroupName, clusterPoolName, updateClusterPoolTags, context); + return this; + } + + ClusterPoolImpl( + ClusterPoolInner innerObject, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterPoolName = Utils.getValueFromIdByName(innerObject.id(), "clusterpools"); + } + + public ClusterPool refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPools() + .getByResourceGroupWithResponse(resourceGroupName, clusterPoolName, Context.NONE) + .getValue(); + return this; + } + + public ClusterPool refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusterPools() + .getByResourceGroupWithResponse(resourceGroupName, clusterPoolName, context) + .getValue(); + return this; + } + + public ClusterPoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ClusterPoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ClusterPoolImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateClusterPoolTags.withTags(tags); + return this; + } + } + + public ClusterPoolImpl withManagedResourceGroupName(String managedResourceGroupName) { + this.innerModel().withManagedResourceGroupName(managedResourceGroupName); + return this; + } + + public ClusterPoolImpl withClusterPoolProfile(ClusterPoolResourcePropertiesClusterPoolProfile clusterPoolProfile) { + this.innerModel().withClusterPoolProfile(clusterPoolProfile); + return this; + } + + public ClusterPoolImpl withComputeProfile(ClusterPoolResourcePropertiesComputeProfile computeProfile) { + this.innerModel().withComputeProfile(computeProfile); + return this; + } + + public ClusterPoolImpl withNetworkProfile(ClusterPoolResourcePropertiesNetworkProfile networkProfile) { + this.innerModel().withNetworkProfile(networkProfile); + return this; + } + + public ClusterPoolImpl withLogAnalyticsProfile( + ClusterPoolResourcePropertiesLogAnalyticsProfile logAnalyticsProfile) { + this.innerModel().withLogAnalyticsProfile(logAnalyticsProfile); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolVersionImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolVersionImpl.java new file mode 100644 index 000000000000..fe60dfe94ac9 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolVersionImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.implementation; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolVersionInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolVersion; + +public final class ClusterPoolVersionImpl implements ClusterPoolVersion { + private ClusterPoolVersionInner innerObject; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + ClusterPoolVersionImpl( + ClusterPoolVersionInner innerObject, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager 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 clusterPoolVersion() { + return this.innerModel().clusterPoolVersion(); + } + + public String aksVersion() { + return this.innerModel().aksVersion(); + } + + public Boolean isPreview() { + return this.innerModel().isPreview(); + } + + public ClusterPoolVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolsClientImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolsClientImpl.java new file mode 100644 index 000000000000..d8d70bcfcef3 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolsClientImpl.java @@ -0,0 +1,1547 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.ClusterPoolsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPoolListResult; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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 ClusterPoolsClient. */ +public final class ClusterPoolsClientImpl implements ClusterPoolsClient { + /** The proxy service used to perform REST calls. */ + private final ClusterPoolsService service; + + /** The service client containing this operation class. */ + private final HDInsightOnAksManagementClientImpl client; + + /** + * Initializes an instance of ClusterPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClusterPoolsClientImpl(HDInsightOnAksManagementClientImpl client) { + this.service = + RestProxy.create(ClusterPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightOnAksManagementClientClusterPools to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightOnAksManage") + public interface ClusterPoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @BodyParam("application/json") ClusterPoolInner clusterPool, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTags( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("clusterPoolName") String clusterPoolName, + @BodyParam("application/json") TagsObject clusterPoolTags, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusterpools") + @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.HDInsight/clusterpools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @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 cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 cluster pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterPoolName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 a cluster pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterPoolName, 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + accept, + context); + } + + /** + * Gets a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 cluster pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterPoolName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 a cluster pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterPoolName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterPoolName, context).block(); + } + + /** + * Gets a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPoolInner getByResourceGroup(String resourceGroupName, String clusterPoolName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterPoolName, Context.NONE).getValue(); + } + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterPool == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterPool is required and cannot be null.")); + } else { + clusterPool.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterPool, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool, 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterPool == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterPool is required and cannot be null.")); + } else { + clusterPool.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterPool, + accept, + context); + } + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterPoolName, clusterPool); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterPoolInner.class, + ClusterPoolInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterPoolInner> beginCreateOrUpdateAsync( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, clusterPoolName, clusterPool, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterPoolInner.class, ClusterPoolInner.class, context); + } + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterPoolInner> beginCreateOrUpdate( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool) { + return this.beginCreateOrUpdateAsync(resourceGroupName, clusterPoolName, clusterPool).getSyncPoller(); + } + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterPoolInner> beginCreateOrUpdate( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, clusterPoolName, clusterPool, context).getSyncPoller(); + } + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterPoolName, clusterPool) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, clusterPoolName, clusterPool, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPoolInner createOrUpdate( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool) { + return createOrUpdateAsync(resourceGroupName, clusterPoolName, clusterPool).block(); + } + + /** + * Creates or updates a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPool The Cluster Pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPoolInner createOrUpdate( + String resourceGroupName, String clusterPoolName, ClusterPoolInner clusterPool, Context context) { + return createOrUpdateAsync(resourceGroupName, clusterPoolName, clusterPool, context).block(); + } + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterPoolTags == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolTags is required and cannot be null.")); + } else { + clusterPoolTags.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + clusterPoolName, + clusterPoolTags, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateTagsWithResponseAsync( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterPoolTags == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolTags is required and cannot be null.")); + } else { + clusterPoolTags.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateTags( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + clusterPoolName, + clusterPoolTags, + accept, + context); + } + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterPoolInner> beginUpdateTagsAsync( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags) { + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, clusterPoolName, clusterPoolTags); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ClusterPoolInner.class, + ClusterPoolInner.class, + this.client.getContext()); + } + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterPoolInner> beginUpdateTagsAsync( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateTagsWithResponseAsync(resourceGroupName, clusterPoolName, clusterPoolTags, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterPoolInner.class, ClusterPoolInner.class, context); + } + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterPoolInner> beginUpdateTags( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags) { + return this.beginUpdateTagsAsync(resourceGroupName, clusterPoolName, clusterPoolTags).getSyncPoller(); + } + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 cluster pool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterPoolInner> beginUpdateTags( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags, Context context) { + return this.beginUpdateTagsAsync(resourceGroupName, clusterPoolName, clusterPoolTags, context).getSyncPoller(); + } + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags) { + return beginUpdateTagsAsync(resourceGroupName, clusterPoolName, clusterPoolTags) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateTagsAsync( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags, Context context) { + return beginUpdateTagsAsync(resourceGroupName, clusterPoolName, clusterPoolTags, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPoolInner updateTags(String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags) { + return updateTagsAsync(resourceGroupName, clusterPoolName, clusterPoolTags).block(); + } + + /** + * Updates an existing Cluster Pool Tags. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterPoolTags Parameters supplied to update tags. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterPoolInner updateTags( + String resourceGroupName, String clusterPoolName, TagsObject clusterPoolTags, Context context) { + return updateTagsAsync(resourceGroupName, clusterPoolName, clusterPoolTags, context).block(); + } + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterPoolName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterPoolName, 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + accept, + context); + } + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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, Void> beginDeleteAsync(String resourceGroupName, String clusterPoolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterPoolName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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, Void> beginDeleteAsync( + String resourceGroupName, String clusterPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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, Void> beginDelete(String resourceGroupName, String clusterPoolName) { + return this.beginDeleteAsync(resourceGroupName, clusterPoolName).getSyncPoller(); + } + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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, Void> beginDelete( + String resourceGroupName, String clusterPoolName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterPoolName, context).getSyncPoller(); + } + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 clusterPoolName) { + return beginDeleteAsync(resourceGroupName, clusterPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 clusterPoolName) { + deleteAsync(resourceGroupName, clusterPoolName).block(); + } + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterPoolName, Context context) { + deleteAsync(resourceGroupName, clusterPoolName, context).block(); + } + + /** + * Gets the list of Cluster Pools within a 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 the list of Cluster Pools within a 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + 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 the list of Cluster Pools within a 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 the list of Cluster Pools within a 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets the list of Cluster Pools within a 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 the list of Cluster Pools within a Subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets the list of Cluster Pools within a 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 the list of Cluster Pools within a Subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the list of Cluster Pools within a 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 the list of Cluster Pools within a Subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets the list of Cluster Pools within a 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 the list of Cluster Pools within a Subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Lists the HDInsight cluster pools under a 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 list cluster pools operation response 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + 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 the HDInsight cluster pools under a 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 list cluster pools operation response 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the HDInsight cluster pools under a 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 list cluster pools operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists the HDInsight cluster pools under a 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 list cluster pools operation response 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 the HDInsight cluster pools under a 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 list cluster pools operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists the HDInsight cluster pools under a 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 list cluster pools operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 list cluster pools operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 list cluster pools operation response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 list cluster pools operation response 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 URL to get the next list of items + *

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 list cluster pools operation response 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolsImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolsImpl.java new file mode 100644 index 000000000000..82754e6de45d --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterPoolsImpl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.ClusterPoolsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPool; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPools; + +public final class ClusterPoolsImpl implements ClusterPools { + private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolsImpl.class); + + private final ClusterPoolsClient innerClient; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + public ClusterPoolsImpl( + ClusterPoolsClient innerClient, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterPoolName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ClusterPool getByResourceGroup(String resourceGroupName, String clusterPoolName) { + ClusterPoolInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterPoolName); + if (inner != null) { + return new ClusterPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String clusterPoolName) { + this.serviceClient().delete(resourceGroupName, clusterPoolName); + } + + public void delete(String resourceGroupName, String clusterPoolName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterPoolName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ClusterPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ClusterPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ClusterPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ClusterPoolImpl(inner1, this.manager())); + } + + public ClusterPool 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 clusterPoolName = Utils.getValueFromIdByName(id, "clusterpools"); + if (clusterPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusterpools'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterPoolName, 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 clusterPoolName = Utils.getValueFromIdByName(id, "clusterpools"); + if (clusterPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusterpools'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, clusterPoolName, 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 clusterPoolName = Utils.getValueFromIdByName(id, "clusterpools"); + if (clusterPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusterpools'.", id))); + } + this.delete(resourceGroupName, clusterPoolName, 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 clusterPoolName = Utils.getValueFromIdByName(id, "clusterpools"); + if (clusterPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusterpools'.", id))); + } + this.delete(resourceGroupName, clusterPoolName, context); + } + + private ClusterPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } + + public ClusterPoolImpl define(String name) { + return new ClusterPoolImpl(name, this.manager()); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterVersionImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterVersionImpl.java new file mode 100644 index 000000000000..774efae80b87 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClusterVersionImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.implementation; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterVersionInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterComponentsItem; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterVersion; +import java.util.Collections; +import java.util.List; + +public final class ClusterVersionImpl implements ClusterVersion { + private ClusterVersionInner innerObject; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + ClusterVersionImpl( + ClusterVersionInner innerObject, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager 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 clusterType() { + return this.innerModel().clusterType(); + } + + public String clusterVersion() { + return this.innerModel().clusterVersion(); + } + + public String ossVersion() { + return this.innerModel().ossVersion(); + } + + public String clusterPoolVersion() { + return this.innerModel().clusterPoolVersion(); + } + + public Boolean isPreview() { + return this.innerModel().isPreview(); + } + + public List components() { + List inner = this.innerModel().components(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ClusterVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClustersClientImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClustersClientImpl.java new file mode 100644 index 000000000000..9ebff44059ad --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClustersClientImpl.java @@ -0,0 +1,2551 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.ClustersClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInstanceViewResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ServiceConfigResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterInstanceViewsResult; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterListResult; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPatch; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterResizeData; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ServiceConfigListResult; +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 ClustersClient. */ +public final class ClustersClientImpl implements ClustersClient { + /** The proxy service used to perform REST calls. */ + private final ClustersService service; + + /** The service client containing this operation class. */ + private final HDInsightOnAksManagementClientImpl client; + + /** + * Initializes an instance of ClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClustersClientImpl(HDInsightOnAksManagementClientImpl client) { + this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightOnAksManagementClientClusters to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightOnAksManage") + public interface ClustersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterPoolName( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/resize") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resize( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterResizeData clusterResizeRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterInner hDInsightCluster, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterPatch clusterPatchRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/serviceConfigs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listServiceConfigs( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/instanceViews") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listInstanceViews( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusterpools/{clusterPoolName}/clusters/{clusterName}/instanceViews/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getInstanceView( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("clusterPoolName") String clusterPoolName, + @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterPoolNameNext( + @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> listServiceConfigsNext( + @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> listInstanceViewsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the HDInsight cluster pools under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 list cluster operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterPoolNameSinglePageAsync( + String resourceGroupName, String clusterPoolName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByClusterPoolName( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + 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 the HDInsight cluster pools under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 list cluster operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterPoolNameSinglePageAsync( + String resourceGroupName, String clusterPoolName, 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByClusterPoolName( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the HDInsight cluster pools under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 list cluster operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterPoolNameAsync(String resourceGroupName, String clusterPoolName) { + return new PagedFlux<>( + () -> listByClusterPoolNameSinglePageAsync(resourceGroupName, clusterPoolName), + nextLink -> listByClusterPoolNameNextSinglePageAsync(nextLink)); + } + + /** + * Lists the HDInsight cluster pools under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 list cluster operation response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterPoolNameAsync( + String resourceGroupName, String clusterPoolName, Context context) { + return new PagedFlux<>( + () -> listByClusterPoolNameSinglePageAsync(resourceGroupName, clusterPoolName, context), + nextLink -> listByClusterPoolNameNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the HDInsight cluster pools under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 list cluster operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByClusterPoolName(String resourceGroupName, String clusterPoolName) { + return new PagedIterable<>(listByClusterPoolNameAsync(resourceGroupName, clusterPoolName)); + } + + /** + * Lists the HDInsight cluster pools under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 list cluster operation response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByClusterPoolName( + String resourceGroupName, String clusterPoolName, Context context) { + return new PagedIterable<>(listByClusterPoolNameAsync(resourceGroupName, clusterPoolName, context)); + } + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resizeWithResponseAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterResizeData clusterResizeRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterResizeRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResizeRequest is required and cannot be null.")); + } else { + clusterResizeRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resize( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + clusterPoolName, + clusterName, + clusterResizeRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resizeWithResponseAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterResizeData clusterResizeRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterResizeRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterResizeRequest is required and cannot be null.")); + } else { + clusterResizeRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resize( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + clusterPoolName, + clusterName, + clusterResizeRequest, + accept, + context); + } + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginResizeAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterResizeData clusterResizeRequest) { + Mono>> mono = + resizeWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginResizeAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterResizeData clusterResizeRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resizeWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginResize( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterResizeData clusterResizeRequest) { + return this + .beginResizeAsync(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest) + .getSyncPoller(); + } + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginResize( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterResizeData clusterResizeRequest, + Context context) { + return this + .beginResizeAsync(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, context) + .getSyncPoller(); + } + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resizeAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterResizeData clusterResizeRequest) { + return beginResizeAsync(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resizeAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterResizeData clusterResizeRequest, + Context context) { + return beginResizeAsync(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner resize( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterResizeData clusterResizeRequest) { + return resizeAsync(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest).block(); + } + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner resize( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterResizeData clusterResizeRequest, + Context context) { + return resizeAsync(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, context).block(); + } + + /** + * Gets a HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 HDInsight cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterPoolName, String clusterName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 HDInsight cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + accept, + context); + } + + /** + * Gets a HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 HDInsight cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterPoolName, String clusterName) { + return getWithResponseAsync(resourceGroupName, clusterPoolName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 HDInsight cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, context).block(); + } + + /** + * Gets a HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner get(String resourceGroupName, String clusterPoolName, String clusterName) { + return getWithResponse(resourceGroupName, clusterPoolName, clusterName, Context.NONE).getValue(); + } + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterInner hDInsightCluster) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (hDInsightCluster == null) { + return Mono + .error(new IllegalArgumentException("Parameter hDInsightCluster is required and cannot be null.")); + } else { + hDInsightCluster.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + hDInsightCluster, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterInner hDInsightCluster, + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (hDInsightCluster == null) { + return Mono + .error(new IllegalArgumentException("Parameter hDInsightCluster is required and cannot be null.")); + } else { + hDInsightCluster.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + hDInsightCluster, + accept, + context); + } + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginCreateAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterInner hDInsightCluster) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, hDInsightCluster); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginCreateAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterInner hDInsightCluster, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, hDInsightCluster, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginCreate( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterInner hDInsightCluster) { + return this.beginCreateAsync(resourceGroupName, clusterPoolName, clusterName, hDInsightCluster).getSyncPoller(); + } + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginCreate( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterInner hDInsightCluster, + Context context) { + return this + .beginCreateAsync(resourceGroupName, clusterPoolName, clusterName, hDInsightCluster, context) + .getSyncPoller(); + } + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterInner hDInsightCluster) { + return beginCreateAsync(resourceGroupName, clusterPoolName, clusterName, hDInsightCluster) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterInner hDInsightCluster, + Context context) { + return beginCreateAsync(resourceGroupName, clusterPoolName, clusterName, hDInsightCluster, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner create( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterInner hDInsightCluster) { + return createAsync(resourceGroupName, clusterPoolName, clusterName, hDInsightCluster).block(); + } + + /** + * Creates a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param hDInsightCluster The cluster to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner create( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterInner hDInsightCluster, + Context context) { + return createAsync(resourceGroupName, clusterPoolName, clusterName, hDInsightCluster, context).block(); + } + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterPatch clusterPatchRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterPatchRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPatchRequest is required and cannot be null.")); + } else { + clusterPatchRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + clusterPoolName, + clusterName, + clusterPatchRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 cluster along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterPatch clusterPatchRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (clusterPatchRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPatchRequest is required and cannot be null.")); + } else { + clusterPatchRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + clusterPoolName, + clusterName, + clusterPatchRequest, + accept, + context); + } + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterPatch clusterPatchRequest) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, clusterPatchRequest); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, this.client.getContext()); + } + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterInner> beginUpdateAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterPatch clusterPatchRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, clusterPatchRequest, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterPatch clusterPatchRequest) { + return this + .beginUpdateAsync(resourceGroupName, clusterPoolName, clusterName, clusterPatchRequest) + .getSyncPoller(); + } + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 the cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterInner> beginUpdate( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterPatch clusterPatchRequest, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, clusterPoolName, clusterName, clusterPatchRequest, context) + .getSyncPoller(); + } + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterPatch clusterPatchRequest) { + return beginUpdateAsync(resourceGroupName, clusterPoolName, clusterName, clusterPatchRequest) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterPatch clusterPatchRequest, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterPoolName, clusterName, clusterPatchRequest, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterPatch clusterPatchRequest) { + return updateAsync(resourceGroupName, clusterPoolName, clusterName, clusterPatchRequest).block(); + } + + /** + * Updates an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterPatchRequest Patch a 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 cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterPatch clusterPatchRequest, + Context context) { + return updateAsync(resourceGroupName, clusterPoolName, clusterName, clusterPatchRequest, context).block(); + } + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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>> deleteWithResponseAsync( + String resourceGroupName, String clusterPoolName, String clusterName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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>> deleteWithResponseAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + accept, + context); + } + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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> beginDeleteAsync( + String resourceGroupName, String clusterPoolName, String clusterName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterPoolName, clusterName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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> beginDeleteAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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> beginDelete( + String resourceGroupName, String clusterPoolName, String clusterName) { + return this.beginDeleteAsync(resourceGroupName, clusterPoolName, clusterName).getSyncPoller(); + } + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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> beginDelete( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterPoolName, clusterName, context).getSyncPoller(); + } + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 deleteAsync(String resourceGroupName, String clusterPoolName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterPoolName, clusterName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 deleteAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterPoolName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 delete(String resourceGroupName, String clusterPoolName, String clusterName) { + deleteAsync(resourceGroupName, clusterPoolName, clusterName).block(); + } + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 delete(String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterPoolName, clusterName, context).block(); + } + + /** + * Lists the config dump of all services running in cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 cluster instance service configs api response along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceConfigsSinglePageAsync( + String resourceGroupName, String clusterPoolName, String clusterName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listServiceConfigs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + 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 the config dump of all services running in cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 cluster instance service configs api response along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceConfigsSinglePageAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listServiceConfigs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the config dump of all services running in cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 cluster instance service configs api response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listServiceConfigsAsync( + String resourceGroupName, String clusterPoolName, String clusterName) { + return new PagedFlux<>( + () -> listServiceConfigsSinglePageAsync(resourceGroupName, clusterPoolName, clusterName), + nextLink -> listServiceConfigsNextSinglePageAsync(nextLink)); + } + + /** + * Lists the config dump of all services running in cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 cluster instance service configs api response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listServiceConfigsAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listServiceConfigsSinglePageAsync(resourceGroupName, clusterPoolName, clusterName, context), + nextLink -> listServiceConfigsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the config dump of all services running in cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 cluster instance service configs api response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listServiceConfigs( + String resourceGroupName, String clusterPoolName, String clusterName) { + return new PagedIterable<>(listServiceConfigsAsync(resourceGroupName, clusterPoolName, clusterName)); + } + + /** + * Lists the config dump of all services running in cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 cluster instance service configs api response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listServiceConfigs( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + return new PagedIterable<>(listServiceConfigsAsync(resourceGroupName, clusterPoolName, clusterName, context)); + } + + /** + * Lists the lists of instance views. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 instance view of a HDInsight Cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listInstanceViewsSinglePageAsync( + String resourceGroupName, String clusterPoolName, String clusterName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listInstanceViews( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + 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 the lists of instance views. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 instance view of a HDInsight Cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listInstanceViewsSinglePageAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listInstanceViews( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the lists of instance views. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 instance view of a HDInsight Cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listInstanceViewsAsync( + String resourceGroupName, String clusterPoolName, String clusterName) { + return new PagedFlux<>( + () -> listInstanceViewsSinglePageAsync(resourceGroupName, clusterPoolName, clusterName), + nextLink -> listInstanceViewsNextSinglePageAsync(nextLink)); + } + + /** + * Lists the lists of instance views. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 instance view of a HDInsight Cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listInstanceViewsAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listInstanceViewsSinglePageAsync(resourceGroupName, clusterPoolName, clusterName, context), + nextLink -> listInstanceViewsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the lists of instance views. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 instance view of a HDInsight Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listInstanceViews( + String resourceGroupName, String clusterPoolName, String clusterName) { + return new PagedIterable<>(listInstanceViewsAsync(resourceGroupName, clusterPoolName, clusterName)); + } + + /** + * Lists the lists of instance views. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 instance view of a HDInsight Cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listInstanceViews( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + return new PagedIterable<>(listInstanceViewsAsync(resourceGroupName, clusterPoolName, clusterName, context)); + } + + /** + * Gets the status of a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 status of a cluster instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String clusterPoolName, String clusterName) { + 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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getInstanceView( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 status of a cluster instance along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getInstanceViewWithResponseAsync( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (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 (clusterPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter clusterPoolName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getInstanceView( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + clusterPoolName, + clusterName, + accept, + context); + } + + /** + * Gets the status of a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 status of a cluster instance on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getInstanceViewAsync( + String resourceGroupName, String clusterPoolName, String clusterName) { + return getInstanceViewWithResponseAsync(resourceGroupName, clusterPoolName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the status of a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 status of a cluster instance along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getInstanceViewWithResponse( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + return getInstanceViewWithResponseAsync(resourceGroupName, clusterPoolName, clusterName, context).block(); + } + + /** + * Gets the status of a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 status of a cluster instance. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInstanceViewResultInner getInstanceView( + String resourceGroupName, String clusterPoolName, String clusterName) { + return getInstanceViewWithResponse(resourceGroupName, clusterPoolName, clusterName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 list cluster operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterPoolNameNextSinglePageAsync(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.listByClusterPoolNameNext(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 URL to get the next list of items + *

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 list cluster operation response along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterPoolNameNextSinglePageAsync( + 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 + .listByClusterPoolNameNext(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 URL to get the next list of items + *

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 cluster instance service configs api response along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceConfigsNextSinglePageAsync(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.listServiceConfigsNext(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 URL to get the next list of items + *

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 cluster instance service configs api response along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listServiceConfigsNextSinglePageAsync( + 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 + .listServiceConfigsNext(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 URL to get the next list of items + *

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 instance view of a HDInsight Cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listInstanceViewsNextSinglePageAsync(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.listInstanceViewsNext(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 URL to get the next list of items + *

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 instance view of a HDInsight Cluster along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listInstanceViewsNextSinglePageAsync( + 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 + .listInstanceViewsNext(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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClustersImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClustersImpl.java new file mode 100644 index 000000000000..49b4027c827e --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ClustersImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.ClustersClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInstanceViewResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ServiceConfigResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Cluster; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterInstanceViewResult; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterResizeData; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Clusters; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ServiceConfigResult; + +public final class ClustersImpl implements Clusters { + private static final ClientLogger LOGGER = new ClientLogger(ClustersImpl.class); + + private final ClustersClient innerClient; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + public ClustersImpl( + ClustersClient innerClient, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByClusterPoolName(String resourceGroupName, String clusterPoolName) { + PagedIterable inner = + this.serviceClient().listByClusterPoolName(resourceGroupName, clusterPoolName); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByClusterPoolName( + String resourceGroupName, String clusterPoolName, Context context) { + PagedIterable inner = + this.serviceClient().listByClusterPoolName(resourceGroupName, clusterPoolName, context); + return Utils.mapPage(inner, inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public Cluster resize( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterResizeData clusterResizeRequest) { + ClusterInner inner = + this.serviceClient().resize(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Cluster resize( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterResizeData clusterResizeRequest, + Context context) { + ClusterInner inner = + this.serviceClient().resize(resourceGroupName, clusterPoolName, clusterName, clusterResizeRequest, context); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterPoolName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Cluster get(String resourceGroupName, String clusterPoolName, String clusterName) { + ClusterInner inner = this.serviceClient().get(resourceGroupName, clusterPoolName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterPoolName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterPoolName, clusterName); + } + + public void delete(String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterPoolName, clusterName, context); + } + + public PagedIterable listServiceConfigs( + String resourceGroupName, String clusterPoolName, String clusterName) { + PagedIterable inner = + this.serviceClient().listServiceConfigs(resourceGroupName, clusterPoolName, clusterName); + return Utils.mapPage(inner, inner1 -> new ServiceConfigResultImpl(inner1, this.manager())); + } + + public PagedIterable listServiceConfigs( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listServiceConfigs(resourceGroupName, clusterPoolName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new ServiceConfigResultImpl(inner1, this.manager())); + } + + public PagedIterable listInstanceViews( + String resourceGroupName, String clusterPoolName, String clusterName) { + PagedIterable inner = + this.serviceClient().listInstanceViews(resourceGroupName, clusterPoolName, clusterName); + return Utils.mapPage(inner, inner1 -> new ClusterInstanceViewResultImpl(inner1, this.manager())); + } + + public PagedIterable listInstanceViews( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listInstanceViews(resourceGroupName, clusterPoolName, clusterName, context); + return Utils.mapPage(inner, inner1 -> new ClusterInstanceViewResultImpl(inner1, this.manager())); + } + + public Response getInstanceViewWithResponse( + String resourceGroupName, String clusterPoolName, String clusterName, Context context) { + Response inner = + this.serviceClient().getInstanceViewWithResponse(resourceGroupName, clusterPoolName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterInstanceViewResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ClusterInstanceViewResult getInstanceView( + String resourceGroupName, String clusterPoolName, String clusterName) { + ClusterInstanceViewResultInner inner = + this.serviceClient().getInstanceView(resourceGroupName, clusterPoolName, clusterName); + if (inner != null) { + return new ClusterInstanceViewResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Cluster 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 clusterPoolName = Utils.getValueFromIdByName(id, "clusterpools"); + if (clusterPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusterpools'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterPoolName, clusterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterPoolName = Utils.getValueFromIdByName(id, "clusterpools"); + if (clusterPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusterpools'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterPoolName, clusterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterPoolName = Utils.getValueFromIdByName(id, "clusterpools"); + if (clusterPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusterpools'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterPoolName, clusterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterPoolName = Utils.getValueFromIdByName(id, "clusterpools"); + if (clusterPoolName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusterpools'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + this.delete(resourceGroupName, clusterPoolName, clusterName, context); + } + + private ClustersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } + + public ClusterImpl define(String name) { + return new ClusterImpl(name, this.manager()); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/HDInsightOnAksManagementClientBuilder.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/HDInsightOnAksManagementClientBuilder.java new file mode 100644 index 000000000000..e1f9594bbb73 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/HDInsightOnAksManagementClientBuilder.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.hdinsightmicrosofthdinsighthdinsightonaks.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 HDInsightOnAksManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {HDInsightOnAksManagementClientImpl.class}) +public final class HDInsightOnAksManagementClientBuilder { + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the HDInsightOnAksManagementClientBuilder. + */ + public HDInsightOnAksManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the HDInsightOnAksManagementClientBuilder. + */ + public HDInsightOnAksManagementClientBuilder 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 HDInsightOnAksManagementClientBuilder. + */ + public HDInsightOnAksManagementClientBuilder 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 HDInsightOnAksManagementClientBuilder. + */ + public HDInsightOnAksManagementClientBuilder 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 HDInsightOnAksManagementClientBuilder. + */ + public HDInsightOnAksManagementClientBuilder 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 HDInsightOnAksManagementClientBuilder. + */ + public HDInsightOnAksManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of HDInsightOnAksManagementClientImpl with the provided parameters. + * + * @return an instance of HDInsightOnAksManagementClientImpl. + */ + public HDInsightOnAksManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + HDInsightOnAksManagementClientImpl client = + new HDInsightOnAksManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/HDInsightOnAksManagementClientImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/HDInsightOnAksManagementClientImpl.java new file mode 100644 index 000000000000..a02f7165466b --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/HDInsightOnAksManagementClientImpl.java @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.CoreUtils; +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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.AvailableClusterPoolVersionsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.AvailableClusterVersionsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.ClusterJobsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.ClusterPoolsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.ClustersClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.HDInsightOnAksManagementClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.LocationsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.OperationsClient; +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 reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the HDInsightOnAksManagementClientImpl type. */ +@ServiceClient(builder = HDInsightOnAksManagementClientBuilder.class) +public final class HDInsightOnAksManagementClientImpl implements HDInsightOnAksManagementClient { + /** The ID of the target subscription. The value must be an UUID. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @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; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * 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 ClusterPoolsClient object to access its operations. */ + private final ClusterPoolsClient clusterPools; + + /** + * Gets the ClusterPoolsClient object to access its operations. + * + * @return the ClusterPoolsClient object. + */ + public ClusterPoolsClient getClusterPools() { + return this.clusterPools; + } + + /** The ClustersClient object to access its operations. */ + private final ClustersClient clusters; + + /** + * Gets the ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + public ClustersClient getClusters() { + return this.clusters; + } + + /** The ClusterJobsClient object to access its operations. */ + private final ClusterJobsClient clusterJobs; + + /** + * Gets the ClusterJobsClient object to access its operations. + * + * @return the ClusterJobsClient object. + */ + public ClusterJobsClient getClusterJobs() { + return this.clusterJobs; + } + + /** The LocationsClient object to access its operations. */ + private final LocationsClient locations; + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + public LocationsClient getLocations() { + return this.locations; + } + + /** 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 AvailableClusterPoolVersionsClient object to access its operations. */ + private final AvailableClusterPoolVersionsClient availableClusterPoolVersions; + + /** + * Gets the AvailableClusterPoolVersionsClient object to access its operations. + * + * @return the AvailableClusterPoolVersionsClient object. + */ + public AvailableClusterPoolVersionsClient getAvailableClusterPoolVersions() { + return this.availableClusterPoolVersions; + } + + /** The AvailableClusterVersionsClient object to access its operations. */ + private final AvailableClusterVersionsClient availableClusterVersions; + + /** + * Gets the AvailableClusterVersionsClient object to access its operations. + * + * @return the AvailableClusterVersionsClient object. + */ + public AvailableClusterVersionsClient getAvailableClusterVersions() { + return this.availableClusterVersions; + } + + /** + * Initializes an instance of HDInsightOnAksManagementClient 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 The ID of the target subscription. The value must be an UUID. + * @param endpoint server parameter. + */ + HDInsightOnAksManagementClientImpl( + 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.apiVersion = "2023-06-01-preview"; + this.clusterPools = new ClusterPoolsClientImpl(this); + this.clusters = new ClustersClientImpl(this); + this.clusterJobs = new ClusterJobsClientImpl(this); + this.locations = new LocationsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.availableClusterPoolVersions = new AvailableClusterPoolVersionsClientImpl(this); + this.availableClusterVersions = new AvailableClusterVersionsClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), 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(HDInsightOnAksManagementClientImpl.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/LocationsClientImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/LocationsClientImpl.java new file mode 100644 index 000000000000..45f7cf9a754c --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/LocationsClientImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.LocationsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.NameAvailabilityResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.NameAvailabilityParameters; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public final class LocationsClientImpl implements LocationsClient { + /** The proxy service used to perform REST calls. */ + private final LocationsService service; + + /** The service client containing this operation class. */ + private final HDInsightOnAksManagementClientImpl client; + + /** + * Initializes an instance of LocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationsClientImpl(HDInsightOnAksManagementClientImpl client) { + this.service = + RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightOnAksManagementClientLocations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightOnAksManage") + public interface LocationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @PathParam("location") String location, + @BodyParam("application/json") NameAvailabilityParameters nameAvailabilityParameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check the availability of the resource name. + * + * @param location The name of the Azure region. + * @param nameAvailabilityParameters The name and type of the 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 result of check name availability along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityParameters nameAvailabilityParameters) { + 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.")); + } + if (nameAvailabilityParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter nameAvailabilityParameters is required and cannot be null.")); + } else { + nameAvailabilityParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + location, + nameAvailabilityParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the availability of the resource name. + * + * @param location The name of the Azure region. + * @param nameAvailabilityParameters The name and type of the 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 result of check name availability along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityParameters nameAvailabilityParameters, 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.")); + } + if (nameAvailabilityParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter nameAvailabilityParameters is required and cannot be null.")); + } else { + nameAvailabilityParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + location, + nameAvailabilityParameters, + accept, + context); + } + + /** + * Check the availability of the resource name. + * + * @param location The name of the Azure region. + * @param nameAvailabilityParameters The name and type of the 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 result of check name availability on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String location, NameAvailabilityParameters nameAvailabilityParameters) { + return checkNameAvailabilityWithResponseAsync(location, nameAvailabilityParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the availability of the resource name. + * + * @param location The name of the Azure region. + * @param nameAvailabilityParameters The name and type of the 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 result of check name availability along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters nameAvailabilityParameters, Context context) { + return checkNameAvailabilityWithResponseAsync(location, nameAvailabilityParameters, context).block(); + } + + /** + * Check the availability of the resource name. + * + * @param location The name of the Azure region. + * @param nameAvailabilityParameters The name and type of the 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 result of check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityResultInner checkNameAvailability( + String location, NameAvailabilityParameters nameAvailabilityParameters) { + return checkNameAvailabilityWithResponse(location, nameAvailabilityParameters, Context.NONE).getValue(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/LocationsImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/LocationsImpl.java new file mode 100644 index 000000000000..c4d6064609f1 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/LocationsImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.LocationsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.NameAvailabilityResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Locations; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.NameAvailabilityParameters; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.NameAvailabilityResult; + +public final class LocationsImpl implements Locations { + private static final ClientLogger LOGGER = new ClientLogger(LocationsImpl.class); + + private final LocationsClient innerClient; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + public LocationsImpl( + LocationsClient innerClient, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters nameAvailabilityParameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(location, nameAvailabilityParameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NameAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NameAvailabilityResult checkNameAvailability( + String location, NameAvailabilityParameters nameAvailabilityParameters) { + NameAvailabilityResultInner inner = + this.serviceClient().checkNameAvailability(location, nameAvailabilityParameters); + if (inner != null) { + return new NameAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private LocationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/NameAvailabilityResultImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/NameAvailabilityResultImpl.java new file mode 100644 index 000000000000..1612f6cd2dd1 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/NameAvailabilityResultImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.implementation; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.NameAvailabilityResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.NameAvailabilityResult; + +public final class NameAvailabilityResultImpl implements NameAvailabilityResult { + private NameAvailabilityResultInner innerObject; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + NameAvailabilityResultImpl( + NameAvailabilityResultInner innerObject, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public NameAvailabilityResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/OperationImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/OperationImpl.java new file mode 100644 index 000000000000..e2f6094d9237 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/OperationImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.implementation; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.OperationInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ActionType; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Operation; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.OperationDisplay; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + OperationImpl( + OperationInner innerObject, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/OperationsClientImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..bcd2b9e8d77a --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/OperationsClientImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.OperationsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.OperationInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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 HDInsightOnAksManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(HDInsightOnAksManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightOnAksManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightOnAksManage") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.HDInsight/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns 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 REST API operations supported by an Azure Resource Provider 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), 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())); + } + + /** + * Returns 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 REST API operations supported by an Azure Resource Provider 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 a list of REST API operations supported by an Azure Resource Provider 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 URL to get the next list of items + *

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 a list of REST API operations supported by an Azure Resource Provider 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/OperationsImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/OperationsImpl.java new file mode 100644 index 000000000000..140d04d1d5ec --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/OperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.fluent.OperationsClient; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.OperationInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Operation; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ServiceConfigResultImpl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ServiceConfigResultImpl.java new file mode 100644 index 000000000000..4fea50dd26c7 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/ServiceConfigResultImpl.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.hdinsightmicrosofthdinsighthdinsightonaks.implementation; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ServiceConfigResultInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ServiceConfigListResultValueEntity; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ServiceConfigResult; +import java.util.Collections; +import java.util.Map; + +public final class ServiceConfigResultImpl implements ServiceConfigResult { + private ServiceConfigResultInner innerObject; + + private final com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager + serviceManager; + + ServiceConfigResultImpl( + ServiceConfigResultInner innerObject, + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String serviceName() { + return this.innerModel().serviceName(); + } + + public String fileName() { + return this.innerModel().fileName(); + } + + public String content() { + return this.innerModel().content(); + } + + public String componentName() { + return this.innerModel().componentName(); + } + + public String type() { + return this.innerModel().type(); + } + + public String path() { + return this.innerModel().path(); + } + + public Map customKeys() { + Map inner = this.innerModel().customKeys(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map defaultKeys() { + Map inner = this.innerModel().defaultKeys(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ServiceConfigResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/Utils.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/Utils.java new file mode 100644 index 000000000000..133e9727b8f2 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/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.hdinsightmicrosofthdinsighthdinsightonaks.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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/package-info.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/implementation/package-info.java new file mode 100644 index 000000000000..b88a5b07f053 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/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 HDInsightOnAksManagementClient. HDInsight On Aks Management Client. */ +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.implementation; diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Action.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Action.java new file mode 100644 index 000000000000..0f43ca037e16 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Action.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * A string property that indicates the action to be performed on the Flink job. It can have one of the following enum + * values => NEW, UPDATE, STATELESS_UPDATE, STOP, START, CANCEL, SAVEPOINT, LIST_SAVEPOINT, or DELETE. + */ +public final class Action extends ExpandableStringEnum { + /** Static value NEW for Action. */ + public static final Action NEW = fromString("NEW"); + + /** Static value UPDATE for Action. */ + public static final Action UPDATE = fromString("UPDATE"); + + /** Static value STATELESS_UPDATE for Action. */ + public static final Action STATELESS_UPDATE = fromString("STATELESS_UPDATE"); + + /** Static value STOP for Action. */ + public static final Action STOP = fromString("STOP"); + + /** Static value START for Action. */ + public static final Action START = fromString("START"); + + /** Static value CANCEL for Action. */ + public static final Action CANCEL = fromString("CANCEL"); + + /** Static value SAVEPOINT for Action. */ + public static final Action SAVEPOINT = fromString("SAVEPOINT"); + + /** Static value LIST_SAVEPOINT for Action. */ + public static final Action LIST_SAVEPOINT = fromString("LIST_SAVEPOINT"); + + /** Static value DELETE for Action. */ + public static final Action DELETE = fromString("DELETE"); + + /** + * Creates a new instance of Action value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Action() { + } + + /** + * Creates or finds a Action from its string representation. + * + * @param name a name to look for. + * @return the corresponding Action. + */ + @JsonCreator + public static Action fromString(String name) { + return fromString(name, Action.class); + } + + /** + * Gets known Action values. + * + * @return known Action values. + */ + public static Collection values() { + return values(Action.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ActionType.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ActionType.java new file mode 100644 index 000000000000..2d26d7886146 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ActionType.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AksClusterProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AksClusterProfile.java new file mode 100644 index 000000000000..2bb7e974ab9f --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AksClusterProfile.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the cluster pool underlying AKS cluster. */ +@Fluent +public class AksClusterProfile { + /* + * ARM Resource ID of the AKS cluster + */ + @JsonProperty(value = "aksClusterResourceId") + private String aksClusterResourceId; + + /* + * Identity properties of the AKS cluster agentpool MSI + */ + @JsonProperty(value = "aksClusterAgentPoolIdentityProfile") + private AksClusterProfileAksClusterAgentPoolIdentityProfile aksClusterAgentPoolIdentityProfile; + + /* + * AKS control plane and default node pool version of this ClusterPool + */ + @JsonProperty(value = "aksVersion", access = JsonProperty.Access.WRITE_ONLY) + private String aksVersion; + + /** Creates an instance of AksClusterProfile class. */ + public AksClusterProfile() { + } + + /** + * Get the aksClusterResourceId property: ARM Resource ID of the AKS cluster. + * + * @return the aksClusterResourceId value. + */ + public String aksClusterResourceId() { + return this.aksClusterResourceId; + } + + /** + * Set the aksClusterResourceId property: ARM Resource ID of the AKS cluster. + * + * @param aksClusterResourceId the aksClusterResourceId value to set. + * @return the AksClusterProfile object itself. + */ + public AksClusterProfile withAksClusterResourceId(String aksClusterResourceId) { + this.aksClusterResourceId = aksClusterResourceId; + return this; + } + + /** + * Get the aksClusterAgentPoolIdentityProfile property: Identity properties of the AKS cluster agentpool MSI. + * + * @return the aksClusterAgentPoolIdentityProfile value. + */ + public AksClusterProfileAksClusterAgentPoolIdentityProfile aksClusterAgentPoolIdentityProfile() { + return this.aksClusterAgentPoolIdentityProfile; + } + + /** + * Set the aksClusterAgentPoolIdentityProfile property: Identity properties of the AKS cluster agentpool MSI. + * + * @param aksClusterAgentPoolIdentityProfile the aksClusterAgentPoolIdentityProfile value to set. + * @return the AksClusterProfile object itself. + */ + public AksClusterProfile withAksClusterAgentPoolIdentityProfile( + AksClusterProfileAksClusterAgentPoolIdentityProfile aksClusterAgentPoolIdentityProfile) { + this.aksClusterAgentPoolIdentityProfile = aksClusterAgentPoolIdentityProfile; + return this; + } + + /** + * Get the aksVersion property: AKS control plane and default node pool version of this ClusterPool. + * + * @return the aksVersion value. + */ + public String aksVersion() { + return this.aksVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (aksClusterAgentPoolIdentityProfile() != null) { + aksClusterAgentPoolIdentityProfile().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AksClusterProfileAksClusterAgentPoolIdentityProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AksClusterProfileAksClusterAgentPoolIdentityProfile.java new file mode 100644 index 000000000000..baacfcab664c --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AksClusterProfileAksClusterAgentPoolIdentityProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; + +/** Identity properties of the AKS cluster agentpool MSI. */ +@Fluent +public final class AksClusterProfileAksClusterAgentPoolIdentityProfile extends IdentityProfile { + /** Creates an instance of AksClusterProfileAksClusterAgentPoolIdentityProfile class. */ + public AksClusterProfileAksClusterAgentPoolIdentityProfile() { + } + + /** {@inheritDoc} */ + @Override + public AksClusterProfileAksClusterAgentPoolIdentityProfile withMsiResourceId(String msiResourceId) { + super.withMsiResourceId(msiResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AksClusterProfileAksClusterAgentPoolIdentityProfile withMsiClientId(String msiClientId) { + super.withMsiClientId(msiClientId); + return this; + } + + /** {@inheritDoc} */ + @Override + public AksClusterProfileAksClusterAgentPoolIdentityProfile withMsiObjectId(String msiObjectId) { + super.withMsiObjectId(msiObjectId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AuthorizationProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AuthorizationProfile.java new file mode 100644 index 000000000000..e2571273aae9 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AuthorizationProfile.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. */ +@Fluent +public final class AuthorizationProfile { + /* + * AAD user Ids authorized for data plane access. + */ + @JsonProperty(value = "userIds") + private List userIds; + + /* + * AAD group Ids authorized for data plane access. + */ + @JsonProperty(value = "groupIds") + private List groupIds; + + /** Creates an instance of AuthorizationProfile class. */ + public AuthorizationProfile() { + } + + /** + * Get the userIds property: AAD user Ids authorized for data plane access. + * + * @return the userIds value. + */ + public List userIds() { + return this.userIds; + } + + /** + * Set the userIds property: AAD user Ids authorized for data plane access. + * + * @param userIds the userIds value to set. + * @return the AuthorizationProfile object itself. + */ + public AuthorizationProfile withUserIds(List userIds) { + this.userIds = userIds; + return this; + } + + /** + * Get the groupIds property: AAD group Ids authorized for data plane access. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Set the groupIds property: AAD group Ids authorized for data plane access. + * + * @param groupIds the groupIds value to set. + * @return the AuthorizationProfile object itself. + */ + public AuthorizationProfile withGroupIds(List groupIds) { + this.groupIds = groupIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AutoscaleProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AutoscaleProfile.java new file mode 100644 index 000000000000..6ade532ccc46 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AutoscaleProfile.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with Autoscale. */ +@Fluent +public final class AutoscaleProfile { + /* + * This indicates whether auto scale is enabled on HDInsight on AKS cluster. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * This property is for graceful decommission timeout; It has a default setting of 3600 seconds before forced + * shutdown takes place. This is the maximal time to wait for running containers and applications to complete + * before transition a DECOMMISSIONING node into DECOMMISSIONED. The default value is 3600 seconds. Negative value + * (like -1) is handled as infinite timeout. + */ + @JsonProperty(value = "gracefulDecommissionTimeout") + private Integer gracefulDecommissionTimeout; + + /* + * User to specify which type of Autoscale to be implemented - Scheduled Based or Load Based. + */ + @JsonProperty(value = "autoscaleType") + private AutoscaleType autoscaleType; + + /* + * Profiles of schedule based Autoscale. + */ + @JsonProperty(value = "scheduleBasedConfig") + private ScheduleBasedConfig scheduleBasedConfig; + + /* + * Profiles of load based Autoscale. + */ + @JsonProperty(value = "loadBasedConfig") + private LoadBasedConfig loadBasedConfig; + + /** Creates an instance of AutoscaleProfile class. */ + public AutoscaleProfile() { + } + + /** + * Get the enabled property: This indicates whether auto scale is enabled on HDInsight on AKS cluster. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: This indicates whether auto scale is enabled on HDInsight on AKS cluster. + * + * @param enabled the enabled value to set. + * @return the AutoscaleProfile object itself. + */ + public AutoscaleProfile withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the gracefulDecommissionTimeout property: This property is for graceful decommission timeout; It has a + * default setting of 3600 seconds before forced shutdown takes place. This is the maximal time to wait for running + * containers and applications to complete before transition a DECOMMISSIONING node into DECOMMISSIONED. The default + * value is 3600 seconds. Negative value (like -1) is handled as infinite timeout. + * + * @return the gracefulDecommissionTimeout value. + */ + public Integer gracefulDecommissionTimeout() { + return this.gracefulDecommissionTimeout; + } + + /** + * Set the gracefulDecommissionTimeout property: This property is for graceful decommission timeout; It has a + * default setting of 3600 seconds before forced shutdown takes place. This is the maximal time to wait for running + * containers and applications to complete before transition a DECOMMISSIONING node into DECOMMISSIONED. The default + * value is 3600 seconds. Negative value (like -1) is handled as infinite timeout. + * + * @param gracefulDecommissionTimeout the gracefulDecommissionTimeout value to set. + * @return the AutoscaleProfile object itself. + */ + public AutoscaleProfile withGracefulDecommissionTimeout(Integer gracefulDecommissionTimeout) { + this.gracefulDecommissionTimeout = gracefulDecommissionTimeout; + return this; + } + + /** + * Get the autoscaleType property: User to specify which type of Autoscale to be implemented - Scheduled Based or + * Load Based. + * + * @return the autoscaleType value. + */ + public AutoscaleType autoscaleType() { + return this.autoscaleType; + } + + /** + * Set the autoscaleType property: User to specify which type of Autoscale to be implemented - Scheduled Based or + * Load Based. + * + * @param autoscaleType the autoscaleType value to set. + * @return the AutoscaleProfile object itself. + */ + public AutoscaleProfile withAutoscaleType(AutoscaleType autoscaleType) { + this.autoscaleType = autoscaleType; + return this; + } + + /** + * Get the scheduleBasedConfig property: Profiles of schedule based Autoscale. + * + * @return the scheduleBasedConfig value. + */ + public ScheduleBasedConfig scheduleBasedConfig() { + return this.scheduleBasedConfig; + } + + /** + * Set the scheduleBasedConfig property: Profiles of schedule based Autoscale. + * + * @param scheduleBasedConfig the scheduleBasedConfig value to set. + * @return the AutoscaleProfile object itself. + */ + public AutoscaleProfile withScheduleBasedConfig(ScheduleBasedConfig scheduleBasedConfig) { + this.scheduleBasedConfig = scheduleBasedConfig; + return this; + } + + /** + * Get the loadBasedConfig property: Profiles of load based Autoscale. + * + * @return the loadBasedConfig value. + */ + public LoadBasedConfig loadBasedConfig() { + return this.loadBasedConfig; + } + + /** + * Set the loadBasedConfig property: Profiles of load based Autoscale. + * + * @param loadBasedConfig the loadBasedConfig value to set. + * @return the AutoscaleProfile object itself. + */ + public AutoscaleProfile withLoadBasedConfig(LoadBasedConfig loadBasedConfig) { + this.loadBasedConfig = loadBasedConfig; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scheduleBasedConfig() != null) { + scheduleBasedConfig().validate(); + } + if (loadBasedConfig() != null) { + loadBasedConfig().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AutoscaleType.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AutoscaleType.java new file mode 100644 index 000000000000..5bac50db1e5c --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AutoscaleType.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** User to specify which type of Autoscale to be implemented - Scheduled Based or Load Based. */ +public final class AutoscaleType extends ExpandableStringEnum { + /** Static value ScheduleBased for AutoscaleType. */ + public static final AutoscaleType SCHEDULE_BASED = fromString("ScheduleBased"); + + /** Static value LoadBased for AutoscaleType. */ + public static final AutoscaleType LOAD_BASED = fromString("LoadBased"); + + /** + * Creates a new instance of AutoscaleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoscaleType() { + } + + /** + * Creates or finds a AutoscaleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoscaleType. + */ + @JsonCreator + public static AutoscaleType fromString(String name) { + return fromString(name, AutoscaleType.class); + } + + /** + * Gets known AutoscaleType values. + * + * @return known AutoscaleType values. + */ + public static Collection values() { + return values(AutoscaleType.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AvailableClusterPoolVersions.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AvailableClusterPoolVersions.java new file mode 100644 index 000000000000..142e3a79b068 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AvailableClusterPoolVersions.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableClusterPoolVersions. */ +public interface AvailableClusterPoolVersions { + /** + * Returns a list of available cluster pool versions. + * + * @param location The name of the 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 represents a list of cluster pool versions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByLocation(String location); + + /** + * Returns a list of available cluster pool versions. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster pool versions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByLocation(String location, Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AvailableClusterVersions.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AvailableClusterVersions.java new file mode 100644 index 000000000000..32b59271cdb4 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/AvailableClusterVersions.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of AvailableClusterVersions. */ +public interface AvailableClusterVersions { + /** + * Returns a list of available cluster versions. + * + * @param location The name of the 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 represents a list of cluster versions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByLocation(String location); + + /** + * Returns a list of available cluster versions. + * + * @param location The name of the Azure region. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a list of cluster versions as paginated response with {@link PagedIterable}. + */ + PagedIterable listByLocation(String location, Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/CatalogOptions.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/CatalogOptions.java new file mode 100644 index 000000000000..f8846afa63b5 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/CatalogOptions.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Trino cluster catalog options. */ +@Fluent +public final class CatalogOptions { + /* + * hive catalog options. + */ + @JsonProperty(value = "hive") + private List hive; + + /** Creates an instance of CatalogOptions class. */ + public CatalogOptions() { + } + + /** + * Get the hive property: hive catalog options. + * + * @return the hive value. + */ + public List hive() { + return this.hive; + } + + /** + * Set the hive property: hive catalog options. + * + * @param hive the hive value to set. + * @return the CatalogOptions object itself. + */ + public CatalogOptions withHive(List hive) { + this.hive = hive; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hive() != null) { + hive().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Cluster.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Cluster.java new file mode 100644 index 000000000000..1ba6fb80c48a --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Cluster.java @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInner; +import java.util.Map; + +/** An immutable client-side representation of Cluster. */ +public interface Cluster { + /** + * 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 provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningStatus provisioningState(); + + /** + * Gets the clusterType property: The type of cluster. + * + * @return the clusterType value. + */ + String clusterType(); + + /** + * Gets the deploymentId property: A unique id generated by the RP to identify the resource. + * + * @return the deploymentId value. + */ + String deploymentId(); + + /** + * Gets the computeProfile property: The compute profile. + * + * @return the computeProfile value. + */ + ComputeProfile computeProfile(); + + /** + * Gets the clusterProfile property: Cluster profile. + * + * @return the clusterProfile value. + */ + ClusterProfile clusterProfile(); + + /** + * Gets the status property: Business status of the resource. + * + * @return the status value. + */ + String status(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInner + * object. + * + * @return the inner object. + */ + ClusterInner innerModel(); + + /** The entirety of the Cluster definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The Cluster definition stages. */ + interface DefinitionStages { + /** The first stage of the Cluster definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the Cluster 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the Cluster definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterPoolName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @return the next definition stage. + */ + WithCreate withExistingClusterpool(String resourceGroupName, String clusterPoolName); + } + + /** + * The stage of the Cluster 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.WithClusterType, + DefinitionStages.WithComputeProfile, + DefinitionStages.WithClusterProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + Cluster create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Cluster create(Context context); + } + + /** The stage of the Cluster 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 Cluster definition allowing to specify clusterType. */ + interface WithClusterType { + /** + * Specifies the clusterType property: The type of cluster.. + * + * @param clusterType The type of cluster. + * @return the next definition stage. + */ + WithCreate withClusterType(String clusterType); + } + + /** The stage of the Cluster definition allowing to specify computeProfile. */ + interface WithComputeProfile { + /** + * Specifies the computeProfile property: The compute profile.. + * + * @param computeProfile The compute profile. + * @return the next definition stage. + */ + WithCreate withComputeProfile(ComputeProfile computeProfile); + } + + /** The stage of the Cluster definition allowing to specify clusterProfile. */ + interface WithClusterProfile { + /** + * Specifies the clusterProfile property: Cluster profile.. + * + * @param clusterProfile Cluster profile. + * @return the next definition stage. + */ + WithCreate withClusterProfile(ClusterProfile clusterProfile); + } + } + + /** + * Begins update for the Cluster resource. + * + * @return the stage of resource update. + */ + Cluster.Update update(); + + /** The template for Cluster update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithClusterProfile { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Cluster apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Cluster apply(Context context); + } + + /** The Cluster update stages. */ + interface UpdateStages { + /** The stage of the Cluster update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** The stage of the Cluster update allowing to specify clusterProfile. */ + interface WithClusterProfile { + /** + * Specifies the clusterProfile property: Cluster resource patch properties.. + * + * @param clusterProfile Cluster resource patch properties. + * @return the next definition stage. + */ + Update withClusterProfile(UpdatableClusterProfile clusterProfile); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Cluster refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Cluster refresh(Context context); + + /** + * Resize an existing Cluster. + * + * @param clusterResizeRequest Resize a 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 cluster. + */ + Cluster resize(ClusterResizeData clusterResizeRequest); + + /** + * Resize an existing Cluster. + * + * @param clusterResizeRequest Resize 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. + * @return the cluster. + */ + Cluster resize(ClusterResizeData clusterResizeRequest, Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterComponentsItem.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterComponentsItem.java new file mode 100644 index 000000000000..0252626ee51d --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterComponentsItem.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ClusterComponentsItem model. */ +@Fluent +public final class ClusterComponentsItem { + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The version property. + */ + @JsonProperty(value = "version") + private String version; + + /** Creates an instance of ClusterComponentsItem class. */ + public ClusterComponentsItem() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @param name the name value to set. + * @return the ClusterComponentsItem object itself. + */ + public ClusterComponentsItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version property: The version property. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version property. + * + * @param version the version value to set. + * @return the ClusterComponentsItem object itself. + */ + public ClusterComponentsItem withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterConfigFile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterConfigFile.java new file mode 100644 index 000000000000..51ac725b33bc --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterConfigFile.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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; + +/** Cluster configuration files. */ +@Fluent +public final class ClusterConfigFile { + /* + * Configuration file name. + */ + @JsonProperty(value = "fileName", required = true) + private String fileName; + + /* + * Free form content of the entire configuration file. + */ + @JsonProperty(value = "content") + private String content; + + /* + * This property indicates if the content is encoded and is case-insensitive. Please set the value to base64 if the + * content is base64 encoded. Set it to none or skip it if the content is plain text. + */ + @JsonProperty(value = "encoding") + private ContentEncoding encoding; + + /* + * Path of the config file if content is specified. + */ + @JsonProperty(value = "path") + private String path; + + /* + * List of key value pairs + * where key represents a valid service configuration name and value represents the value of the config. + */ + @JsonProperty(value = "values") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map values; + + /** Creates an instance of ClusterConfigFile class. */ + public ClusterConfigFile() { + } + + /** + * Get the fileName property: Configuration file name. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Set the fileName property: Configuration file name. + * + * @param fileName the fileName value to set. + * @return the ClusterConfigFile object itself. + */ + public ClusterConfigFile withFileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Get the content property: Free form content of the entire configuration file. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: Free form content of the entire configuration file. + * + * @param content the content value to set. + * @return the ClusterConfigFile object itself. + */ + public ClusterConfigFile withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the encoding property: This property indicates if the content is encoded and is case-insensitive. Please set + * the value to base64 if the content is base64 encoded. Set it to none or skip it if the content is plain text. + * + * @return the encoding value. + */ + public ContentEncoding encoding() { + return this.encoding; + } + + /** + * Set the encoding property: This property indicates if the content is encoded and is case-insensitive. Please set + * the value to base64 if the content is base64 encoded. Set it to none or skip it if the content is plain text. + * + * @param encoding the encoding value to set. + * @return the ClusterConfigFile object itself. + */ + public ClusterConfigFile withEncoding(ContentEncoding encoding) { + this.encoding = encoding; + return this; + } + + /** + * Get the path property: Path of the config file if content is specified. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Path of the config file if content is specified. + * + * @param path the path value to set. + * @return the ClusterConfigFile object itself. + */ + public ClusterConfigFile withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the values property: List of key value pairs where key represents a valid service configuration name and + * value represents the value of the config. + * + * @return the values value. + */ + public Map values() { + return this.values; + } + + /** + * Set the values property: List of key value pairs where key represents a valid service configuration name and + * value represents the value of the config. + * + * @param values the values value to set. + * @return the ClusterConfigFile object itself. + */ + public ClusterConfigFile withValues(Map values) { + this.values = values; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fileName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property fileName in model ClusterConfigFile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterConfigFile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewProperties.java new file mode 100644 index 000000000000..cce749119e7c --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewProperties.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster Instance View Properties. */ +@Fluent +public class ClusterInstanceViewProperties { + /* + * Status of the instance view. + */ + @JsonProperty(value = "status", required = true) + private ClusterInstanceViewPropertiesStatus status; + + /* + * List of statuses of relevant services that make up the HDInsight on aks cluster to surface to the customer. + */ + @JsonProperty(value = "serviceStatuses", required = true) + private List serviceStatuses; + + /** Creates an instance of ClusterInstanceViewProperties class. */ + public ClusterInstanceViewProperties() { + } + + /** + * Get the status property: Status of the instance view. + * + * @return the status value. + */ + public ClusterInstanceViewPropertiesStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the instance view. + * + * @param status the status value to set. + * @return the ClusterInstanceViewProperties object itself. + */ + public ClusterInstanceViewProperties withStatus(ClusterInstanceViewPropertiesStatus status) { + this.status = status; + return this; + } + + /** + * Get the serviceStatuses property: List of statuses of relevant services that make up the HDInsight on aks cluster + * to surface to the customer. + * + * @return the serviceStatuses value. + */ + public List serviceStatuses() { + return this.serviceStatuses; + } + + /** + * Set the serviceStatuses property: List of statuses of relevant services that make up the HDInsight on aks cluster + * to surface to the customer. + * + * @param serviceStatuses the serviceStatuses value to set. + * @return the ClusterInstanceViewProperties object itself. + */ + public ClusterInstanceViewProperties withServiceStatuses(List serviceStatuses) { + this.serviceStatuses = serviceStatuses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model ClusterInstanceViewProperties")); + } else { + status().validate(); + } + if (serviceStatuses() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceStatuses in model ClusterInstanceViewProperties")); + } else { + serviceStatuses().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterInstanceViewProperties.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewPropertiesStatus.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewPropertiesStatus.java new file mode 100644 index 000000000000..e8553b5cdbda --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewPropertiesStatus.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; + +/** Status of the instance view. */ +@Fluent +public final class ClusterInstanceViewPropertiesStatus extends ClusterInstanceViewStatus { + /** Creates an instance of ClusterInstanceViewPropertiesStatus class. */ + public ClusterInstanceViewPropertiesStatus() { + } + + /** {@inheritDoc} */ + @Override + public ClusterInstanceViewPropertiesStatus withReady(String ready) { + super.withReady(ready); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInstanceViewPropertiesStatus withReason(String reason) { + super.withReason(reason); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInstanceViewPropertiesStatus withMessage(String message) { + super.withMessage(message); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewResult.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewResult.java new file mode 100644 index 000000000000..3c1b48847483 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewResult.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInstanceViewResultInner; +import java.util.List; + +/** An immutable client-side representation of ClusterInstanceViewResult. */ +public interface ClusterInstanceViewResult { + /** + * Gets the name property: Name of the instance view. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Status of the instance view. + * + * @return the status value. + */ + ClusterInstanceViewPropertiesStatus status(); + + /** + * Gets the serviceStatuses property: List of statuses of relevant services that make up the HDInsight on aks + * cluster to surface to the customer. + * + * @return the serviceStatuses value. + */ + List serviceStatuses(); + + /** + * Gets the inner + * com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInstanceViewResultInner + * object. + * + * @return the inner object. + */ + ClusterInstanceViewResultInner innerModel(); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewStatus.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewStatus.java new file mode 100644 index 000000000000..752c1d754f1a --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewStatus.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Status of the instance view. */ +@Fluent +public class ClusterInstanceViewStatus { + /* + * The cluster ready status + */ + @JsonProperty(value = "ready", required = true) + private String ready; + + /* + * The status reason. + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * The additional message. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of ClusterInstanceViewStatus class. */ + public ClusterInstanceViewStatus() { + } + + /** + * Get the ready property: The cluster ready status. + * + * @return the ready value. + */ + public String ready() { + return this.ready; + } + + /** + * Set the ready property: The cluster ready status. + * + * @param ready the ready value to set. + * @return the ClusterInstanceViewStatus object itself. + */ + public ClusterInstanceViewStatus withReady(String ready) { + this.ready = ready; + return this; + } + + /** + * Get the reason property: The status reason. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: The status reason. + * + * @param reason the reason value to set. + * @return the ClusterInstanceViewStatus object itself. + */ + public ClusterInstanceViewStatus withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: The additional message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The additional message. + * + * @param message the message value to set. + * @return the ClusterInstanceViewStatus object itself. + */ + public ClusterInstanceViewStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ready() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ready in model ClusterInstanceViewStatus")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterInstanceViewStatus.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewsResult.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewsResult.java new file mode 100644 index 000000000000..d4d101cbf914 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterInstanceViewsResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInstanceViewResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The instance view of a HDInsight Cluster. */ +@Fluent +public final class ClusterInstanceViewsResult { + /* + * Cluster instance view array. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ClusterInstanceViewsResult class. */ + public ClusterInstanceViewsResult() { + } + + /** + * Get the value property: Cluster instance view array. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Cluster instance view array. + * + * @param value the value value to set. + * @return the ClusterInstanceViewsResult object itself. + */ + public ClusterInstanceViewsResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link (url) to the next page of 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJob.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJob.java new file mode 100644 index 000000000000..3c10f47897b9 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJob.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterJobInner; + +/** An immutable client-side representation of ClusterJob. */ +public interface ClusterJob { + /** + * 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 properties property: Properties of cluster job. + * + * @return the properties value. + */ + ClusterJobProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterJobInner + * object. + * + * @return the inner object. + */ + ClusterJobInner innerModel(); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJobList.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJobList.java new file mode 100644 index 000000000000..600df210e971 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJobList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterJobInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of cluster job. */ +@Fluent +public final class ClusterJobList { + /* + * Collection of cluster job. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The Url of next result page. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ClusterJobList class. */ + public ClusterJobList() { + } + + /** + * Get the value property: Collection of cluster job. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of cluster job. + * + * @param value the value value to set. + * @return the ClusterJobList object itself. + */ + public ClusterJobList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The Url of next result page. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The Url of next result page. + * + * @param nextLink the nextLink value to set. + * @return the ClusterJobList object itself. + */ + public ClusterJobList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ClusterJobList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterJobList.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJobProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJobProperties.java new file mode 100644 index 000000000000..a95c05103597 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJobProperties.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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; + +/** Properties of cluster job. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "jobType", + defaultImpl = ClusterJobProperties.class) +@JsonTypeName("ClusterJobProperties") +@JsonSubTypes({@JsonSubTypes.Type(name = "FlinkJob", value = FlinkJobProperties.class)}) +@Immutable +public class ClusterJobProperties { + /** Creates an instance of ClusterJobProperties class. */ + public ClusterJobProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJobs.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJobs.java new file mode 100644 index 000000000000..285c25857f4c --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterJobs.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterJobInner; + +/** Resource collection API of ClusterJobs. */ +public interface ClusterJobs { + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster job. + */ + ClusterJob runJob(String resourceGroupName, String clusterPoolName, String clusterName, ClusterJobInner clusterJob); + + /** + * Operations on jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterJob The Cluster job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster job. + */ + ClusterJob runJob( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterJobInner clusterJob, + Context context); + + /** + * Get jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 jobs of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Get jobs of HDInsight on AKS cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 jobs of HDInsight on AKS cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterListResult.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterListResult.java new file mode 100644 index 000000000000..4cc55e5d6774 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list cluster operation response. */ +@Fluent +public final class ClusterListResult { + /* + * The list of clusters. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ClusterListResult class. */ + public ClusterListResult() { + } + + /** + * Get the value property: The list of clusters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of clusters. + * + * @param value the value value to set. + * @return the ClusterListResult object itself. + */ + public ClusterListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link (url) to the next page of 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterLogAnalyticsApplicationLogs.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterLogAnalyticsApplicationLogs.java new file mode 100644 index 000000000000..5e1d34042121 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterLogAnalyticsApplicationLogs.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of logs to be enabled or disabled for log analytics. */ +@Fluent +public final class ClusterLogAnalyticsApplicationLogs { + /* + * True if stdout is enabled, otherwise false. + */ + @JsonProperty(value = "stdOutEnabled") + private Boolean stdOutEnabled; + + /* + * True if stderror is enabled, otherwise false. + */ + @JsonProperty(value = "stdErrorEnabled") + private Boolean stdErrorEnabled; + + /** Creates an instance of ClusterLogAnalyticsApplicationLogs class. */ + public ClusterLogAnalyticsApplicationLogs() { + } + + /** + * Get the stdOutEnabled property: True if stdout is enabled, otherwise false. + * + * @return the stdOutEnabled value. + */ + public Boolean stdOutEnabled() { + return this.stdOutEnabled; + } + + /** + * Set the stdOutEnabled property: True if stdout is enabled, otherwise false. + * + * @param stdOutEnabled the stdOutEnabled value to set. + * @return the ClusterLogAnalyticsApplicationLogs object itself. + */ + public ClusterLogAnalyticsApplicationLogs withStdOutEnabled(Boolean stdOutEnabled) { + this.stdOutEnabled = stdOutEnabled; + return this; + } + + /** + * Get the stdErrorEnabled property: True if stderror is enabled, otherwise false. + * + * @return the stdErrorEnabled value. + */ + public Boolean stdErrorEnabled() { + return this.stdErrorEnabled; + } + + /** + * Set the stdErrorEnabled property: True if stderror is enabled, otherwise false. + * + * @param stdErrorEnabled the stdErrorEnabled value to set. + * @return the ClusterLogAnalyticsApplicationLogs object itself. + */ + public ClusterLogAnalyticsApplicationLogs withStdErrorEnabled(Boolean stdErrorEnabled) { + this.stdErrorEnabled = stdErrorEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterLogAnalyticsProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterLogAnalyticsProfile.java new file mode 100644 index 000000000000..2d9baaab62ae --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterLogAnalyticsProfile.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster log analytics profile to enable or disable OMS agent for cluster. */ +@Fluent +public final class ClusterLogAnalyticsProfile { + /* + * True if log analytics is enabled for the cluster, otherwise false. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * Collection of logs to be enabled or disabled for log analytics. + */ + @JsonProperty(value = "applicationLogs") + private ClusterLogAnalyticsApplicationLogs applicationLogs; + + /* + * True if metrics are enabled, otherwise false. + */ + @JsonProperty(value = "metricsEnabled") + private Boolean metricsEnabled; + + /** Creates an instance of ClusterLogAnalyticsProfile class. */ + public ClusterLogAnalyticsProfile() { + } + + /** + * Get the enabled property: True if log analytics is enabled for the cluster, otherwise false. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: True if log analytics is enabled for the cluster, otherwise false. + * + * @param enabled the enabled value to set. + * @return the ClusterLogAnalyticsProfile object itself. + */ + public ClusterLogAnalyticsProfile withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the applicationLogs property: Collection of logs to be enabled or disabled for log analytics. + * + * @return the applicationLogs value. + */ + public ClusterLogAnalyticsApplicationLogs applicationLogs() { + return this.applicationLogs; + } + + /** + * Set the applicationLogs property: Collection of logs to be enabled or disabled for log analytics. + * + * @param applicationLogs the applicationLogs value to set. + * @return the ClusterLogAnalyticsProfile object itself. + */ + public ClusterLogAnalyticsProfile withApplicationLogs(ClusterLogAnalyticsApplicationLogs applicationLogs) { + this.applicationLogs = applicationLogs; + return this; + } + + /** + * Get the metricsEnabled property: True if metrics are enabled, otherwise false. + * + * @return the metricsEnabled value. + */ + public Boolean metricsEnabled() { + return this.metricsEnabled; + } + + /** + * Set the metricsEnabled property: True if metrics are enabled, otherwise false. + * + * @param metricsEnabled the metricsEnabled value to set. + * @return the ClusterLogAnalyticsProfile object itself. + */ + public ClusterLogAnalyticsProfile withMetricsEnabled(Boolean metricsEnabled) { + this.metricsEnabled = metricsEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationLogs() != null) { + applicationLogs().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPatch.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPatch.java new file mode 100644 index 000000000000..3a5d3317662d --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPatch.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPatchProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The patch for a cluster. */ +@Fluent +public final class ClusterPatch extends Resource { + /* + * Define cluster patch specific properties. + */ + @JsonProperty(value = "properties") + private ClusterPatchProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterPatch class. */ + public ClusterPatch() { + } + + /** + * Get the innerProperties property: Define cluster patch specific properties. + * + * @return the innerProperties value. + */ + private ClusterPatchProperties 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 ClusterPatch withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterPatch withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the clusterProfile property: Cluster resource patch properties. + * + * @return the clusterProfile value. + */ + public UpdatableClusterProfile clusterProfile() { + return this.innerProperties() == null ? null : this.innerProperties().clusterProfile(); + } + + /** + * Set the clusterProfile property: Cluster resource patch properties. + * + * @param clusterProfile the clusterProfile value to set. + * @return the ClusterPatch object itself. + */ + public ClusterPatch withClusterProfile(UpdatableClusterProfile clusterProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterPatchProperties(); + } + this.innerProperties().withClusterProfile(clusterProfile); + 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPool.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPool.java new file mode 100644 index 000000000000..c8ebb42e23d9 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPool.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolInner; +import java.util.Map; + +/** An immutable client-side representation of ClusterPool. */ +public interface ClusterPool { + /** + * 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 provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningStatus provisioningState(); + + /** + * Gets the deploymentId property: A unique id generated by the RP to identify the resource. + * + * @return the deploymentId value. + */ + String deploymentId(); + + /** + * Gets the managedResourceGroupName property: A resource group created by RP, to hold the resources created by RP + * on-behalf of customers. It will also be used to generate aksManagedResourceGroupName by pattern: + * MC_{managedResourceGroupName}_{clusterPoolName}_{region}. Please make sure it meets resource group name + * restriction. + * + * @return the managedResourceGroupName value. + */ + String managedResourceGroupName(); + + /** + * Gets the aksManagedResourceGroupName property: A resource group created by AKS, to hold the infrastructure + * resources created by AKS on-behalf of customers. It is generated by cluster pool name and managed resource group + * name by pattern: MC_{managedResourceGroupName}_{clusterPoolName}_{region}. + * + * @return the aksManagedResourceGroupName value. + */ + String aksManagedResourceGroupName(); + + /** + * Gets the clusterPoolProfile property: CLuster pool profile. + * + * @return the clusterPoolProfile value. + */ + ClusterPoolResourcePropertiesClusterPoolProfile clusterPoolProfile(); + + /** + * Gets the computeProfile property: CLuster pool compute profile. + * + * @return the computeProfile value. + */ + ClusterPoolResourcePropertiesComputeProfile computeProfile(); + + /** + * Gets the aksClusterProfile property: Properties of underlying AKS cluster. + * + * @return the aksClusterProfile value. + */ + ClusterPoolResourcePropertiesAksClusterProfile aksClusterProfile(); + + /** + * Gets the networkProfile property: Cluster pool network profile. + * + * @return the networkProfile value. + */ + ClusterPoolResourcePropertiesNetworkProfile networkProfile(); + + /** + * Gets the logAnalyticsProfile property: Cluster pool log analytics profile to enable OMS agent for AKS cluster. + * + * @return the logAnalyticsProfile value. + */ + ClusterPoolResourcePropertiesLogAnalyticsProfile logAnalyticsProfile(); + + /** + * Gets the status property: Business status of the resource. + * + * @return the status value. + */ + String status(); + + /** + * 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolInner + * object. + * + * @return the inner object. + */ + ClusterPoolInner innerModel(); + + /** The entirety of the ClusterPool definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The ClusterPool definition stages. */ + interface DefinitionStages { + /** The first stage of the ClusterPool definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the ClusterPool 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 ClusterPool 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 ClusterPool 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.WithManagedResourceGroupName, + DefinitionStages.WithClusterPoolProfile, + DefinitionStages.WithComputeProfile, + DefinitionStages.WithNetworkProfile, + DefinitionStages.WithLogAnalyticsProfile { + /** + * Executes the create request. + * + * @return the created resource. + */ + ClusterPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ClusterPool create(Context context); + } + + /** The stage of the ClusterPool 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 ClusterPool definition allowing to specify managedResourceGroupName. */ + interface WithManagedResourceGroupName { + /** + * Specifies the managedResourceGroupName property: A resource group created by RP, to hold the resources + * created by RP on-behalf of customers. It will also be used to generate aksManagedResourceGroupName by + * pattern: MC_{managedResourceGroupName}_{clusterPoolName}_{region}. Please make sure it meets resource + * group name restriction.. + * + * @param managedResourceGroupName A resource group created by RP, to hold the resources created by RP + * on-behalf of customers. It will also be used to generate aksManagedResourceGroupName by pattern: + * MC_{managedResourceGroupName}_{clusterPoolName}_{region}. Please make sure it meets resource group + * name restriction. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroupName(String managedResourceGroupName); + } + + /** The stage of the ClusterPool definition allowing to specify clusterPoolProfile. */ + interface WithClusterPoolProfile { + /** + * Specifies the clusterPoolProfile property: CLuster pool profile.. + * + * @param clusterPoolProfile CLuster pool profile. + * @return the next definition stage. + */ + WithCreate withClusterPoolProfile(ClusterPoolResourcePropertiesClusterPoolProfile clusterPoolProfile); + } + + /** The stage of the ClusterPool definition allowing to specify computeProfile. */ + interface WithComputeProfile { + /** + * Specifies the computeProfile property: CLuster pool compute profile.. + * + * @param computeProfile CLuster pool compute profile. + * @return the next definition stage. + */ + WithCreate withComputeProfile(ClusterPoolResourcePropertiesComputeProfile computeProfile); + } + + /** The stage of the ClusterPool definition allowing to specify networkProfile. */ + interface WithNetworkProfile { + /** + * Specifies the networkProfile property: Cluster pool network profile.. + * + * @param networkProfile Cluster pool network profile. + * @return the next definition stage. + */ + WithCreate withNetworkProfile(ClusterPoolResourcePropertiesNetworkProfile networkProfile); + } + + /** The stage of the ClusterPool definition allowing to specify logAnalyticsProfile. */ + interface WithLogAnalyticsProfile { + /** + * Specifies the logAnalyticsProfile property: Cluster pool log analytics profile to enable OMS agent for + * AKS cluster.. + * + * @param logAnalyticsProfile Cluster pool log analytics profile to enable OMS agent for AKS cluster. + * @return the next definition stage. + */ + WithCreate withLogAnalyticsProfile(ClusterPoolResourcePropertiesLogAnalyticsProfile logAnalyticsProfile); + } + } + + /** + * Begins update for the ClusterPool resource. + * + * @return the stage of resource update. + */ + ClusterPool.Update update(); + + /** The template for ClusterPool update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ClusterPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ClusterPool apply(Context context); + } + + /** The ClusterPool update stages. */ + interface UpdateStages { + /** The stage of the ClusterPool 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. + */ + ClusterPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ClusterPool refresh(Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolComputeProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolComputeProfile.java new file mode 100644 index 000000000000..6c17ccff3ef1 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolComputeProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster pool compute profile. */ +@Fluent +public class ClusterPoolComputeProfile { + /* + * The virtual machine SKU. + */ + @JsonProperty(value = "vmSize", required = true) + private String vmSize; + + /* + * The number of virtual machines. + */ + @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) + private Integer count; + + /** Creates an instance of ClusterPoolComputeProfile class. */ + public ClusterPoolComputeProfile() { + } + + /** + * Get the vmSize property: The virtual machine SKU. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The virtual machine SKU. + * + * @param vmSize the vmSize value to set. + * @return the ClusterPoolComputeProfile object itself. + */ + public ClusterPoolComputeProfile withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the count property: The number of virtual machines. + * + * @return the count value. + */ + public Integer count() { + return this.count; + } + + /** + * 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 ClusterPoolComputeProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolComputeProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolListResult.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolListResult.java new file mode 100644 index 000000000000..8511cd332987 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list cluster pools operation response. */ +@Fluent +public final class ClusterPoolListResult { + /* + * The list of cluster pools. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ClusterPoolListResult class. */ + public ClusterPoolListResult() { + } + + /** + * Get the value property: The list of cluster pools. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of cluster pools. + * + * @param value the value value to set. + * @return the ClusterPoolListResult object itself. + */ + public ClusterPoolListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link (url) to the next page of 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolLogAnalyticsProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolLogAnalyticsProfile.java new file mode 100644 index 000000000000..abf474aa0a3c --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolLogAnalyticsProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster pool log analytics profile used to enable or disable OMS agent for AKS cluster. */ +@Fluent +public class ClusterPoolLogAnalyticsProfile { + /* + * True if log analytics is enabled for cluster pool, otherwise false. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /* + * Log analytics workspace to associate with the OMS agent. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** Creates an instance of ClusterPoolLogAnalyticsProfile class. */ + public ClusterPoolLogAnalyticsProfile() { + } + + /** + * Get the enabled property: True if log analytics is enabled for cluster pool, otherwise false. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: True if log analytics is enabled for cluster pool, otherwise false. + * + * @param enabled the enabled value to set. + * @return the ClusterPoolLogAnalyticsProfile object itself. + */ + public ClusterPoolLogAnalyticsProfile withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the workspaceId property: Log analytics workspace to associate with the OMS agent. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: Log analytics workspace to associate with the OMS agent. + * + * @param workspaceId the workspaceId value to set. + * @return the ClusterPoolLogAnalyticsProfile object itself. + */ + public ClusterPoolLogAnalyticsProfile withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolNetworkProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolNetworkProfile.java new file mode 100644 index 000000000000..88cf438e67a0 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolNetworkProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster pool networking configuration. */ +@Fluent +public class ClusterPoolNetworkProfile { + /* + * Cluster pool subnet resource id. + */ + @JsonProperty(value = "subnetId", required = true) + private String subnetId; + + /** Creates an instance of ClusterPoolNetworkProfile class. */ + public ClusterPoolNetworkProfile() { + } + + /** + * Get the subnetId property: Cluster pool subnet resource id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Cluster pool subnet resource id. + * + * @param subnetId the subnetId value to set. + * @return the ClusterPoolNetworkProfile object itself. + */ + public ClusterPoolNetworkProfile withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subnetId in model ClusterPoolNetworkProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolNetworkProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolProfile.java new file mode 100644 index 000000000000..d9ce558c8b26 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster pool profile. */ +@Fluent +public class ClusterPoolProfile { + /* + * Cluster pool version is a 2-part version. + */ + @JsonProperty(value = "clusterPoolVersion", required = true) + private String clusterPoolVersion; + + /** Creates an instance of ClusterPoolProfile class. */ + public ClusterPoolProfile() { + } + + /** + * Get the clusterPoolVersion property: Cluster pool version is a 2-part version. + * + * @return the clusterPoolVersion value. + */ + public String clusterPoolVersion() { + return this.clusterPoolVersion; + } + + /** + * Set the clusterPoolVersion property: Cluster pool version is a 2-part version. + * + * @param clusterPoolVersion the clusterPoolVersion value to set. + * @return the ClusterPoolProfile object itself. + */ + public ClusterPoolProfile withClusterPoolVersion(String clusterPoolVersion) { + this.clusterPoolVersion = clusterPoolVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterPoolVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clusterPoolVersion in model ClusterPoolProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterPoolProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesAksClusterProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesAksClusterProfile.java new file mode 100644 index 000000000000..6b3bd21d275b --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesAksClusterProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; + +/** Properties of underlying AKS cluster. */ +@Fluent +public final class ClusterPoolResourcePropertiesAksClusterProfile extends AksClusterProfile { + /** Creates an instance of ClusterPoolResourcePropertiesAksClusterProfile class. */ + public ClusterPoolResourcePropertiesAksClusterProfile() { + } + + /** {@inheritDoc} */ + @Override + public ClusterPoolResourcePropertiesAksClusterProfile withAksClusterResourceId(String aksClusterResourceId) { + super.withAksClusterResourceId(aksClusterResourceId); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterPoolResourcePropertiesAksClusterProfile withAksClusterAgentPoolIdentityProfile( + AksClusterProfileAksClusterAgentPoolIdentityProfile aksClusterAgentPoolIdentityProfile) { + super.withAksClusterAgentPoolIdentityProfile(aksClusterAgentPoolIdentityProfile); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesClusterPoolProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesClusterPoolProfile.java new file mode 100644 index 000000000000..d01dce2540c4 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesClusterPoolProfile.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; + +/** CLuster pool profile. */ +@Fluent +public final class ClusterPoolResourcePropertiesClusterPoolProfile extends ClusterPoolProfile { + /** Creates an instance of ClusterPoolResourcePropertiesClusterPoolProfile class. */ + public ClusterPoolResourcePropertiesClusterPoolProfile() { + } + + /** {@inheritDoc} */ + @Override + public ClusterPoolResourcePropertiesClusterPoolProfile withClusterPoolVersion(String clusterPoolVersion) { + super.withClusterPoolVersion(clusterPoolVersion); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesComputeProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesComputeProfile.java new file mode 100644 index 000000000000..d684106e0c50 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesComputeProfile.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; + +/** CLuster pool compute profile. */ +@Fluent +public final class ClusterPoolResourcePropertiesComputeProfile extends ClusterPoolComputeProfile { + /** Creates an instance of ClusterPoolResourcePropertiesComputeProfile class. */ + public ClusterPoolResourcePropertiesComputeProfile() { + } + + /** {@inheritDoc} */ + @Override + public ClusterPoolResourcePropertiesComputeProfile withVmSize(String vmSize) { + super.withVmSize(vmSize); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesLogAnalyticsProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesLogAnalyticsProfile.java new file mode 100644 index 000000000000..01a965a9ebbc --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesLogAnalyticsProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; + +/** Cluster pool log analytics profile to enable OMS agent for AKS cluster. */ +@Fluent +public final class ClusterPoolResourcePropertiesLogAnalyticsProfile extends ClusterPoolLogAnalyticsProfile { + /** Creates an instance of ClusterPoolResourcePropertiesLogAnalyticsProfile class. */ + public ClusterPoolResourcePropertiesLogAnalyticsProfile() { + } + + /** {@inheritDoc} */ + @Override + public ClusterPoolResourcePropertiesLogAnalyticsProfile withEnabled(boolean enabled) { + super.withEnabled(enabled); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterPoolResourcePropertiesLogAnalyticsProfile withWorkspaceId(String workspaceId) { + super.withWorkspaceId(workspaceId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesNetworkProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesNetworkProfile.java new file mode 100644 index 000000000000..99c019a62762 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolResourcePropertiesNetworkProfile.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; + +/** Cluster pool network profile. */ +@Fluent +public final class ClusterPoolResourcePropertiesNetworkProfile extends ClusterPoolNetworkProfile { + /** Creates an instance of ClusterPoolResourcePropertiesNetworkProfile class. */ + public ClusterPoolResourcePropertiesNetworkProfile() { + } + + /** {@inheritDoc} */ + @Override + public ClusterPoolResourcePropertiesNetworkProfile withSubnetId(String subnetId) { + super.withSubnetId(subnetId); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolVersion.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolVersion.java new file mode 100644 index 000000000000..ac6e09566331 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolVersion.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolVersionInner; + +/** An immutable client-side representation of ClusterPoolVersion. */ +public interface ClusterPoolVersion { + /** + * 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 clusterPoolVersion property: Cluster pool version is a 2-part version. + * + * @return the clusterPoolVersion value. + */ + String clusterPoolVersion(); + + /** + * Gets the aksVersion property: AKS version. + * + * @return the aksVersion value. + */ + String aksVersion(); + + /** + * Gets the isPreview property: Indicate if this version is in preview or not. + * + * @return the isPreview value. + */ + Boolean isPreview(); + + /** + * Gets the inner + * com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolVersionInner object. + * + * @return the inner object. + */ + ClusterPoolVersionInner innerModel(); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolVersionsListResult.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolVersionsListResult.java new file mode 100644 index 000000000000..68a3d7ef46cd --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPoolVersionsListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterPoolVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a list of cluster pool versions. */ +@Fluent +public final class ClusterPoolVersionsListResult { + /* + * The list of cluster pool versions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ClusterPoolVersionsListResult class. */ + public ClusterPoolVersionsListResult() { + } + + /** + * Get the value property: The list of cluster pool versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of cluster pool versions. + * + * @param value the value value to set. + * @return the ClusterPoolVersionsListResult object itself. + */ + public ClusterPoolVersionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link (url) to the next page of 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPools.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPools.java new file mode 100644 index 000000000000..a2b4bcfe839a --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPools.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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 ClusterPools. */ +public interface ClusterPools { + /** + * Gets a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 a cluster pool along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterPoolName, Context context); + + /** + * Gets a cluster pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 a cluster pool. + */ + ClusterPool getByResourceGroup(String resourceGroupName, String clusterPoolName); + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 deleteByResourceGroup(String resourceGroupName, String clusterPoolName); + + /** + * Deletes a Cluster Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterPoolName, Context context); + + /** + * Gets the list of Cluster Pools within a 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 the list of Cluster Pools within a Subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets the list of Cluster Pools within a 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 the list of Cluster Pools within a Subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Lists the HDInsight cluster pools under a 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 list cluster pools operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the HDInsight cluster pools under a 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 list cluster pools operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets a cluster 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 a cluster pool along with {@link Response}. + */ + ClusterPool getById(String id); + + /** + * Gets a cluster 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 a cluster pool along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a Cluster 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. + */ + void deleteById(String id); + + /** + * Deletes a Cluster 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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ClusterPool resource. + * + * @param name resource name. + * @return the first stage of the new ClusterPool definition. + */ + ClusterPool.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterProfile.java new file mode 100644 index 000000000000..d4e9eb6341e2 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterProfile.java @@ -0,0 +1,571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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.List; +import java.util.Map; + +/** Cluster profile. */ +@Fluent +public final class ClusterProfile { + /* + * Version with 3/4 part. + */ + @JsonProperty(value = "clusterVersion", required = true) + private String clusterVersion; + + /* + * Version with three part. + */ + @JsonProperty(value = "ossVersion", required = true) + private String ossVersion; + + /* + * Component list of this cluster type and version. + */ + @JsonProperty(value = "components", access = JsonProperty.Access.WRITE_ONLY) + private List components; + + /* + * Identity Profile with details of an MSI. + */ + @JsonProperty(value = "identityProfile", required = true) + private IdentityProfile identityProfile; + + /* + * Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. + */ + @JsonProperty(value = "authorizationProfile", required = true) + private AuthorizationProfile authorizationProfile; + + /* + * The cluster secret profile. + */ + @JsonProperty(value = "secretsProfile") + private SecretsProfile secretsProfile; + + /* + * The service configs profiles. + */ + @JsonProperty(value = "serviceConfigsProfiles") + private List serviceConfigsProfiles; + + /* + * Cluster connectivity profile. + */ + @JsonProperty(value = "connectivityProfile", access = JsonProperty.Access.WRITE_ONLY) + private ConnectivityProfile connectivityProfile; + + /* + * Cluster log analytics profile to enable or disable OMS agent for cluster. + */ + @JsonProperty(value = "logAnalyticsProfile") + private ClusterLogAnalyticsProfile logAnalyticsProfile; + + /* + * Cluster Prometheus profile. + */ + @JsonProperty(value = "prometheusProfile") + private ClusterPrometheusProfile prometheusProfile; + + /* + * Ssh profile for the cluster. + */ + @JsonProperty(value = "sshProfile") + private SshProfile sshProfile; + + /* + * This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with + * Autoscale. + */ + @JsonProperty(value = "autoscaleProfile") + private AutoscaleProfile autoscaleProfile; + + /* + * Kafka cluster profile. + */ + @JsonProperty(value = "kafkaProfile") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map kafkaProfile; + + /* + * Trino Cluster profile. + */ + @JsonProperty(value = "trinoProfile") + private TrinoProfile trinoProfile; + + /* + * LLAP cluster profile. + */ + @JsonProperty(value = "llapProfile") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map llapProfile; + + /* + * The Flink cluster profile. + */ + @JsonProperty(value = "flinkProfile") + private FlinkProfile flinkProfile; + + /* + * The spark cluster profile. + */ + @JsonProperty(value = "sparkProfile") + private SparkProfile sparkProfile; + + /* + * Stub cluster profile. + */ + @JsonProperty(value = "stubProfile") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map stubProfile; + + /* + * The script action profile list. + */ + @JsonProperty(value = "scriptActionProfiles") + private List scriptActionProfiles; + + /** Creates an instance of ClusterProfile class. */ + public ClusterProfile() { + } + + /** + * Get the clusterVersion property: Version with 3/4 part. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the clusterVersion property: Version with 3/4 part. + * + * @param clusterVersion the clusterVersion value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the ossVersion property: Version with three part. + * + * @return the ossVersion value. + */ + public String ossVersion() { + return this.ossVersion; + } + + /** + * Set the ossVersion property: Version with three part. + * + * @param ossVersion the ossVersion value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withOssVersion(String ossVersion) { + this.ossVersion = ossVersion; + return this; + } + + /** + * Get the components property: Component list of this cluster type and version. + * + * @return the components value. + */ + public List components() { + return this.components; + } + + /** + * Get the identityProfile property: Identity Profile with details of an MSI. + * + * @return the identityProfile value. + */ + public IdentityProfile identityProfile() { + return this.identityProfile; + } + + /** + * Set the identityProfile property: Identity Profile with details of an MSI. + * + * @param identityProfile the identityProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withIdentityProfile(IdentityProfile identityProfile) { + this.identityProfile = identityProfile; + return this; + } + + /** + * Get the authorizationProfile property: Authorization profile with details of AAD user Ids and group Ids + * authorized for data plane access. + * + * @return the authorizationProfile value. + */ + public AuthorizationProfile authorizationProfile() { + return this.authorizationProfile; + } + + /** + * Set the authorizationProfile property: Authorization profile with details of AAD user Ids and group Ids + * authorized for data plane access. + * + * @param authorizationProfile the authorizationProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withAuthorizationProfile(AuthorizationProfile authorizationProfile) { + this.authorizationProfile = authorizationProfile; + return this; + } + + /** + * Get the secretsProfile property: The cluster secret profile. + * + * @return the secretsProfile value. + */ + public SecretsProfile secretsProfile() { + return this.secretsProfile; + } + + /** + * Set the secretsProfile property: The cluster secret profile. + * + * @param secretsProfile the secretsProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withSecretsProfile(SecretsProfile secretsProfile) { + this.secretsProfile = secretsProfile; + return this; + } + + /** + * Get the serviceConfigsProfiles property: The service configs profiles. + * + * @return the serviceConfigsProfiles value. + */ + public List serviceConfigsProfiles() { + return this.serviceConfigsProfiles; + } + + /** + * Set the serviceConfigsProfiles property: The service configs profiles. + * + * @param serviceConfigsProfiles the serviceConfigsProfiles value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withServiceConfigsProfiles(List serviceConfigsProfiles) { + this.serviceConfigsProfiles = serviceConfigsProfiles; + return this; + } + + /** + * Get the connectivityProfile property: Cluster connectivity profile. + * + * @return the connectivityProfile value. + */ + public ConnectivityProfile connectivityProfile() { + return this.connectivityProfile; + } + + /** + * Get the logAnalyticsProfile property: Cluster log analytics profile to enable or disable OMS agent for cluster. + * + * @return the logAnalyticsProfile value. + */ + public ClusterLogAnalyticsProfile logAnalyticsProfile() { + return this.logAnalyticsProfile; + } + + /** + * Set the logAnalyticsProfile property: Cluster log analytics profile to enable or disable OMS agent for cluster. + * + * @param logAnalyticsProfile the logAnalyticsProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withLogAnalyticsProfile(ClusterLogAnalyticsProfile logAnalyticsProfile) { + this.logAnalyticsProfile = logAnalyticsProfile; + return this; + } + + /** + * Get the prometheusProfile property: Cluster Prometheus profile. + * + * @return the prometheusProfile value. + */ + public ClusterPrometheusProfile prometheusProfile() { + return this.prometheusProfile; + } + + /** + * Set the prometheusProfile property: Cluster Prometheus profile. + * + * @param prometheusProfile the prometheusProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withPrometheusProfile(ClusterPrometheusProfile prometheusProfile) { + this.prometheusProfile = prometheusProfile; + return this; + } + + /** + * Get the sshProfile property: Ssh profile for the cluster. + * + * @return the sshProfile value. + */ + public SshProfile sshProfile() { + return this.sshProfile; + } + + /** + * Set the sshProfile property: Ssh profile for the cluster. + * + * @param sshProfile the sshProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withSshProfile(SshProfile sshProfile) { + this.sshProfile = sshProfile; + return this; + } + + /** + * Get the autoscaleProfile property: This is the Autoscale profile for the cluster. This will allow customer to + * create cluster enabled with Autoscale. + * + * @return the autoscaleProfile value. + */ + public AutoscaleProfile autoscaleProfile() { + return this.autoscaleProfile; + } + + /** + * Set the autoscaleProfile property: This is the Autoscale profile for the cluster. This will allow customer to + * create cluster enabled with Autoscale. + * + * @param autoscaleProfile the autoscaleProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withAutoscaleProfile(AutoscaleProfile autoscaleProfile) { + this.autoscaleProfile = autoscaleProfile; + return this; + } + + /** + * Get the kafkaProfile property: Kafka cluster profile. + * + * @return the kafkaProfile value. + */ + public Map kafkaProfile() { + return this.kafkaProfile; + } + + /** + * Set the kafkaProfile property: Kafka cluster profile. + * + * @param kafkaProfile the kafkaProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withKafkaProfile(Map kafkaProfile) { + this.kafkaProfile = kafkaProfile; + return this; + } + + /** + * Get the trinoProfile property: Trino Cluster profile. + * + * @return the trinoProfile value. + */ + public TrinoProfile trinoProfile() { + return this.trinoProfile; + } + + /** + * Set the trinoProfile property: Trino Cluster profile. + * + * @param trinoProfile the trinoProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withTrinoProfile(TrinoProfile trinoProfile) { + this.trinoProfile = trinoProfile; + return this; + } + + /** + * Get the llapProfile property: LLAP cluster profile. + * + * @return the llapProfile value. + */ + public Map llapProfile() { + return this.llapProfile; + } + + /** + * Set the llapProfile property: LLAP cluster profile. + * + * @param llapProfile the llapProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withLlapProfile(Map llapProfile) { + this.llapProfile = llapProfile; + return this; + } + + /** + * Get the flinkProfile property: The Flink cluster profile. + * + * @return the flinkProfile value. + */ + public FlinkProfile flinkProfile() { + return this.flinkProfile; + } + + /** + * Set the flinkProfile property: The Flink cluster profile. + * + * @param flinkProfile the flinkProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withFlinkProfile(FlinkProfile flinkProfile) { + this.flinkProfile = flinkProfile; + return this; + } + + /** + * Get the sparkProfile property: The spark cluster profile. + * + * @return the sparkProfile value. + */ + public SparkProfile sparkProfile() { + return this.sparkProfile; + } + + /** + * Set the sparkProfile property: The spark cluster profile. + * + * @param sparkProfile the sparkProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withSparkProfile(SparkProfile sparkProfile) { + this.sparkProfile = sparkProfile; + return this; + } + + /** + * Get the stubProfile property: Stub cluster profile. + * + * @return the stubProfile value. + */ + public Map stubProfile() { + return this.stubProfile; + } + + /** + * Set the stubProfile property: Stub cluster profile. + * + * @param stubProfile the stubProfile value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withStubProfile(Map stubProfile) { + this.stubProfile = stubProfile; + return this; + } + + /** + * Get the scriptActionProfiles property: The script action profile list. + * + * @return the scriptActionProfiles value. + */ + public List scriptActionProfiles() { + return this.scriptActionProfiles; + } + + /** + * Set the scriptActionProfiles property: The script action profile list. + * + * @param scriptActionProfiles the scriptActionProfiles value to set. + * @return the ClusterProfile object itself. + */ + public ClusterProfile withScriptActionProfiles(List scriptActionProfiles) { + this.scriptActionProfiles = scriptActionProfiles; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property clusterVersion in model ClusterProfile")); + } + if (ossVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ossVersion in model ClusterProfile")); + } + if (components() != null) { + components().forEach(e -> e.validate()); + } + if (identityProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property identityProfile in model ClusterProfile")); + } else { + identityProfile().validate(); + } + if (authorizationProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property authorizationProfile in model ClusterProfile")); + } else { + authorizationProfile().validate(); + } + if (secretsProfile() != null) { + secretsProfile().validate(); + } + if (serviceConfigsProfiles() != null) { + serviceConfigsProfiles().forEach(e -> e.validate()); + } + if (connectivityProfile() != null) { + connectivityProfile().validate(); + } + if (logAnalyticsProfile() != null) { + logAnalyticsProfile().validate(); + } + if (prometheusProfile() != null) { + prometheusProfile().validate(); + } + if (sshProfile() != null) { + sshProfile().validate(); + } + if (autoscaleProfile() != null) { + autoscaleProfile().validate(); + } + if (trinoProfile() != null) { + trinoProfile().validate(); + } + if (flinkProfile() != null) { + flinkProfile().validate(); + } + if (sparkProfile() != null) { + sparkProfile().validate(); + } + if (scriptActionProfiles() != null) { + scriptActionProfiles().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPrometheusProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPrometheusProfile.java new file mode 100644 index 000000000000..032e8de7a59c --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterPrometheusProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster Prometheus profile. */ +@Fluent +public final class ClusterPrometheusProfile { + /* + * Enable Prometheus for cluster or not. + */ + @JsonProperty(value = "enabled", required = true) + private boolean enabled; + + /** Creates an instance of ClusterPrometheusProfile class. */ + public ClusterPrometheusProfile() { + } + + /** + * Get the enabled property: Enable Prometheus for cluster or not. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Enable Prometheus for cluster or not. + * + * @param enabled the enabled value to set. + * @return the ClusterPrometheusProfile object itself. + */ + public ClusterPrometheusProfile 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterResizeData.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterResizeData.java new file mode 100644 index 000000000000..8a1faccf03ec --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterResizeData.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterResizeProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The parameters for resizing a cluster. */ +@Fluent +public final class ClusterResizeData extends Resource { + /* + * Sets the properties. Define cluster resize specific properties. + */ + @JsonProperty(value = "properties") + private ClusterResizeProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ClusterResizeData class. */ + public ClusterResizeData() { + } + + /** + * Get the innerProperties property: Sets the properties. Define cluster resize specific properties. + * + * @return the innerProperties value. + */ + private ClusterResizeProperties 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 ClusterResizeData withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterResizeData withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the targetWorkerNodeCount property: Target node count of worker node. + * + * @return the targetWorkerNodeCount value. + */ + public Integer targetWorkerNodeCount() { + return this.innerProperties() == null ? null : this.innerProperties().targetWorkerNodeCount(); + } + + /** + * Set the targetWorkerNodeCount property: Target node count of worker node. + * + * @param targetWorkerNodeCount the targetWorkerNodeCount value to set. + * @return the ClusterResizeData object itself. + */ + public ClusterResizeData withTargetWorkerNodeCount(Integer targetWorkerNodeCount) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterResizeProperties(); + } + this.innerProperties().withTargetWorkerNodeCount(targetWorkerNodeCount); + 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterServiceConfig.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterServiceConfig.java new file mode 100644 index 000000000000..b7b6189aaac6 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterServiceConfig.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster configs per component. */ +@Fluent +public final class ClusterServiceConfig { + /* + * Name of the component the config files should apply to. + */ + @JsonProperty(value = "component", required = true) + private String component; + + /* + * List of Config Files. + */ + @JsonProperty(value = "files", required = true) + private List files; + + /** Creates an instance of ClusterServiceConfig class. */ + public ClusterServiceConfig() { + } + + /** + * Get the component property: Name of the component the config files should apply to. + * + * @return the component value. + */ + public String component() { + return this.component; + } + + /** + * Set the component property: Name of the component the config files should apply to. + * + * @param component the component value to set. + * @return the ClusterServiceConfig object itself. + */ + public ClusterServiceConfig withComponent(String component) { + this.component = component; + return this; + } + + /** + * Get the files property: List of Config Files. + * + * @return the files value. + */ + public List files() { + return this.files; + } + + /** + * Set the files property: List of Config Files. + * + * @param files the files value to set. + * @return the ClusterServiceConfig object itself. + */ + public ClusterServiceConfig withFiles(List files) { + this.files = files; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (component() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property component in model ClusterServiceConfig")); + } + if (files() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property files in model ClusterServiceConfig")); + } else { + files().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterServiceConfig.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterServiceConfigsProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterServiceConfigsProfile.java new file mode 100644 index 000000000000..08e9e8c91177 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterServiceConfigsProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster service configs. */ +@Fluent +public final class ClusterServiceConfigsProfile { + /* + * Name of the service the configurations should apply to. + */ + @JsonProperty(value = "serviceName", required = true) + private String serviceName; + + /* + * List of service configs. + */ + @JsonProperty(value = "configs", required = true) + private List configs; + + /** Creates an instance of ClusterServiceConfigsProfile class. */ + public ClusterServiceConfigsProfile() { + } + + /** + * Get the serviceName property: Name of the service the configurations should apply to. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: Name of the service the configurations should apply to. + * + * @param serviceName the serviceName value to set. + * @return the ClusterServiceConfigsProfile object itself. + */ + public ClusterServiceConfigsProfile withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the configs property: List of service configs. + * + * @return the configs value. + */ + public List configs() { + return this.configs; + } + + /** + * Set the configs property: List of service configs. + * + * @param configs the configs value to set. + * @return the ClusterServiceConfigsProfile object itself. + */ + public ClusterServiceConfigsProfile withConfigs(List configs) { + this.configs = configs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceName in model ClusterServiceConfigsProfile")); + } + if (configs() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property configs in model ClusterServiceConfigsProfile")); + } else { + configs().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ClusterServiceConfigsProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterVersion.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterVersion.java new file mode 100644 index 000000000000..9a5d79818c5b --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterVersion.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterVersionInner; +import java.util.List; + +/** An immutable client-side representation of ClusterVersion. */ +public interface ClusterVersion { + /** + * 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 clusterType property: The type of cluster. + * + * @return the clusterType value. + */ + String clusterType(); + + /** + * Gets the clusterVersion property: Version with three part. + * + * @return the clusterVersion value. + */ + String clusterVersion(); + + /** + * Gets the ossVersion property: Version with three part. + * + * @return the ossVersion value. + */ + String ossVersion(); + + /** + * Gets the clusterPoolVersion property: The two part cluster pool version. If the cluster version is before cluster + * pool version on-board, the return value will be empty string. + * + * @return the clusterPoolVersion value. + */ + String clusterPoolVersion(); + + /** + * Gets the isPreview property: Indicate if this version is in preview or not. + * + * @return the isPreview value. + */ + Boolean isPreview(); + + /** + * Gets the components property: Component list of this cluster type and version. + * + * @return the components value. + */ + List components(); + + /** + * Gets the inner + * com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterVersionInner object. + * + * @return the inner object. + */ + ClusterVersionInner innerModel(); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterVersionsListResult.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterVersionsListResult.java new file mode 100644 index 000000000000..47a280852100 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ClusterVersionsListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents a list of cluster versions. */ +@Fluent +public final class ClusterVersionsListResult { + /* + * The list of cluster versions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ClusterVersionsListResult class. */ + public ClusterVersionsListResult() { + } + + /** + * Get the value property: The list of cluster versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of cluster versions. + * + * @param value the value value to set. + * @return the ClusterVersionsListResult object itself. + */ + public ClusterVersionsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link (url) to the next page of 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Clusters.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Clusters.java new file mode 100644 index 000000000000..d09cfed46d61 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Clusters.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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 Clusters. */ +public interface Clusters { + /** + * Lists the HDInsight cluster pools under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 list cluster operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listByClusterPoolName(String resourceGroupName, String clusterPoolName); + + /** + * Lists the HDInsight cluster pools under a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster 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 list cluster operation response as paginated response with {@link PagedIterable}. + */ + PagedIterable listByClusterPoolName(String resourceGroupName, String clusterPoolName, Context context); + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize a 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 cluster. + */ + Cluster resize( + String resourceGroupName, String clusterPoolName, String clusterName, ClusterResizeData clusterResizeRequest); + + /** + * Resize an existing Cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight cluster. + * @param clusterResizeRequest Resize 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. + * @return the cluster. + */ + Cluster resize( + String resourceGroupName, + String clusterPoolName, + String clusterName, + ClusterResizeData clusterResizeRequest, + Context context); + + /** + * Gets a HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 HDInsight cluster along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Gets a HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 a HDInsight cluster. + */ + Cluster get(String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 delete(String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Deletes a cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 delete(String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Lists the config dump of all services running in cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 cluster instance service configs api response as paginated response with {@link PagedIterable}. + */ + PagedIterable listServiceConfigs( + String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Lists the config dump of all services running in cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 cluster instance service configs api response as paginated response with {@link PagedIterable}. + */ + PagedIterable listServiceConfigs( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Lists the lists of instance views. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 instance view of a HDInsight Cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listInstanceViews( + String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Lists the lists of instance views. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 instance view of a HDInsight Cluster as paginated response with {@link PagedIterable}. + */ + PagedIterable listInstanceViews( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Gets the status of a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 status of a cluster instance along with {@link Response}. + */ + Response getInstanceViewWithResponse( + String resourceGroupName, String clusterPoolName, String clusterName, Context context); + + /** + * Gets the status of a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterPoolName The name of the cluster pool. + * @param clusterName The name of the HDInsight 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 status of a cluster instance. + */ + ClusterInstanceViewResult getInstanceView(String resourceGroupName, String clusterPoolName, String clusterName); + + /** + * Gets a HDInsight 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 HDInsight cluster along with {@link Response}. + */ + Cluster getById(String id); + + /** + * Gets a HDInsight 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 HDInsight cluster along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a 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 cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Cluster resource. + * + * @param name resource name. + * @return the first stage of the new Cluster definition. + */ + Cluster.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComparisonOperator.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComparisonOperator.java new file mode 100644 index 000000000000..893efafd2f7b --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComparisonOperator.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The comparison operator. */ +public final class ComparisonOperator extends ExpandableStringEnum { + /** Static value greaterThan for ComparisonOperator. */ + public static final ComparisonOperator GREATER_THAN = fromString("greaterThan"); + + /** Static value greaterThanOrEqual for ComparisonOperator. */ + public static final ComparisonOperator GREATER_THAN_OR_EQUAL = fromString("greaterThanOrEqual"); + + /** Static value lessThan for ComparisonOperator. */ + public static final ComparisonOperator LESS_THAN = fromString("lessThan"); + + /** Static value lessThanOrEqual for ComparisonOperator. */ + public static final ComparisonOperator LESS_THAN_OR_EQUAL = fromString("lessThanOrEqual"); + + /** + * Creates a new instance of ComparisonOperator value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ComparisonOperator() { + } + + /** + * Creates or finds a ComparisonOperator from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComparisonOperator. + */ + @JsonCreator + public static ComparisonOperator fromString(String name) { + return fromString(name, ComparisonOperator.class); + } + + /** + * Gets known ComparisonOperator values. + * + * @return known ComparisonOperator values. + */ + public static Collection values() { + return values(ComparisonOperator.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComparisonRule.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComparisonRule.java new file mode 100644 index 000000000000..93928e827a71 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComparisonRule.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The comparison rule. */ +@Fluent +public final class ComparisonRule { + /* + * The comparison operator. + */ + @JsonProperty(value = "operator", required = true) + private ComparisonOperator operator; + + /* + * Threshold setting. + */ + @JsonProperty(value = "threshold", required = true) + private float threshold; + + /** Creates an instance of ComparisonRule class. */ + public ComparisonRule() { + } + + /** + * Get the operator property: The comparison operator. + * + * @return the operator value. + */ + public ComparisonOperator operator() { + return this.operator; + } + + /** + * Set the operator property: The comparison operator. + * + * @param operator the operator value to set. + * @return the ComparisonRule object itself. + */ + public ComparisonRule withOperator(ComparisonOperator operator) { + this.operator = operator; + return this; + } + + /** + * Get the threshold property: Threshold setting. + * + * @return the threshold value. + */ + public float threshold() { + return this.threshold; + } + + /** + * Set the threshold property: Threshold setting. + * + * @param threshold the threshold value to set. + * @return the ComparisonRule object itself. + */ + public ComparisonRule withThreshold(float threshold) { + this.threshold = threshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operator() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property operator in model ComparisonRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ComparisonRule.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComputeProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComputeProfile.java new file mode 100644 index 000000000000..03e0c686292f --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComputeProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.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 compute profile. */ +@Fluent +public final class ComputeProfile { + /* + * The nodes definitions. + */ + @JsonProperty(value = "nodes", required = true) + private List nodes; + + /** Creates an instance of ComputeProfile class. */ + public ComputeProfile() { + } + + /** + * Get the nodes property: The nodes definitions. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Set the nodes property: The nodes definitions. + * + * @param nodes the nodes value to set. + * @return the ComputeProfile object itself. + */ + public ComputeProfile withNodes(List nodes) { + this.nodes = nodes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodes() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property nodes in model ComputeProfile")); + } else { + nodes().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ComputeProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComputeResourceDefinition.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComputeResourceDefinition.java new file mode 100644 index 000000000000..0058586d5695 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ComputeResourceDefinition.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The cpu and memory requirement definition. */ +@Fluent +public final class ComputeResourceDefinition { + /* + * The required CPU. + */ + @JsonProperty(value = "cpu", required = true) + private float cpu; + + /* + * The required memory in MB, Container memory will be 110 percentile + */ + @JsonProperty(value = "memory", required = true) + private long memory; + + /** Creates an instance of ComputeResourceDefinition class. */ + public ComputeResourceDefinition() { + } + + /** + * Get the cpu property: The required CPU. + * + * @return the cpu value. + */ + public float cpu() { + return this.cpu; + } + + /** + * Set the cpu property: The required CPU. + * + * @param cpu the cpu value to set. + * @return the ComputeResourceDefinition object itself. + */ + public ComputeResourceDefinition withCpu(float cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the memory property: The required memory in MB, Container memory will be 110 percentile. + * + * @return the memory value. + */ + public long memory() { + return this.memory; + } + + /** + * Set the memory property: The required memory in MB, Container memory will be 110 percentile. + * + * @param memory the memory value to set. + * @return the ComputeResourceDefinition object itself. + */ + public ComputeResourceDefinition withMemory(long memory) { + this.memory = memory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ConnectivityProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ConnectivityProfile.java new file mode 100644 index 000000000000..71ce745c442a --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ConnectivityProfile.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster connectivity profile. */ +@Fluent +public final class ConnectivityProfile { + /* + * Web connectivity endpoint details. + */ + @JsonProperty(value = "web", required = true) + private ConnectivityProfileWeb web; + + /* + * List of SSH connectivity endpoints. + */ + @JsonProperty(value = "ssh") + private List ssh; + + /** Creates an instance of ConnectivityProfile class. */ + public ConnectivityProfile() { + } + + /** + * Get the web property: Web connectivity endpoint details. + * + * @return the web value. + */ + public ConnectivityProfileWeb web() { + return this.web; + } + + /** + * Set the web property: Web connectivity endpoint details. + * + * @param web the web value to set. + * @return the ConnectivityProfile object itself. + */ + public ConnectivityProfile withWeb(ConnectivityProfileWeb web) { + this.web = web; + return this; + } + + /** + * Get the ssh property: List of SSH connectivity endpoints. + * + * @return the ssh value. + */ + public List ssh() { + return this.ssh; + } + + /** + * Set the ssh property: List of SSH connectivity endpoints. + * + * @param ssh the ssh value to set. + * @return the ConnectivityProfile object itself. + */ + public ConnectivityProfile withSsh(List ssh) { + this.ssh = ssh; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (web() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property web in model ConnectivityProfile")); + } else { + web().validate(); + } + if (ssh() != null) { + ssh().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConnectivityProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ConnectivityProfileWeb.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ConnectivityProfileWeb.java new file mode 100644 index 000000000000..9452305ac0f9 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ConnectivityProfileWeb.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; + +/** Web connectivity endpoint details. */ +@Fluent +public final class ConnectivityProfileWeb extends WebConnectivityEndpoint { + /** Creates an instance of ConnectivityProfileWeb class. */ + public ConnectivityProfileWeb() { + } + + /** {@inheritDoc} */ + @Override + public ConnectivityProfileWeb withFqdn(String fqdn) { + super.withFqdn(fqdn); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ContentEncoding.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ContentEncoding.java new file mode 100644 index 000000000000..c20a8d8e2da5 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ContentEncoding.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * This property indicates if the content is encoded and is case-insensitive. Please set the value to base64 if the + * content is base64 encoded. Set it to none or skip it if the content is plain text. + */ +public final class ContentEncoding extends ExpandableStringEnum { + /** Static value Base64 for ContentEncoding. */ + public static final ContentEncoding BASE64 = fromString("Base64"); + + /** Static value None for ContentEncoding. */ + public static final ContentEncoding NONE = fromString("None"); + + /** + * Creates a new instance of ContentEncoding value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContentEncoding() { + } + + /** + * Creates or finds a ContentEncoding from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContentEncoding. + */ + @JsonCreator + public static ContentEncoding fromString(String name) { + return fromString(name, ContentEncoding.class); + } + + /** + * Gets known ContentEncoding values. + * + * @return known ContentEncoding values. + */ + public static Collection values() { + return values(ContentEncoding.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkCatalogOptions.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkCatalogOptions.java new file mode 100644 index 000000000000..476c351a53dd --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkCatalogOptions.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Flink cluster catalog options. */ +@Fluent +public final class FlinkCatalogOptions { + /* + * Hive Catalog Option for Flink cluster. + */ + @JsonProperty(value = "hive") + private FlinkHiveCatalogOption hive; + + /** Creates an instance of FlinkCatalogOptions class. */ + public FlinkCatalogOptions() { + } + + /** + * Get the hive property: Hive Catalog Option for Flink cluster. + * + * @return the hive value. + */ + public FlinkHiveCatalogOption hive() { + return this.hive; + } + + /** + * Set the hive property: Hive Catalog Option for Flink cluster. + * + * @param hive the hive value to set. + * @return the FlinkCatalogOptions object itself. + */ + public FlinkCatalogOptions withHive(FlinkHiveCatalogOption hive) { + this.hive = hive; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hive() != null) { + hive().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkHiveCatalogOption.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkHiveCatalogOption.java new file mode 100644 index 000000000000..c437610f8c7f --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkHiveCatalogOption.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Hive Catalog Option for Flink cluster. */ +@Fluent +public final class FlinkHiveCatalogOption { + /* + * Secret reference name from secretsProfile.secrets containing password for database connection. + */ + @JsonProperty(value = "metastoreDbConnectionPasswordSecret", required = true) + private String metastoreDbConnectionPasswordSecret; + + /* + * Connection string for hive metastore database. + */ + @JsonProperty(value = "metastoreDbConnectionURL", required = true) + private String metastoreDbConnectionUrl; + + /* + * User name for database connection. + */ + @JsonProperty(value = "metastoreDbConnectionUserName", required = true) + private String metastoreDbConnectionUsername; + + /** Creates an instance of FlinkHiveCatalogOption class. */ + public FlinkHiveCatalogOption() { + } + + /** + * Get the metastoreDbConnectionPasswordSecret property: Secret reference name from secretsProfile.secrets + * containing password for database connection. + * + * @return the metastoreDbConnectionPasswordSecret value. + */ + public String metastoreDbConnectionPasswordSecret() { + return this.metastoreDbConnectionPasswordSecret; + } + + /** + * Set the metastoreDbConnectionPasswordSecret property: Secret reference name from secretsProfile.secrets + * containing password for database connection. + * + * @param metastoreDbConnectionPasswordSecret the metastoreDbConnectionPasswordSecret value to set. + * @return the FlinkHiveCatalogOption object itself. + */ + public FlinkHiveCatalogOption withMetastoreDbConnectionPasswordSecret(String metastoreDbConnectionPasswordSecret) { + this.metastoreDbConnectionPasswordSecret = metastoreDbConnectionPasswordSecret; + return this; + } + + /** + * Get the metastoreDbConnectionUrl property: Connection string for hive metastore database. + * + * @return the metastoreDbConnectionUrl value. + */ + public String metastoreDbConnectionUrl() { + return this.metastoreDbConnectionUrl; + } + + /** + * Set the metastoreDbConnectionUrl property: Connection string for hive metastore database. + * + * @param metastoreDbConnectionUrl the metastoreDbConnectionUrl value to set. + * @return the FlinkHiveCatalogOption object itself. + */ + public FlinkHiveCatalogOption withMetastoreDbConnectionUrl(String metastoreDbConnectionUrl) { + this.metastoreDbConnectionUrl = metastoreDbConnectionUrl; + return this; + } + + /** + * Get the metastoreDbConnectionUsername property: User name for database connection. + * + * @return the metastoreDbConnectionUsername value. + */ + public String metastoreDbConnectionUsername() { + return this.metastoreDbConnectionUsername; + } + + /** + * Set the metastoreDbConnectionUsername property: User name for database connection. + * + * @param metastoreDbConnectionUsername the metastoreDbConnectionUsername value to set. + * @return the FlinkHiveCatalogOption object itself. + */ + public FlinkHiveCatalogOption withMetastoreDbConnectionUsername(String metastoreDbConnectionUsername) { + this.metastoreDbConnectionUsername = metastoreDbConnectionUsername; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metastoreDbConnectionPasswordSecret() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metastoreDbConnectionPasswordSecret in model" + + " FlinkHiveCatalogOption")); + } + if (metastoreDbConnectionUrl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metastoreDbConnectionUrl in model FlinkHiveCatalogOption")); + } + if (metastoreDbConnectionUsername() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metastoreDbConnectionUsername in model FlinkHiveCatalogOption")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlinkHiveCatalogOption.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkJobProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkJobProperties.java new file mode 100644 index 000000000000..c77622516ab7 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkJobProperties.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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 com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Map; + +/** Properties of flink job. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "jobType") +@JsonTypeName("FlinkJob") +@Fluent +public final class FlinkJobProperties extends ClusterJobProperties { + /* + * Name of job + */ + @JsonProperty(value = "jobName", required = true) + private String jobName; + + /* + * A string property that specifies the directory where the job JAR is located. + */ + @JsonProperty(value = "jobJarDirectory") + private String jobJarDirectory; + + /* + * A string property that represents the name of the job JAR. + */ + @JsonProperty(value = "jarName") + private String jarName; + + /* + * A string property that specifies the entry class for the Flink job. + */ + @JsonProperty(value = "entryClass") + private String entryClass; + + /* + * A string property representing additional JVM arguments for the Flink job. It should be space separated value. + */ + @JsonProperty(value = "args") + private String args; + + /* + * A string property that represents the name of the savepoint for the Flink job + */ + @JsonProperty(value = "savePointName") + private String savePointName; + + /* + * A string property that indicates the action to be performed on the Flink job. It can have one of the following + * enum values => NEW, UPDATE, STATELESS_UPDATE, STOP, START, CANCEL, SAVEPOINT, LIST_SAVEPOINT, or DELETE. + */ + @JsonProperty(value = "action") + private Action action; + + /* + * Additional properties used to configure Flink jobs. It allows users to set properties such as parallelism and + * jobSavePointDirectory. It accepts additional key-value pairs as properties, where the keys are strings and the + * values are strings as well. + */ + @JsonProperty(value = "flinkConfiguration") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map flinkConfiguration; + + /* + * Unique id for identifying a job + */ + @JsonProperty(value = "jobId", access = JsonProperty.Access.WRITE_ONLY) + private String jobId; + + /* + * Status of job. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Output of job. + */ + @JsonProperty(value = "jobOutput", access = JsonProperty.Access.WRITE_ONLY) + private String jobOutput; + + /* + * Action result of job. + */ + @JsonProperty(value = "actionResult", access = JsonProperty.Access.WRITE_ONLY) + private String actionResult; + + /* + * The last savepoint. + */ + @JsonProperty(value = "lastSavePoint", access = JsonProperty.Access.WRITE_ONLY) + private String lastSavePoint; + + /** Creates an instance of FlinkJobProperties class. */ + public FlinkJobProperties() { + } + + /** + * Get the jobName property: Name of job. + * + * @return the jobName value. + */ + public String jobName() { + return this.jobName; + } + + /** + * Set the jobName property: Name of job. + * + * @param jobName the jobName value to set. + * @return the FlinkJobProperties object itself. + */ + public FlinkJobProperties withJobName(String jobName) { + this.jobName = jobName; + return this; + } + + /** + * Get the jobJarDirectory property: A string property that specifies the directory where the job JAR is located. + * + * @return the jobJarDirectory value. + */ + public String jobJarDirectory() { + return this.jobJarDirectory; + } + + /** + * Set the jobJarDirectory property: A string property that specifies the directory where the job JAR is located. + * + * @param jobJarDirectory the jobJarDirectory value to set. + * @return the FlinkJobProperties object itself. + */ + public FlinkJobProperties withJobJarDirectory(String jobJarDirectory) { + this.jobJarDirectory = jobJarDirectory; + return this; + } + + /** + * Get the jarName property: A string property that represents the name of the job JAR. + * + * @return the jarName value. + */ + public String jarName() { + return this.jarName; + } + + /** + * Set the jarName property: A string property that represents the name of the job JAR. + * + * @param jarName the jarName value to set. + * @return the FlinkJobProperties object itself. + */ + public FlinkJobProperties withJarName(String jarName) { + this.jarName = jarName; + return this; + } + + /** + * Get the entryClass property: A string property that specifies the entry class for the Flink job. + * + * @return the entryClass value. + */ + public String entryClass() { + return this.entryClass; + } + + /** + * Set the entryClass property: A string property that specifies the entry class for the Flink job. + * + * @param entryClass the entryClass value to set. + * @return the FlinkJobProperties object itself. + */ + public FlinkJobProperties withEntryClass(String entryClass) { + this.entryClass = entryClass; + return this; + } + + /** + * Get the args property: A string property representing additional JVM arguments for the Flink job. It should be + * space separated value. + * + * @return the args value. + */ + public String args() { + return this.args; + } + + /** + * Set the args property: A string property representing additional JVM arguments for the Flink job. It should be + * space separated value. + * + * @param args the args value to set. + * @return the FlinkJobProperties object itself. + */ + public FlinkJobProperties withArgs(String args) { + this.args = args; + return this; + } + + /** + * Get the savePointName property: A string property that represents the name of the savepoint for the Flink job. + * + * @return the savePointName value. + */ + public String savePointName() { + return this.savePointName; + } + + /** + * Set the savePointName property: A string property that represents the name of the savepoint for the Flink job. + * + * @param savePointName the savePointName value to set. + * @return the FlinkJobProperties object itself. + */ + public FlinkJobProperties withSavePointName(String savePointName) { + this.savePointName = savePointName; + return this; + } + + /** + * Get the action property: A string property that indicates the action to be performed on the Flink job. It can + * have one of the following enum values => NEW, UPDATE, STATELESS_UPDATE, STOP, START, CANCEL, SAVEPOINT, + * LIST_SAVEPOINT, or DELETE. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: A string property that indicates the action to be performed on the Flink job. It can + * have one of the following enum values => NEW, UPDATE, STATELESS_UPDATE, STOP, START, CANCEL, SAVEPOINT, + * LIST_SAVEPOINT, or DELETE. + * + * @param action the action value to set. + * @return the FlinkJobProperties object itself. + */ + public FlinkJobProperties withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get the flinkConfiguration property: Additional properties used to configure Flink jobs. It allows users to set + * properties such as parallelism and jobSavePointDirectory. It accepts additional key-value pairs as properties, + * where the keys are strings and the values are strings as well. + * + * @return the flinkConfiguration value. + */ + public Map flinkConfiguration() { + return this.flinkConfiguration; + } + + /** + * Set the flinkConfiguration property: Additional properties used to configure Flink jobs. It allows users to set + * properties such as parallelism and jobSavePointDirectory. It accepts additional key-value pairs as properties, + * where the keys are strings and the values are strings as well. + * + * @param flinkConfiguration the flinkConfiguration value to set. + * @return the FlinkJobProperties object itself. + */ + public FlinkJobProperties withFlinkConfiguration(Map flinkConfiguration) { + this.flinkConfiguration = flinkConfiguration; + return this; + } + + /** + * Get the jobId property: Unique id for identifying a job. + * + * @return the jobId value. + */ + public String jobId() { + return this.jobId; + } + + /** + * Get the status property: Status of job. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the jobOutput property: Output of job. + * + * @return the jobOutput value. + */ + public String jobOutput() { + return this.jobOutput; + } + + /** + * Get the actionResult property: Action result of job. + * + * @return the actionResult value. + */ + public String actionResult() { + return this.actionResult; + } + + /** + * Get the lastSavePoint property: The last savepoint. + * + * @return the lastSavePoint value. + */ + public String lastSavePoint() { + return this.lastSavePoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (jobName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property jobName in model FlinkJobProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlinkJobProperties.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkProfile.java new file mode 100644 index 000000000000..db61428a14a6 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Flink cluster profile. */ +@Fluent +public final class FlinkProfile { + /* + * The storage profile + */ + @JsonProperty(value = "storage", required = true) + private FlinkStorageProfile storage; + + /* + * The number of task managers. + */ + @JsonProperty(value = "numReplicas") + private Integer numReplicas; + + /* + * Job Manager container/ process CPU and memory requirements + */ + @JsonProperty(value = "jobManager", required = true) + private ComputeResourceDefinition jobManager; + + /* + * History Server container/ process CPU and memory requirements + */ + @JsonProperty(value = "historyServer") + private ComputeResourceDefinition historyServer; + + /* + * Task Manager container/ process CPU and memory requirements + */ + @JsonProperty(value = "taskManager", required = true) + private ComputeResourceDefinition taskManager; + + /* + * Flink cluster catalog options. + */ + @JsonProperty(value = "catalogOptions") + private FlinkCatalogOptions catalogOptions; + + /** Creates an instance of FlinkProfile class. */ + public FlinkProfile() { + } + + /** + * Get the storage property: The storage profile. + * + * @return the storage value. + */ + public FlinkStorageProfile storage() { + return this.storage; + } + + /** + * Set the storage property: The storage profile. + * + * @param storage the storage value to set. + * @return the FlinkProfile object itself. + */ + public FlinkProfile withStorage(FlinkStorageProfile storage) { + this.storage = storage; + return this; + } + + /** + * Get the numReplicas property: The number of task managers. + * + * @return the numReplicas value. + */ + public Integer numReplicas() { + return this.numReplicas; + } + + /** + * Set the numReplicas property: The number of task managers. + * + * @param numReplicas the numReplicas value to set. + * @return the FlinkProfile object itself. + */ + public FlinkProfile withNumReplicas(Integer numReplicas) { + this.numReplicas = numReplicas; + return this; + } + + /** + * Get the jobManager property: Job Manager container/ process CPU and memory requirements. + * + * @return the jobManager value. + */ + public ComputeResourceDefinition jobManager() { + return this.jobManager; + } + + /** + * Set the jobManager property: Job Manager container/ process CPU and memory requirements. + * + * @param jobManager the jobManager value to set. + * @return the FlinkProfile object itself. + */ + public FlinkProfile withJobManager(ComputeResourceDefinition jobManager) { + this.jobManager = jobManager; + return this; + } + + /** + * Get the historyServer property: History Server container/ process CPU and memory requirements. + * + * @return the historyServer value. + */ + public ComputeResourceDefinition historyServer() { + return this.historyServer; + } + + /** + * Set the historyServer property: History Server container/ process CPU and memory requirements. + * + * @param historyServer the historyServer value to set. + * @return the FlinkProfile object itself. + */ + public FlinkProfile withHistoryServer(ComputeResourceDefinition historyServer) { + this.historyServer = historyServer; + return this; + } + + /** + * Get the taskManager property: Task Manager container/ process CPU and memory requirements. + * + * @return the taskManager value. + */ + public ComputeResourceDefinition taskManager() { + return this.taskManager; + } + + /** + * Set the taskManager property: Task Manager container/ process CPU and memory requirements. + * + * @param taskManager the taskManager value to set. + * @return the FlinkProfile object itself. + */ + public FlinkProfile withTaskManager(ComputeResourceDefinition taskManager) { + this.taskManager = taskManager; + return this; + } + + /** + * Get the catalogOptions property: Flink cluster catalog options. + * + * @return the catalogOptions value. + */ + public FlinkCatalogOptions catalogOptions() { + return this.catalogOptions; + } + + /** + * Set the catalogOptions property: Flink cluster catalog options. + * + * @param catalogOptions the catalogOptions value to set. + * @return the FlinkProfile object itself. + */ + public FlinkProfile withCatalogOptions(FlinkCatalogOptions catalogOptions) { + this.catalogOptions = catalogOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storage() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property storage in model FlinkProfile")); + } else { + storage().validate(); + } + if (jobManager() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property jobManager in model FlinkProfile")); + } else { + jobManager().validate(); + } + if (historyServer() != null) { + historyServer().validate(); + } + if (taskManager() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property taskManager in model FlinkProfile")); + } else { + taskManager().validate(); + } + if (catalogOptions() != null) { + catalogOptions().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlinkProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkStorageProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkStorageProfile.java new file mode 100644 index 000000000000..fcaebe15ca6d --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/FlinkStorageProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The storage profile. */ +@Fluent +public final class FlinkStorageProfile { + /* + * Storage account uri which is used for savepoint and checkpoint state. + */ + @JsonProperty(value = "storageUri", required = true) + private String storageUri; + + /* + * Storage key is only required for wasb(s) storage. + */ + @JsonProperty(value = "storagekey") + private String storagekey; + + /** Creates an instance of FlinkStorageProfile class. */ + public FlinkStorageProfile() { + } + + /** + * Get the storageUri property: Storage account uri which is used for savepoint and checkpoint state. + * + * @return the storageUri value. + */ + public String storageUri() { + return this.storageUri; + } + + /** + * Set the storageUri property: Storage account uri which is used for savepoint and checkpoint state. + * + * @param storageUri the storageUri value to set. + * @return the FlinkStorageProfile object itself. + */ + public FlinkStorageProfile withStorageUri(String storageUri) { + this.storageUri = storageUri; + return this; + } + + /** + * Get the storagekey property: Storage key is only required for wasb(s) storage. + * + * @return the storagekey value. + */ + public String storagekey() { + return this.storagekey; + } + + /** + * Set the storagekey property: Storage key is only required for wasb(s) storage. + * + * @param storagekey the storagekey value to set. + * @return the FlinkStorageProfile object itself. + */ + public FlinkStorageProfile withStoragekey(String storagekey) { + this.storagekey = storagekey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageUri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property storageUri in model FlinkStorageProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FlinkStorageProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/HiveCatalogOption.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/HiveCatalogOption.java new file mode 100644 index 000000000000..f1ee44ac1530 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/HiveCatalogOption.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Hive Catalog Option. */ +@Fluent +public final class HiveCatalogOption { + /* + * Name of trino catalog which should use specified hive metastore. + */ + @JsonProperty(value = "catalogName", required = true) + private String catalogName; + + /* + * Secret reference name from secretsProfile.secrets containing password for database connection. + */ + @JsonProperty(value = "metastoreDbConnectionPasswordSecret", required = true) + private String metastoreDbConnectionPasswordSecret; + + /* + * Connection string for hive metastore database. + */ + @JsonProperty(value = "metastoreDbConnectionURL", required = true) + private String metastoreDbConnectionUrl; + + /* + * User name for database connection. + */ + @JsonProperty(value = "metastoreDbConnectionUserName", required = true) + private String metastoreDbConnectionUsername; + + /* + * Metastore root directory URI, format: abfs[s]://@.dfs.core.windows.net/. More + * details: https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri + */ + @JsonProperty(value = "metastoreWarehouseDir", required = true) + private String metastoreWarehouseDir; + + /** Creates an instance of HiveCatalogOption class. */ + public HiveCatalogOption() { + } + + /** + * Get the catalogName property: Name of trino catalog which should use specified hive metastore. + * + * @return the catalogName value. + */ + public String catalogName() { + return this.catalogName; + } + + /** + * Set the catalogName property: Name of trino catalog which should use specified hive metastore. + * + * @param catalogName the catalogName value to set. + * @return the HiveCatalogOption object itself. + */ + public HiveCatalogOption withCatalogName(String catalogName) { + this.catalogName = catalogName; + return this; + } + + /** + * Get the metastoreDbConnectionPasswordSecret property: Secret reference name from secretsProfile.secrets + * containing password for database connection. + * + * @return the metastoreDbConnectionPasswordSecret value. + */ + public String metastoreDbConnectionPasswordSecret() { + return this.metastoreDbConnectionPasswordSecret; + } + + /** + * Set the metastoreDbConnectionPasswordSecret property: Secret reference name from secretsProfile.secrets + * containing password for database connection. + * + * @param metastoreDbConnectionPasswordSecret the metastoreDbConnectionPasswordSecret value to set. + * @return the HiveCatalogOption object itself. + */ + public HiveCatalogOption withMetastoreDbConnectionPasswordSecret(String metastoreDbConnectionPasswordSecret) { + this.metastoreDbConnectionPasswordSecret = metastoreDbConnectionPasswordSecret; + return this; + } + + /** + * Get the metastoreDbConnectionUrl property: Connection string for hive metastore database. + * + * @return the metastoreDbConnectionUrl value. + */ + public String metastoreDbConnectionUrl() { + return this.metastoreDbConnectionUrl; + } + + /** + * Set the metastoreDbConnectionUrl property: Connection string for hive metastore database. + * + * @param metastoreDbConnectionUrl the metastoreDbConnectionUrl value to set. + * @return the HiveCatalogOption object itself. + */ + public HiveCatalogOption withMetastoreDbConnectionUrl(String metastoreDbConnectionUrl) { + this.metastoreDbConnectionUrl = metastoreDbConnectionUrl; + return this; + } + + /** + * Get the metastoreDbConnectionUsername property: User name for database connection. + * + * @return the metastoreDbConnectionUsername value. + */ + public String metastoreDbConnectionUsername() { + return this.metastoreDbConnectionUsername; + } + + /** + * Set the metastoreDbConnectionUsername property: User name for database connection. + * + * @param metastoreDbConnectionUsername the metastoreDbConnectionUsername value to set. + * @return the HiveCatalogOption object itself. + */ + public HiveCatalogOption withMetastoreDbConnectionUsername(String metastoreDbConnectionUsername) { + this.metastoreDbConnectionUsername = metastoreDbConnectionUsername; + return this; + } + + /** + * Get the metastoreWarehouseDir property: Metastore root directory URI, format: + * abfs[s]://<container>@<account_name>.dfs.core.windows.net/<path>. More details: + * https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri. + * + * @return the metastoreWarehouseDir value. + */ + public String metastoreWarehouseDir() { + return this.metastoreWarehouseDir; + } + + /** + * Set the metastoreWarehouseDir property: Metastore root directory URI, format: + * abfs[s]://<container>@<account_name>.dfs.core.windows.net/<path>. More details: + * https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction-abfs-uri. + * + * @param metastoreWarehouseDir the metastoreWarehouseDir value to set. + * @return the HiveCatalogOption object itself. + */ + public HiveCatalogOption withMetastoreWarehouseDir(String metastoreWarehouseDir) { + this.metastoreWarehouseDir = metastoreWarehouseDir; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (catalogName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property catalogName in model HiveCatalogOption")); + } + if (metastoreDbConnectionPasswordSecret() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metastoreDbConnectionPasswordSecret in model HiveCatalogOption")); + } + if (metastoreDbConnectionUrl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metastoreDbConnectionUrl in model HiveCatalogOption")); + } + if (metastoreDbConnectionUsername() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metastoreDbConnectionUsername in model HiveCatalogOption")); + } + if (metastoreWarehouseDir() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property metastoreWarehouseDir in model HiveCatalogOption")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HiveCatalogOption.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/IdentityProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/IdentityProfile.java new file mode 100644 index 000000000000..9fb17df6ada4 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/IdentityProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Identity Profile with details of an MSI. */ +@Fluent +public class IdentityProfile { + /* + * ResourceId of the MSI. + */ + @JsonProperty(value = "msiResourceId", required = true) + private String msiResourceId; + + /* + * ClientId of the MSI. + */ + @JsonProperty(value = "msiClientId", required = true) + private String msiClientId; + + /* + * ObjectId of the MSI. + */ + @JsonProperty(value = "msiObjectId", required = true) + private String msiObjectId; + + /** Creates an instance of IdentityProfile class. */ + public IdentityProfile() { + } + + /** + * Get the msiResourceId property: ResourceId of the MSI. + * + * @return the msiResourceId value. + */ + public String msiResourceId() { + return this.msiResourceId; + } + + /** + * Set the msiResourceId property: ResourceId of the MSI. + * + * @param msiResourceId the msiResourceId value to set. + * @return the IdentityProfile object itself. + */ + public IdentityProfile withMsiResourceId(String msiResourceId) { + this.msiResourceId = msiResourceId; + return this; + } + + /** + * Get the msiClientId property: ClientId of the MSI. + * + * @return the msiClientId value. + */ + public String msiClientId() { + return this.msiClientId; + } + + /** + * Set the msiClientId property: ClientId of the MSI. + * + * @param msiClientId the msiClientId value to set. + * @return the IdentityProfile object itself. + */ + public IdentityProfile withMsiClientId(String msiClientId) { + this.msiClientId = msiClientId; + return this; + } + + /** + * Get the msiObjectId property: ObjectId of the MSI. + * + * @return the msiObjectId value. + */ + public String msiObjectId() { + return this.msiObjectId; + } + + /** + * Set the msiObjectId property: ObjectId of the MSI. + * + * @param msiObjectId the msiObjectId value to set. + * @return the IdentityProfile object itself. + */ + public IdentityProfile withMsiObjectId(String msiObjectId) { + this.msiObjectId = msiObjectId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (msiResourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property msiResourceId in model IdentityProfile")); + } + if (msiClientId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property msiClientId in model IdentityProfile")); + } + if (msiObjectId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property msiObjectId in model IdentityProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IdentityProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/JobType.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/JobType.java new file mode 100644 index 000000000000..9bf79c1b24df --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/JobType.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of cluster job. */ +public final class JobType extends ExpandableStringEnum { + /** Static value FlinkJob for JobType. */ + public static final JobType FLINK_JOB = fromString("FlinkJob"); + + /** + * Creates a new instance of JobType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobType() { + } + + /** + * Creates or finds a JobType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobType. + */ + @JsonCreator + public static JobType fromString(String name) { + return fromString(name, JobType.class); + } + + /** + * Gets known JobType values. + * + * @return known JobType values. + */ + public static Collection values() { + return values(JobType.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/KeyVaultObjectType.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/KeyVaultObjectType.java new file mode 100644 index 000000000000..31329a3af024 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/KeyVaultObjectType.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of key vault object: secret, key or certificate. */ +public final class KeyVaultObjectType extends ExpandableStringEnum { + /** Static value Key for KeyVaultObjectType. */ + public static final KeyVaultObjectType KEY = fromString("Key"); + + /** Static value Secret for KeyVaultObjectType. */ + public static final KeyVaultObjectType SECRET = fromString("Secret"); + + /** Static value Certificate for KeyVaultObjectType. */ + public static final KeyVaultObjectType CERTIFICATE = fromString("Certificate"); + + /** + * Creates a new instance of KeyVaultObjectType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyVaultObjectType() { + } + + /** + * Creates or finds a KeyVaultObjectType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyVaultObjectType. + */ + @JsonCreator + public static KeyVaultObjectType fromString(String name) { + return fromString(name, KeyVaultObjectType.class); + } + + /** + * Gets known KeyVaultObjectType values. + * + * @return known KeyVaultObjectType values. + */ + public static Collection values() { + return values(KeyVaultObjectType.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/LoadBasedConfig.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/LoadBasedConfig.java new file mode 100644 index 000000000000..3c30b62826f5 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/LoadBasedConfig.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Profile of load based Autoscale. */ +@Fluent +public final class LoadBasedConfig { + /* + * User needs to set the minimum number of nodes for load based scaling, the load based scaling will use this to + * scale up and scale down between minimum and maximum number of nodes. + */ + @JsonProperty(value = "minNodes", required = true) + private int minNodes; + + /* + * User needs to set the maximum number of nodes for load based scaling, the load based scaling will use this to + * scale up and scale down between minimum and maximum number of nodes. + */ + @JsonProperty(value = "maxNodes", required = true) + private int maxNodes; + + /* + * User can specify the poll interval, this is the time period (in seconds) after which scaling metrics are polled + * for triggering a scaling operation. + */ + @JsonProperty(value = "pollInterval") + private Integer pollInterval; + + /* + * This is a cool down period, this is a time period in seconds, which determines the amount of time that must + * elapse between a scaling activity started by a rule and the start of the next scaling activity, regardless of + * the rule that triggers it. The default value is 300 seconds. + */ + @JsonProperty(value = "cooldownPeriod") + private Integer cooldownPeriod; + + /* + * The scaling rules. + */ + @JsonProperty(value = "scalingRules", required = true) + private List scalingRules; + + /** Creates an instance of LoadBasedConfig class. */ + public LoadBasedConfig() { + } + + /** + * Get the minNodes property: User needs to set the minimum number of nodes for load based scaling, the load based + * scaling will use this to scale up and scale down between minimum and maximum number of nodes. + * + * @return the minNodes value. + */ + public int minNodes() { + return this.minNodes; + } + + /** + * Set the minNodes property: User needs to set the minimum number of nodes for load based scaling, the load based + * scaling will use this to scale up and scale down between minimum and maximum number of nodes. + * + * @param minNodes the minNodes value to set. + * @return the LoadBasedConfig object itself. + */ + public LoadBasedConfig withMinNodes(int minNodes) { + this.minNodes = minNodes; + return this; + } + + /** + * Get the maxNodes property: User needs to set the maximum number of nodes for load based scaling, the load based + * scaling will use this to scale up and scale down between minimum and maximum number of nodes. + * + * @return the maxNodes value. + */ + public int maxNodes() { + return this.maxNodes; + } + + /** + * Set the maxNodes property: User needs to set the maximum number of nodes for load based scaling, the load based + * scaling will use this to scale up and scale down between minimum and maximum number of nodes. + * + * @param maxNodes the maxNodes value to set. + * @return the LoadBasedConfig object itself. + */ + public LoadBasedConfig withMaxNodes(int maxNodes) { + this.maxNodes = maxNodes; + return this; + } + + /** + * Get the pollInterval property: User can specify the poll interval, this is the time period (in seconds) after + * which scaling metrics are polled for triggering a scaling operation. + * + * @return the pollInterval value. + */ + public Integer pollInterval() { + return this.pollInterval; + } + + /** + * Set the pollInterval property: User can specify the poll interval, this is the time period (in seconds) after + * which scaling metrics are polled for triggering a scaling operation. + * + * @param pollInterval the pollInterval value to set. + * @return the LoadBasedConfig object itself. + */ + public LoadBasedConfig withPollInterval(Integer pollInterval) { + this.pollInterval = pollInterval; + return this; + } + + /** + * Get the cooldownPeriod property: This is a cool down period, this is a time period in seconds, which determines + * the amount of time that must elapse between a scaling activity started by a rule and the start of the next + * scaling activity, regardless of the rule that triggers it. The default value is 300 seconds. + * + * @return the cooldownPeriod value. + */ + public Integer cooldownPeriod() { + return this.cooldownPeriod; + } + + /** + * Set the cooldownPeriod property: This is a cool down period, this is a time period in seconds, which determines + * the amount of time that must elapse between a scaling activity started by a rule and the start of the next + * scaling activity, regardless of the rule that triggers it. The default value is 300 seconds. + * + * @param cooldownPeriod the cooldownPeriod value to set. + * @return the LoadBasedConfig object itself. + */ + public LoadBasedConfig withCooldownPeriod(Integer cooldownPeriod) { + this.cooldownPeriod = cooldownPeriod; + return this; + } + + /** + * Get the scalingRules property: The scaling rules. + * + * @return the scalingRules value. + */ + public List scalingRules() { + return this.scalingRules; + } + + /** + * Set the scalingRules property: The scaling rules. + * + * @param scalingRules the scalingRules value to set. + * @return the LoadBasedConfig object itself. + */ + public LoadBasedConfig withScalingRules(List scalingRules) { + this.scalingRules = scalingRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scalingRules() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property scalingRules in model LoadBasedConfig")); + } else { + scalingRules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoadBasedConfig.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Locations.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Locations.java new file mode 100644 index 000000000000..330acfaeab05 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Locations.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Locations. */ +public interface Locations { + /** + * Check the availability of the resource name. + * + * @param location The name of the Azure region. + * @param nameAvailabilityParameters The name and type of the 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 result of check name availability along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters nameAvailabilityParameters, Context context); + + /** + * Check the availability of the resource name. + * + * @param location The name of the Azure region. + * @param nameAvailabilityParameters The name and type of the 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 result of check name availability. + */ + NameAvailabilityResult checkNameAvailability( + String location, NameAvailabilityParameters nameAvailabilityParameters); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/NameAvailabilityParameters.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/NameAvailabilityParameters.java new file mode 100644 index 000000000000..1098d2be4c04 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/NameAvailabilityParameters.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of check name availability request body. */ +@Fluent +public final class NameAvailabilityParameters { + /* + * Name for checking availability. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type in Microsoft.HDInsight. + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of NameAvailabilityParameters class. */ + public NameAvailabilityParameters() { + } + + /** + * Get the name property: Name for checking availability. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name for checking availability. + * + * @param name the name value to set. + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type in Microsoft.HDInsight. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type in Microsoft.HDInsight. + * + * @param type the type value to set. + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withType(String 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/NameAvailabilityResult.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/NameAvailabilityResult.java new file mode 100644 index 000000000000..8e9d93665398 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/NameAvailabilityResult.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.NameAvailabilityResultInner; + +/** An immutable client-side representation of NameAvailabilityResult. */ +public interface NameAvailabilityResult { + /** + * Gets the nameAvailable property: Indicator of availability of the Microsoft.HDInsight resource name. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason of unavailability. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: The error message of unavailability. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner + * com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.NameAvailabilityResultInner + * object. + * + * @return the inner object. + */ + NameAvailabilityResultInner innerModel(); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/NodeProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/NodeProfile.java new file mode 100644 index 000000000000..b831da3a7555 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/NodeProfile.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The node profile. */ +@Fluent +public final class NodeProfile { + /* + * The node type. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * The virtual machine SKU. + */ + @JsonProperty(value = "vmSize", required = true) + private String vmSize; + + /* + * The number of virtual machines. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /** Creates an instance of NodeProfile class. */ + public NodeProfile() { + } + + /** + * Get the type property: The node type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The node type. + * + * @param type the type value to set. + * @return the NodeProfile object itself. + */ + public NodeProfile withType(String type) { + this.type = type; + return this; + } + + /** + * Get the vmSize property: The virtual machine SKU. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The virtual machine SKU. + * + * @param vmSize the vmSize value to set. + * @return the NodeProfile object itself. + */ + public NodeProfile withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the count property: The number of virtual machines. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: The number of virtual machines. + * + * @param count the count value to set. + * @return the NodeProfile object itself. + */ + public NodeProfile withCount(int count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model NodeProfile")); + } + if (vmSize() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property vmSize in model NodeProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NodeProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Operation.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Operation.java new file mode 100644 index 000000000000..8cd7fc0be705 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Operation.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.OperationInner + * object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/OperationDisplay.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/OperationDisplay.java new file mode 100644 index 000000000000..af882f85a693 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/OperationDisplay.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/OperationListResult.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/OperationListResult.java new file mode 100644 index 000000000000..0573a5788336 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/OperationListResult.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Operations.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Operations.java new file mode 100644 index 000000000000..2a307bc09aaf --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Returns 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Returns 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Origin.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Origin.java new file mode 100644 index 000000000000..0d2a4c6abbb5 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Origin.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ProvisioningStatus.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ProvisioningStatus.java new file mode 100644 index 000000000000..79c6c93ceaaf --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ProvisioningStatus.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the resource. */ +public final class ProvisioningStatus extends ExpandableStringEnum { + /** Static value Accepted for ProvisioningStatus. */ + public static final ProvisioningStatus ACCEPTED = fromString("Accepted"); + + /** Static value Succeeded for ProvisioningStatus. */ + public static final ProvisioningStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for ProvisioningStatus. */ + public static final ProvisioningStatus CANCELED = fromString("Canceled"); + + /** Static value Failed for ProvisioningStatus. */ + public static final ProvisioningStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of ProvisioningStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningStatus() { + } + + /** + * Creates or finds a ProvisioningStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningStatus. + */ + @JsonCreator + public static ProvisioningStatus fromString(String name) { + return fromString(name, ProvisioningStatus.class); + } + + /** + * Gets known ProvisioningStatus values. + * + * @return known ProvisioningStatus values. + */ + public static Collection values() { + return values(ProvisioningStatus.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScaleActionType.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScaleActionType.java new file mode 100644 index 000000000000..16a1d22107c9 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScaleActionType.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The action type. */ +public final class ScaleActionType extends ExpandableStringEnum { + /** Static value scaleup for ScaleActionType. */ + public static final ScaleActionType SCALEUP = fromString("scaleup"); + + /** Static value scaledown for ScaleActionType. */ + public static final ScaleActionType SCALEDOWN = fromString("scaledown"); + + /** + * Creates a new instance of ScaleActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScaleActionType() { + } + + /** + * Creates or finds a ScaleActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScaleActionType. + */ + @JsonCreator + public static ScaleActionType fromString(String name) { + return fromString(name, ScaleActionType.class); + } + + /** + * Gets known ScaleActionType values. + * + * @return known ScaleActionType values. + */ + public static Collection values() { + return values(ScaleActionType.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScalingRule.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScalingRule.java new file mode 100644 index 000000000000..eb4e4b8bc73b --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScalingRule.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The scaling rule. */ +@Fluent +public final class ScalingRule { + /* + * The action type. + */ + @JsonProperty(value = "actionType", required = true) + private ScaleActionType actionType; + + /* + * This is an evaluation count for a scaling condition, the number of times a trigger condition should be + * successful, before scaling activity is triggered. + */ + @JsonProperty(value = "evaluationCount", required = true) + private int evaluationCount; + + /* + * Metrics name for individual workloads. For example: cpu + */ + @JsonProperty(value = "scalingMetric", required = true) + private String scalingMetric; + + /* + * The comparison rule. + */ + @JsonProperty(value = "comparisonRule", required = true) + private ComparisonRule comparisonRule; + + /** Creates an instance of ScalingRule class. */ + public ScalingRule() { + } + + /** + * Get the actionType property: The action type. + * + * @return the actionType value. + */ + public ScaleActionType actionType() { + return this.actionType; + } + + /** + * Set the actionType property: The action type. + * + * @param actionType the actionType value to set. + * @return the ScalingRule object itself. + */ + public ScalingRule withActionType(ScaleActionType actionType) { + this.actionType = actionType; + return this; + } + + /** + * Get the evaluationCount property: This is an evaluation count for a scaling condition, the number of times a + * trigger condition should be successful, before scaling activity is triggered. + * + * @return the evaluationCount value. + */ + public int evaluationCount() { + return this.evaluationCount; + } + + /** + * Set the evaluationCount property: This is an evaluation count for a scaling condition, the number of times a + * trigger condition should be successful, before scaling activity is triggered. + * + * @param evaluationCount the evaluationCount value to set. + * @return the ScalingRule object itself. + */ + public ScalingRule withEvaluationCount(int evaluationCount) { + this.evaluationCount = evaluationCount; + return this; + } + + /** + * Get the scalingMetric property: Metrics name for individual workloads. For example: cpu. + * + * @return the scalingMetric value. + */ + public String scalingMetric() { + return this.scalingMetric; + } + + /** + * Set the scalingMetric property: Metrics name for individual workloads. For example: cpu. + * + * @param scalingMetric the scalingMetric value to set. + * @return the ScalingRule object itself. + */ + public ScalingRule withScalingMetric(String scalingMetric) { + this.scalingMetric = scalingMetric; + return this; + } + + /** + * Get the comparisonRule property: The comparison rule. + * + * @return the comparisonRule value. + */ + public ComparisonRule comparisonRule() { + return this.comparisonRule; + } + + /** + * Set the comparisonRule property: The comparison rule. + * + * @param comparisonRule the comparisonRule value to set. + * @return the ScalingRule object itself. + */ + public ScalingRule withComparisonRule(ComparisonRule comparisonRule) { + this.comparisonRule = comparisonRule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (actionType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property actionType in model ScalingRule")); + } + if (scalingMetric() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property scalingMetric in model ScalingRule")); + } + if (comparisonRule() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property comparisonRule in model ScalingRule")); + } else { + comparisonRule().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScalingRule.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Schedule.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Schedule.java new file mode 100644 index 000000000000..08c70df809e4 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/Schedule.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Schedule definition. */ +@Fluent +public final class Schedule { + /* + * User has to set the start time of current schedule configuration, format like 10:30 (HH:MM). + */ + @JsonProperty(value = "startTime", required = true) + private String startTime; + + /* + * User has to set the end time of current schedule configuration, format like 10:30 (HH:MM). + */ + @JsonProperty(value = "endTime", required = true) + private String endTime; + + /* + * User has to set the node count anticipated at end of the scaling operation of the set current schedule + * configuration, format is integer. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * User has to set the days where schedule has to be set for autoscale operation. + */ + @JsonProperty(value = "days", required = true) + private List days; + + /** Creates an instance of Schedule class. */ + public Schedule() { + } + + /** + * Get the startTime property: User has to set the start time of current schedule configuration, format like 10:30 + * (HH:MM). + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: User has to set the start time of current schedule configuration, format like 10:30 + * (HH:MM). + * + * @param startTime the startTime value to set. + * @return the Schedule object itself. + */ + public Schedule withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: User has to set the end time of current schedule configuration, format like 10:30 + * (HH:MM). + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * Set the endTime property: User has to set the end time of current schedule configuration, format like 10:30 + * (HH:MM). + * + * @param endTime the endTime value to set. + * @return the Schedule object itself. + */ + public Schedule withEndTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the count property: User has to set the node count anticipated at end of the scaling operation of the set + * current schedule configuration, format is integer. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: User has to set the node count anticipated at end of the scaling operation of the set + * current schedule configuration, format is integer. + * + * @param count the count value to set. + * @return the Schedule object itself. + */ + public Schedule withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the days property: User has to set the days where schedule has to be set for autoscale operation. + * + * @return the days value. + */ + public List days() { + return this.days; + } + + /** + * Set the days property: User has to set the days where schedule has to be set for autoscale operation. + * + * @param days the days value to set. + * @return the Schedule object itself. + */ + public Schedule withDays(List days) { + this.days = days; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (startTime() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property startTime in model Schedule")); + } + if (endTime() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property endTime in model Schedule")); + } + if (days() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property days in model Schedule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Schedule.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScheduleBasedConfig.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScheduleBasedConfig.java new file mode 100644 index 000000000000..cfc5aa13da1a --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScheduleBasedConfig.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Profile of schedule based Autoscale. */ +@Fluent +public final class ScheduleBasedConfig { + /* + * User has to specify the timezone on which the schedule has to be set for schedule based autoscale configuration. + */ + @JsonProperty(value = "timeZone", required = true) + private String timeZone; + + /* + * Setting default node count of current schedule configuration. Default node count specifies the number of nodes + * which are default when an specified scaling operation is executed (scale up/scale down) + */ + @JsonProperty(value = "defaultCount", required = true) + private int defaultCount; + + /* + * This specifies the schedules where scheduled based Autoscale to be enabled, the user has a choice to set + * multiple rules within the schedule across days and times (start/end). + */ + @JsonProperty(value = "schedules", required = true) + private List schedules; + + /** Creates an instance of ScheduleBasedConfig class. */ + public ScheduleBasedConfig() { + } + + /** + * Get the timeZone property: User has to specify the timezone on which the schedule has to be set for schedule + * based autoscale configuration. + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: User has to specify the timezone on which the schedule has to be set for schedule + * based autoscale configuration. + * + * @param timeZone the timeZone value to set. + * @return the ScheduleBasedConfig object itself. + */ + public ScheduleBasedConfig withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the defaultCount property: Setting default node count of current schedule configuration. Default node count + * specifies the number of nodes which are default when an specified scaling operation is executed (scale up/scale + * down). + * + * @return the defaultCount value. + */ + public int defaultCount() { + return this.defaultCount; + } + + /** + * Set the defaultCount property: Setting default node count of current schedule configuration. Default node count + * specifies the number of nodes which are default when an specified scaling operation is executed (scale up/scale + * down). + * + * @param defaultCount the defaultCount value to set. + * @return the ScheduleBasedConfig object itself. + */ + public ScheduleBasedConfig withDefaultCount(int defaultCount) { + this.defaultCount = defaultCount; + return this; + } + + /** + * Get the schedules property: This specifies the schedules where scheduled based Autoscale to be enabled, the user + * has a choice to set multiple rules within the schedule across days and times (start/end). + * + * @return the schedules value. + */ + public List schedules() { + return this.schedules; + } + + /** + * Set the schedules property: This specifies the schedules where scheduled based Autoscale to be enabled, the user + * has a choice to set multiple rules within the schedule across days and times (start/end). + * + * @param schedules the schedules value to set. + * @return the ScheduleBasedConfig object itself. + */ + public ScheduleBasedConfig withSchedules(List schedules) { + this.schedules = schedules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timeZone() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property timeZone in model ScheduleBasedConfig")); + } + if (schedules() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property schedules in model ScheduleBasedConfig")); + } else { + schedules().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScheduleBasedConfig.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScheduleDay.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScheduleDay.java new file mode 100644 index 000000000000..8548c5c63673 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScheduleDay.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ScheduleDay. */ +public final class ScheduleDay extends ExpandableStringEnum { + /** Static value Sunday for ScheduleDay. */ + public static final ScheduleDay SUNDAY = fromString("Sunday"); + + /** Static value Monday for ScheduleDay. */ + public static final ScheduleDay MONDAY = fromString("Monday"); + + /** Static value Tuesday for ScheduleDay. */ + public static final ScheduleDay TUESDAY = fromString("Tuesday"); + + /** Static value Wednesday for ScheduleDay. */ + public static final ScheduleDay WEDNESDAY = fromString("Wednesday"); + + /** Static value Thursday for ScheduleDay. */ + public static final ScheduleDay THURSDAY = fromString("Thursday"); + + /** Static value Friday for ScheduleDay. */ + public static final ScheduleDay FRIDAY = fromString("Friday"); + + /** Static value Saturday for ScheduleDay. */ + public static final ScheduleDay SATURDAY = fromString("Saturday"); + + /** + * Creates a new instance of ScheduleDay value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScheduleDay() { + } + + /** + * Creates or finds a ScheduleDay from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScheduleDay. + */ + @JsonCreator + public static ScheduleDay fromString(String name) { + return fromString(name, ScheduleDay.class); + } + + /** + * Gets known ScheduleDay values. + * + * @return known ScheduleDay values. + */ + public static Collection values() { + return values(ScheduleDay.class); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScriptActionProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScriptActionProfile.java new file mode 100644 index 000000000000..13bd744e4cf6 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ScriptActionProfile.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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 script action profile. */ +@Fluent +public final class ScriptActionProfile { + /* + * Type of the script action. Supported type is bash scripts. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * Script name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Url of the script file. + */ + @JsonProperty(value = "url", required = true) + private String url; + + /* + * Additional parameters for the script action. It should be space-separated list of arguments required for script + * execution. + */ + @JsonProperty(value = "parameters") + private String parameters; + + /* + * List of services to apply the script action. + */ + @JsonProperty(value = "services", required = true) + private List services; + + /* + * Timeout duration for the script action in minutes. + */ + @JsonProperty(value = "timeoutInMinutes") + private Integer timeoutInMinutes; + + /* + * Specify if the script should persist on the cluster. + */ + @JsonProperty(value = "shouldPersist") + private Boolean shouldPersist; + + /** Creates an instance of ScriptActionProfile class. */ + public ScriptActionProfile() { + } + + /** + * Get the type property: Type of the script action. Supported type is bash scripts. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the script action. Supported type is bash scripts. + * + * @param type the type value to set. + * @return the ScriptActionProfile object itself. + */ + public ScriptActionProfile withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: Script name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Script name. + * + * @param name the name value to set. + * @return the ScriptActionProfile object itself. + */ + public ScriptActionProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the url property: Url of the script file. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Url of the script file. + * + * @param url the url value to set. + * @return the ScriptActionProfile object itself. + */ + public ScriptActionProfile withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the parameters property: Additional parameters for the script action. It should be space-separated list of + * arguments required for script execution. + * + * @return the parameters value. + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Additional parameters for the script action. It should be space-separated list of + * arguments required for script execution. + * + * @param parameters the parameters value to set. + * @return the ScriptActionProfile object itself. + */ + public ScriptActionProfile withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the services property: List of services to apply the script action. + * + * @return the services value. + */ + public List services() { + return this.services; + } + + /** + * Set the services property: List of services to apply the script action. + * + * @param services the services value to set. + * @return the ScriptActionProfile object itself. + */ + public ScriptActionProfile withServices(List services) { + this.services = services; + return this; + } + + /** + * Get the timeoutInMinutes property: Timeout duration for the script action in minutes. + * + * @return the timeoutInMinutes value. + */ + public Integer timeoutInMinutes() { + return this.timeoutInMinutes; + } + + /** + * Set the timeoutInMinutes property: Timeout duration for the script action in minutes. + * + * @param timeoutInMinutes the timeoutInMinutes value to set. + * @return the ScriptActionProfile object itself. + */ + public ScriptActionProfile withTimeoutInMinutes(Integer timeoutInMinutes) { + this.timeoutInMinutes = timeoutInMinutes; + return this; + } + + /** + * Get the shouldPersist property: Specify if the script should persist on the cluster. + * + * @return the shouldPersist value. + */ + public Boolean shouldPersist() { + return this.shouldPersist; + } + + /** + * Set the shouldPersist property: Specify if the script should persist on the cluster. + * + * @param shouldPersist the shouldPersist value to set. + * @return the ScriptActionProfile object itself. + */ + public ScriptActionProfile withShouldPersist(Boolean shouldPersist) { + this.shouldPersist = shouldPersist; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ScriptActionProfile")); + } + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ScriptActionProfile")); + } + if (url() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property url in model ScriptActionProfile")); + } + if (services() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property services in model ScriptActionProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScriptActionProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SecretReference.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SecretReference.java new file mode 100644 index 000000000000..81cedcb9d8ad --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SecretReference.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Secret reference and corresponding properties of a key vault secret. */ +@Fluent +public final class SecretReference { + /* + * Reference name of the secret to be used in service configs. + */ + @JsonProperty(value = "referenceName", required = true) + private String referenceName; + + /* + * Type of key vault object: secret, key or certificate. + */ + @JsonProperty(value = "type", required = true) + private KeyVaultObjectType type; + + /* + * Version of the secret in key vault. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Object identifier name of the secret in key vault. + */ + @JsonProperty(value = "keyVaultObjectName", required = true) + private String keyVaultObjectName; + + /** Creates an instance of SecretReference class. */ + public SecretReference() { + } + + /** + * Get the referenceName property: Reference name of the secret to be used in service configs. + * + * @return the referenceName value. + */ + public String referenceName() { + return this.referenceName; + } + + /** + * Set the referenceName property: Reference name of the secret to be used in service configs. + * + * @param referenceName the referenceName value to set. + * @return the SecretReference object itself. + */ + public SecretReference withReferenceName(String referenceName) { + this.referenceName = referenceName; + return this; + } + + /** + * Get the type property: Type of key vault object: secret, key or certificate. + * + * @return the type value. + */ + public KeyVaultObjectType type() { + return this.type; + } + + /** + * Set the type property: Type of key vault object: secret, key or certificate. + * + * @param type the type value to set. + * @return the SecretReference object itself. + */ + public SecretReference withType(KeyVaultObjectType type) { + this.type = type; + return this; + } + + /** + * Get the version property: Version of the secret in key vault. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the secret in key vault. + * + * @param version the version value to set. + * @return the SecretReference object itself. + */ + public SecretReference withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the keyVaultObjectName property: Object identifier name of the secret in key vault. + * + * @return the keyVaultObjectName value. + */ + public String keyVaultObjectName() { + return this.keyVaultObjectName; + } + + /** + * Set the keyVaultObjectName property: Object identifier name of the secret in key vault. + * + * @param keyVaultObjectName the keyVaultObjectName value to set. + * @return the SecretReference object itself. + */ + public SecretReference withKeyVaultObjectName(String keyVaultObjectName) { + this.keyVaultObjectName = keyVaultObjectName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (referenceName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property referenceName in model SecretReference")); + } + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model SecretReference")); + } + if (keyVaultObjectName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultObjectName in model SecretReference")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretReference.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SecretsProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SecretsProfile.java new file mode 100644 index 000000000000..ebfb47380c10 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SecretsProfile.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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 cluster secret profile. */ +@Fluent +public final class SecretsProfile { + /* + * Name of the user Key Vault where all the cluster specific user secrets are stored. + */ + @JsonProperty(value = "keyVaultResourceId", required = true) + private String keyVaultResourceId; + + /* + * Properties of Key Vault secret. + */ + @JsonProperty(value = "secrets") + private List secrets; + + /** Creates an instance of SecretsProfile class. */ + public SecretsProfile() { + } + + /** + * Get the keyVaultResourceId property: Name of the user Key Vault where all the cluster specific user secrets are + * stored. + * + * @return the keyVaultResourceId value. + */ + public String keyVaultResourceId() { + return this.keyVaultResourceId; + } + + /** + * Set the keyVaultResourceId property: Name of the user Key Vault where all the cluster specific user secrets are + * stored. + * + * @param keyVaultResourceId the keyVaultResourceId value to set. + * @return the SecretsProfile object itself. + */ + public SecretsProfile withKeyVaultResourceId(String keyVaultResourceId) { + this.keyVaultResourceId = keyVaultResourceId; + return this; + } + + /** + * Get the secrets property: Properties of Key Vault secret. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Properties of Key Vault secret. + * + * @param secrets the secrets value to set. + * @return the SecretsProfile object itself. + */ + public SecretsProfile withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultResourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultResourceId in model SecretsProfile")); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretsProfile.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigListResult.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigListResult.java new file mode 100644 index 000000000000..f50fb6c4e73e --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ServiceConfigResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster instance service configs api response. */ +@Fluent +public final class ServiceConfigListResult { + /* + * Cluster instance service config array. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ServiceConfigListResult class. */ + public ServiceConfigListResult() { + } + + /** + * Get the value property: Cluster instance service config array. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Cluster instance service config array. + * + * @param value the value value to set. + * @return the ServiceConfigListResult object itself. + */ + public ServiceConfigListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link (url) to the next page of 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigListResultProperties.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigListResultProperties.java new file mode 100644 index 000000000000..0042128dee3b --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigListResultProperties.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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; + +/** Service config response. */ +@Fluent +public class ServiceConfigListResultProperties { + /* + * Service Config Name. + */ + @JsonProperty(value = "serviceName", required = true) + private String serviceName; + + /* + * File Name. + */ + @JsonProperty(value = "fileName", required = true) + private String fileName; + + /* + * Content in the service config file. + */ + @JsonProperty(value = "content") + private String content; + + /* + * Component Name. + */ + @JsonProperty(value = "componentName", required = true) + private String componentName; + + /* + * Config type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Config file path. + */ + @JsonProperty(value = "path") + private String path; + + /* + * The custom keys. + */ + @JsonProperty(value = "customKeys") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customKeys; + + /* + * The default keys. + */ + @JsonProperty(value = "defaultKeys") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map defaultKeys; + + /** Creates an instance of ServiceConfigListResultProperties class. */ + public ServiceConfigListResultProperties() { + } + + /** + * Get the serviceName property: Service Config Name. + * + * @return the serviceName value. + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the serviceName property: Service Config Name. + * + * @param serviceName the serviceName value to set. + * @return the ServiceConfigListResultProperties object itself. + */ + public ServiceConfigListResultProperties withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the fileName property: File Name. + * + * @return the fileName value. + */ + public String fileName() { + return this.fileName; + } + + /** + * Set the fileName property: File Name. + * + * @param fileName the fileName value to set. + * @return the ServiceConfigListResultProperties object itself. + */ + public ServiceConfigListResultProperties withFileName(String fileName) { + this.fileName = fileName; + return this; + } + + /** + * Get the content property: Content in the service config file. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: Content in the service config file. + * + * @param content the content value to set. + * @return the ServiceConfigListResultProperties object itself. + */ + public ServiceConfigListResultProperties withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the componentName property: Component Name. + * + * @return the componentName value. + */ + public String componentName() { + return this.componentName; + } + + /** + * Set the componentName property: Component Name. + * + * @param componentName the componentName value to set. + * @return the ServiceConfigListResultProperties object itself. + */ + public ServiceConfigListResultProperties withComponentName(String componentName) { + this.componentName = componentName; + return this; + } + + /** + * Get the type property: Config type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Config type. + * + * @param type the type value to set. + * @return the ServiceConfigListResultProperties object itself. + */ + public ServiceConfigListResultProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the path property: Config file path. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Config file path. + * + * @param path the path value to set. + * @return the ServiceConfigListResultProperties object itself. + */ + public ServiceConfigListResultProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the customKeys property: The custom keys. + * + * @return the customKeys value. + */ + public Map customKeys() { + return this.customKeys; + } + + /** + * Set the customKeys property: The custom keys. + * + * @param customKeys the customKeys value to set. + * @return the ServiceConfigListResultProperties object itself. + */ + public ServiceConfigListResultProperties withCustomKeys(Map customKeys) { + this.customKeys = customKeys; + return this; + } + + /** + * Get the defaultKeys property: The default keys. + * + * @return the defaultKeys value. + */ + public Map defaultKeys() { + return this.defaultKeys; + } + + /** + * Set the defaultKeys property: The default keys. + * + * @param defaultKeys the defaultKeys value to set. + * @return the ServiceConfigListResultProperties object itself. + */ + public ServiceConfigListResultProperties withDefaultKeys( + Map defaultKeys) { + this.defaultKeys = defaultKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceName in model ServiceConfigListResultProperties")); + } + if (fileName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fileName in model ServiceConfigListResultProperties")); + } + if (componentName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property componentName in model ServiceConfigListResultProperties")); + } + if (defaultKeys() != null) { + defaultKeys() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceConfigListResultProperties.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigListResultValueEntity.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigListResultValueEntity.java new file mode 100644 index 000000000000..ae287b80a7b8 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigListResultValueEntity.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Default config details. */ +@Fluent +public final class ServiceConfigListResultValueEntity { + /* + * Config value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /* + * Config description. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of ServiceConfigListResultValueEntity class. */ + public ServiceConfigListResultValueEntity() { + } + + /** + * Get the value property: Config value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Config value. + * + * @param value the value value to set. + * @return the ServiceConfigListResultValueEntity object itself. + */ + public ServiceConfigListResultValueEntity withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the description property: Config description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Config description. + * + * @param description the description value to set. + * @return the ServiceConfigListResultValueEntity object itself. + */ + public ServiceConfigListResultValueEntity withDescription(String description) { + this.description = description; + return this; + } + + /** + * 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 ServiceConfigListResultValueEntity")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceConfigListResultValueEntity.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigResult.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigResult.java new file mode 100644 index 000000000000..953c3e6c12bd --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceConfigResult.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ServiceConfigResultInner; +import java.util.Map; + +/** An immutable client-side representation of ServiceConfigResult. */ +public interface ServiceConfigResult { + /** + * Gets the serviceName property: Service Config Name. + * + * @return the serviceName value. + */ + String serviceName(); + + /** + * Gets the fileName property: File Name. + * + * @return the fileName value. + */ + String fileName(); + + /** + * Gets the content property: Content in the service config file. + * + * @return the content value. + */ + String content(); + + /** + * Gets the componentName property: Component Name. + * + * @return the componentName value. + */ + String componentName(); + + /** + * Gets the type property: Config type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the path property: Config file path. + * + * @return the path value. + */ + String path(); + + /** + * Gets the customKeys property: The custom keys. + * + * @return the customKeys value. + */ + Map customKeys(); + + /** + * Gets the defaultKeys property: The default keys. + * + * @return the defaultKeys value. + */ + Map defaultKeys(); + + /** + * Gets the inner + * com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ServiceConfigResultInner + * object. + * + * @return the inner object. + */ + ServiceConfigResultInner innerModel(); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceStatus.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceStatus.java new file mode 100644 index 000000000000..a2e6d3e0db49 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/ServiceStatus.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the status of a service of a HDInsight on aks cluster. */ +@Fluent +public final class ServiceStatus { + /* + * Kind of the service. E.g. "Zookeeper". + */ + @JsonProperty(value = "kind", required = true) + private String kind; + + /* + * Indicates if the service is ready / healthy. Values can be "true", "false", "unknown" or anything else. + */ + @JsonProperty(value = "ready", required = true) + private String ready; + + /* + * A message describing the error if any. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of ServiceStatus class. */ + public ServiceStatus() { + } + + /** + * Get the kind property: Kind of the service. E.g. "Zookeeper". + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: Kind of the service. E.g. "Zookeeper". + * + * @param kind the kind value to set. + * @return the ServiceStatus object itself. + */ + public ServiceStatus withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the ready property: Indicates if the service is ready / healthy. Values can be "true", "false", "unknown" or + * anything else. + * + * @return the ready value. + */ + public String ready() { + return this.ready; + } + + /** + * Set the ready property: Indicates if the service is ready / healthy. Values can be "true", "false", "unknown" or + * anything else. + * + * @param ready the ready value to set. + * @return the ServiceStatus object itself. + */ + public ServiceStatus withReady(String ready) { + this.ready = ready; + return this; + } + + /** + * Get the message property: A message describing the error if any. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: A message describing the error if any. + * + * @param message the message value to set. + * @return the ServiceStatus object itself. + */ + public ServiceStatus withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (kind() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property kind in model ServiceStatus")); + } + if (ready() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property ready in model ServiceStatus")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceStatus.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkMetastoreSpec.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkMetastoreSpec.java new file mode 100644 index 000000000000..b0d8bf4566b0 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkMetastoreSpec.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The metastore specification for Spark cluster. */ +@Fluent +public final class SparkMetastoreSpec { + /* + * The database server host. + */ + @JsonProperty(value = "dbServerHost", required = true) + private String dbServerHost; + + /* + * The database name. + */ + @JsonProperty(value = "dbName") + private String dbName; + + /* + * The database user name. + */ + @JsonProperty(value = "dbUserName", required = true) + private String dbUsername; + + /* + * The secret name which contains the database user password. + */ + @JsonProperty(value = "dbPasswordSecretName", required = true) + private String dbPasswordSecretName; + + /* + * The key vault resource id. + */ + @JsonProperty(value = "keyVaultId", required = true) + private String keyVaultId; + + /* + * The thrift url. + */ + @JsonProperty(value = "thriftUrl") + private String thriftUrl; + + /** Creates an instance of SparkMetastoreSpec class. */ + public SparkMetastoreSpec() { + } + + /** + * Get the dbServerHost property: The database server host. + * + * @return the dbServerHost value. + */ + public String dbServerHost() { + return this.dbServerHost; + } + + /** + * Set the dbServerHost property: The database server host. + * + * @param dbServerHost the dbServerHost value to set. + * @return the SparkMetastoreSpec object itself. + */ + public SparkMetastoreSpec withDbServerHost(String dbServerHost) { + this.dbServerHost = dbServerHost; + return this; + } + + /** + * Get the dbName property: The database name. + * + * @return the dbName value. + */ + public String dbName() { + return this.dbName; + } + + /** + * Set the dbName property: The database name. + * + * @param dbName the dbName value to set. + * @return the SparkMetastoreSpec object itself. + */ + public SparkMetastoreSpec withDbName(String dbName) { + this.dbName = dbName; + return this; + } + + /** + * Get the dbUsername property: The database user name. + * + * @return the dbUsername value. + */ + public String dbUsername() { + return this.dbUsername; + } + + /** + * Set the dbUsername property: The database user name. + * + * @param dbUsername the dbUsername value to set. + * @return the SparkMetastoreSpec object itself. + */ + public SparkMetastoreSpec withDbUsername(String dbUsername) { + this.dbUsername = dbUsername; + return this; + } + + /** + * Get the dbPasswordSecretName property: The secret name which contains the database user password. + * + * @return the dbPasswordSecretName value. + */ + public String dbPasswordSecretName() { + return this.dbPasswordSecretName; + } + + /** + * Set the dbPasswordSecretName property: The secret name which contains the database user password. + * + * @param dbPasswordSecretName the dbPasswordSecretName value to set. + * @return the SparkMetastoreSpec object itself. + */ + public SparkMetastoreSpec withDbPasswordSecretName(String dbPasswordSecretName) { + this.dbPasswordSecretName = dbPasswordSecretName; + return this; + } + + /** + * Get the keyVaultId property: The key vault resource id. + * + * @return the keyVaultId value. + */ + public String keyVaultId() { + return this.keyVaultId; + } + + /** + * Set the keyVaultId property: The key vault resource id. + * + * @param keyVaultId the keyVaultId value to set. + * @return the SparkMetastoreSpec object itself. + */ + public SparkMetastoreSpec withKeyVaultId(String keyVaultId) { + this.keyVaultId = keyVaultId; + return this; + } + + /** + * Get the thriftUrl property: The thrift url. + * + * @return the thriftUrl value. + */ + public String thriftUrl() { + return this.thriftUrl; + } + + /** + * Set the thriftUrl property: The thrift url. + * + * @param thriftUrl the thriftUrl value to set. + * @return the SparkMetastoreSpec object itself. + */ + public SparkMetastoreSpec withThriftUrl(String thriftUrl) { + this.thriftUrl = thriftUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dbServerHost() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property dbServerHost in model SparkMetastoreSpec")); + } + if (dbUsername() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property dbUsername in model SparkMetastoreSpec")); + } + if (dbPasswordSecretName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dbPasswordSecretName in model SparkMetastoreSpec")); + } + if (keyVaultId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property keyVaultId in model SparkMetastoreSpec")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SparkMetastoreSpec.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkProfile.java new file mode 100644 index 000000000000..cad28a4c5bc4 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The spark cluster profile. */ +@Fluent +public final class SparkProfile { + /* + * The default storage URL. + */ + @JsonProperty(value = "defaultStorageUrl") + private String defaultStorageUrl; + + /* + * The metastore specification for Spark cluster. + */ + @JsonProperty(value = "metastoreSpec") + private SparkMetastoreSpec metastoreSpec; + + /* + * Spark user plugins spec + */ + @JsonProperty(value = "userPluginsSpec") + private SparkUserPlugins userPluginsSpec; + + /** Creates an instance of SparkProfile class. */ + public SparkProfile() { + } + + /** + * Get the defaultStorageUrl property: The default storage URL. + * + * @return the defaultStorageUrl value. + */ + public String defaultStorageUrl() { + return this.defaultStorageUrl; + } + + /** + * Set the defaultStorageUrl property: The default storage URL. + * + * @param defaultStorageUrl the defaultStorageUrl value to set. + * @return the SparkProfile object itself. + */ + public SparkProfile withDefaultStorageUrl(String defaultStorageUrl) { + this.defaultStorageUrl = defaultStorageUrl; + return this; + } + + /** + * Get the metastoreSpec property: The metastore specification for Spark cluster. + * + * @return the metastoreSpec value. + */ + public SparkMetastoreSpec metastoreSpec() { + return this.metastoreSpec; + } + + /** + * Set the metastoreSpec property: The metastore specification for Spark cluster. + * + * @param metastoreSpec the metastoreSpec value to set. + * @return the SparkProfile object itself. + */ + public SparkProfile withMetastoreSpec(SparkMetastoreSpec metastoreSpec) { + this.metastoreSpec = metastoreSpec; + return this; + } + + /** + * Get the userPluginsSpec property: Spark user plugins spec. + * + * @return the userPluginsSpec value. + */ + public SparkUserPlugins userPluginsSpec() { + return this.userPluginsSpec; + } + + /** + * Set the userPluginsSpec property: Spark user plugins spec. + * + * @param userPluginsSpec the userPluginsSpec value to set. + * @return the SparkProfile object itself. + */ + public SparkProfile withUserPluginsSpec(SparkUserPlugins userPluginsSpec) { + this.userPluginsSpec = userPluginsSpec; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metastoreSpec() != null) { + metastoreSpec().validate(); + } + if (userPluginsSpec() != null) { + userPluginsSpec().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkUserPlugin.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkUserPlugin.java new file mode 100644 index 000000000000..35abb0fde9dd --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkUserPlugin.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Spark user plugin. */ +@Fluent +public final class SparkUserPlugin { + /* + * Fully qualified path to the folder containing the plugins. + */ + @JsonProperty(value = "path", required = true) + private String path; + + /** Creates an instance of SparkUserPlugin class. */ + public SparkUserPlugin() { + } + + /** + * Get the path property: Fully qualified path to the folder containing the plugins. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Fully qualified path to the folder containing the plugins. + * + * @param path the path value to set. + * @return the SparkUserPlugin object itself. + */ + public SparkUserPlugin withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (path() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property path in model SparkUserPlugin")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SparkUserPlugin.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkUserPlugins.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkUserPlugins.java new file mode 100644 index 000000000000..52c1ce3138fd --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SparkUserPlugins.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Spark user plugins spec. */ +@Fluent +public final class SparkUserPlugins { + /* + * Spark user plugins. + */ + @JsonProperty(value = "plugins") + private List plugins; + + /** Creates an instance of SparkUserPlugins class. */ + public SparkUserPlugins() { + } + + /** + * Get the plugins property: Spark user plugins. + * + * @return the plugins value. + */ + public List plugins() { + return this.plugins; + } + + /** + * Set the plugins property: Spark user plugins. + * + * @param plugins the plugins value to set. + * @return the SparkUserPlugins object itself. + */ + public SparkUserPlugins withPlugins(List plugins) { + this.plugins = plugins; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (plugins() != null) { + plugins().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SshConnectivityEndpoint.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SshConnectivityEndpoint.java new file mode 100644 index 000000000000..a0d675f441fc --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SshConnectivityEndpoint.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SSH connectivity endpoint details. */ +@Fluent +public final class SshConnectivityEndpoint { + /* + * SSH connectivity endpoint. + */ + @JsonProperty(value = "endpoint", required = true) + private String endpoint; + + /** Creates an instance of SshConnectivityEndpoint class. */ + public SshConnectivityEndpoint() { + } + + /** + * Get the endpoint property: SSH connectivity endpoint. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Set the endpoint property: SSH connectivity endpoint. + * + * @param endpoint the endpoint value to set. + * @return the SshConnectivityEndpoint object itself. + */ + public SshConnectivityEndpoint withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpoint() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property endpoint in model SshConnectivityEndpoint")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SshConnectivityEndpoint.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SshProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SshProfile.java new file mode 100644 index 000000000000..e8abe467bf27 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/SshProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ssh profile for the cluster. */ +@Fluent +public final class SshProfile { + /* + * Number of ssh pods per cluster. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /* + * Prefix of the pod names. Pod number will be appended to the prefix. The ingress URLs for the pods will be + * available at //- + */ + @JsonProperty(value = "podPrefix", access = JsonProperty.Access.WRITE_ONLY) + private String podPrefix; + + /** Creates an instance of SshProfile class. */ + public SshProfile() { + } + + /** + * Get the count property: Number of ssh pods per cluster. + * + * @return the count value. + */ + public int count() { + return this.count; + } + + /** + * Set the count property: Number of ssh pods per cluster. + * + * @param count the count value to set. + * @return the SshProfile object itself. + */ + public SshProfile withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the podPrefix property: Prefix of the pod names. Pod number will be appended to the prefix. The ingress URLs + * for the pods will be available at <clusterFqdn>/<sshBasePath>/<prefix>-<number>. + * + * @return the podPrefix value. + */ + public String podPrefix() { + return this.podPrefix; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TagsObject.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TagsObject.java new file mode 100644 index 000000000000..a7f23fa77443 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TagsObject.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.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; + + /** Creates an instance of TagsObject class. */ + public TagsObject() { + } + + /** + * 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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoCoordinator.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoCoordinator.java new file mode 100644 index 000000000000..7fc66df2d485 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoCoordinator.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.TrinoDebugConfig; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trino Coordinator. */ +@Fluent +public final class TrinoCoordinator { + /* + * Trino debug configuration. + */ + @JsonProperty(value = "debug") + private TrinoDebugConfig innerDebug; + + /* + * The flag that if enable coordinator HA, uses multiple coordinator replicas with auto failover, one per each head + * node. Default: true. + */ + @JsonProperty(value = "highAvailabilityEnabled") + private Boolean highAvailabilityEnabled; + + /** Creates an instance of TrinoCoordinator class. */ + public TrinoCoordinator() { + } + + /** + * Get the innerDebug property: Trino debug configuration. + * + * @return the innerDebug value. + */ + private TrinoDebugConfig innerDebug() { + return this.innerDebug; + } + + /** + * Get the highAvailabilityEnabled property: The flag that if enable coordinator HA, uses multiple coordinator + * replicas with auto failover, one per each head node. Default: true. + * + * @return the highAvailabilityEnabled value. + */ + public Boolean highAvailabilityEnabled() { + return this.highAvailabilityEnabled; + } + + /** + * Set the highAvailabilityEnabled property: The flag that if enable coordinator HA, uses multiple coordinator + * replicas with auto failover, one per each head node. Default: true. + * + * @param highAvailabilityEnabled the highAvailabilityEnabled value to set. + * @return the TrinoCoordinator object itself. + */ + public TrinoCoordinator withHighAvailabilityEnabled(Boolean highAvailabilityEnabled) { + this.highAvailabilityEnabled = highAvailabilityEnabled; + return this; + } + + /** + * Get the enable property: The flag that if enable debug or not. + * + * @return the enable value. + */ + public Boolean enable() { + return this.innerDebug() == null ? null : this.innerDebug().enable(); + } + + /** + * Set the enable property: The flag that if enable debug or not. + * + * @param enable the enable value to set. + * @return the TrinoCoordinator object itself. + */ + public TrinoCoordinator withEnable(Boolean enable) { + if (this.innerDebug() == null) { + this.innerDebug = new TrinoDebugConfig(); + } + this.innerDebug().withEnable(enable); + return this; + } + + /** + * Get the port property: The debug port. + * + * @return the port value. + */ + public Integer port() { + return this.innerDebug() == null ? null : this.innerDebug().port(); + } + + /** + * Set the port property: The debug port. + * + * @param port the port value to set. + * @return the TrinoCoordinator object itself. + */ + public TrinoCoordinator withPort(Integer port) { + if (this.innerDebug() == null) { + this.innerDebug = new TrinoDebugConfig(); + } + this.innerDebug().withPort(port); + return this; + } + + /** + * Get the suspend property: The flag that if suspend debug or not. + * + * @return the suspend value. + */ + public Boolean suspend() { + return this.innerDebug() == null ? null : this.innerDebug().suspend(); + } + + /** + * Set the suspend property: The flag that if suspend debug or not. + * + * @param suspend the suspend value to set. + * @return the TrinoCoordinator object itself. + */ + public TrinoCoordinator withSuspend(Boolean suspend) { + if (this.innerDebug() == null) { + this.innerDebug = new TrinoDebugConfig(); + } + this.innerDebug().withSuspend(suspend); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerDebug() != null) { + innerDebug().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoProfile.java new file mode 100644 index 000000000000..0db04197781b --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoProfile.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trino Cluster profile. */ +@Fluent +public final class TrinoProfile { + /* + * Trino cluster catalog options. + */ + @JsonProperty(value = "catalogOptions") + private CatalogOptions catalogOptions; + + /* + * Trino Coordinator. + */ + @JsonProperty(value = "coordinator") + private TrinoCoordinator coordinator; + + /* + * Trino user plugins spec + */ + @JsonProperty(value = "userPluginsSpec") + private TrinoUserPlugins userPluginsSpec; + + /* + * User telemetry + */ + @JsonProperty(value = "userTelemetrySpec") + private TrinoUserTelemetry userTelemetrySpec; + + /* + * Trino worker. + */ + @JsonProperty(value = "worker") + private TrinoWorker worker; + + /** Creates an instance of TrinoProfile class. */ + public TrinoProfile() { + } + + /** + * Get the catalogOptions property: Trino cluster catalog options. + * + * @return the catalogOptions value. + */ + public CatalogOptions catalogOptions() { + return this.catalogOptions; + } + + /** + * Set the catalogOptions property: Trino cluster catalog options. + * + * @param catalogOptions the catalogOptions value to set. + * @return the TrinoProfile object itself. + */ + public TrinoProfile withCatalogOptions(CatalogOptions catalogOptions) { + this.catalogOptions = catalogOptions; + return this; + } + + /** + * Get the coordinator property: Trino Coordinator. + * + * @return the coordinator value. + */ + public TrinoCoordinator coordinator() { + return this.coordinator; + } + + /** + * Set the coordinator property: Trino Coordinator. + * + * @param coordinator the coordinator value to set. + * @return the TrinoProfile object itself. + */ + public TrinoProfile withCoordinator(TrinoCoordinator coordinator) { + this.coordinator = coordinator; + return this; + } + + /** + * Get the userPluginsSpec property: Trino user plugins spec. + * + * @return the userPluginsSpec value. + */ + public TrinoUserPlugins userPluginsSpec() { + return this.userPluginsSpec; + } + + /** + * Set the userPluginsSpec property: Trino user plugins spec. + * + * @param userPluginsSpec the userPluginsSpec value to set. + * @return the TrinoProfile object itself. + */ + public TrinoProfile withUserPluginsSpec(TrinoUserPlugins userPluginsSpec) { + this.userPluginsSpec = userPluginsSpec; + return this; + } + + /** + * Get the userTelemetrySpec property: User telemetry. + * + * @return the userTelemetrySpec value. + */ + public TrinoUserTelemetry userTelemetrySpec() { + return this.userTelemetrySpec; + } + + /** + * Set the userTelemetrySpec property: User telemetry. + * + * @param userTelemetrySpec the userTelemetrySpec value to set. + * @return the TrinoProfile object itself. + */ + public TrinoProfile withUserTelemetrySpec(TrinoUserTelemetry userTelemetrySpec) { + this.userTelemetrySpec = userTelemetrySpec; + return this; + } + + /** + * Get the worker property: Trino worker. + * + * @return the worker value. + */ + public TrinoWorker worker() { + return this.worker; + } + + /** + * Set the worker property: Trino worker. + * + * @param worker the worker value to set. + * @return the TrinoProfile object itself. + */ + public TrinoProfile withWorker(TrinoWorker worker) { + this.worker = worker; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (catalogOptions() != null) { + catalogOptions().validate(); + } + if (coordinator() != null) { + coordinator().validate(); + } + if (userPluginsSpec() != null) { + userPluginsSpec().validate(); + } + if (userTelemetrySpec() != null) { + userTelemetrySpec().validate(); + } + if (worker() != null) { + worker().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoTelemetryConfig.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoTelemetryConfig.java new file mode 100644 index 000000000000..2d5fafc534ea --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoTelemetryConfig.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trino user telemetry definition. */ +@Fluent +public final class TrinoTelemetryConfig { + /* + * Hive Catalog name used to mount external tables on the logs written by trino, if not specified there tables are + * not created. + */ + @JsonProperty(value = "hivecatalogName") + private String hivecatalogName; + + /* + * Schema of the above catalog to use, to mount query logs as external tables, if not specified tables will be + * mounted under schema trinologs. + */ + @JsonProperty(value = "hivecatalogSchema") + private String hivecatalogSchema; + + /* + * Retention period for query log table partitions, this doesn't have any affect on actual data. + */ + @JsonProperty(value = "partitionRetentionInDays") + private Integer partitionRetentionInDays; + + /* + * Azure storage location of the blobs. + */ + @JsonProperty(value = "path") + private String path; + + /** Creates an instance of TrinoTelemetryConfig class. */ + public TrinoTelemetryConfig() { + } + + /** + * Get the hivecatalogName property: Hive Catalog name used to mount external tables on the logs written by trino, + * if not specified there tables are not created. + * + * @return the hivecatalogName value. + */ + public String hivecatalogName() { + return this.hivecatalogName; + } + + /** + * Set the hivecatalogName property: Hive Catalog name used to mount external tables on the logs written by trino, + * if not specified there tables are not created. + * + * @param hivecatalogName the hivecatalogName value to set. + * @return the TrinoTelemetryConfig object itself. + */ + public TrinoTelemetryConfig withHivecatalogName(String hivecatalogName) { + this.hivecatalogName = hivecatalogName; + return this; + } + + /** + * Get the hivecatalogSchema property: Schema of the above catalog to use, to mount query logs as external tables, + * if not specified tables will be mounted under schema trinologs. + * + * @return the hivecatalogSchema value. + */ + public String hivecatalogSchema() { + return this.hivecatalogSchema; + } + + /** + * Set the hivecatalogSchema property: Schema of the above catalog to use, to mount query logs as external tables, + * if not specified tables will be mounted under schema trinologs. + * + * @param hivecatalogSchema the hivecatalogSchema value to set. + * @return the TrinoTelemetryConfig object itself. + */ + public TrinoTelemetryConfig withHivecatalogSchema(String hivecatalogSchema) { + this.hivecatalogSchema = hivecatalogSchema; + return this; + } + + /** + * Get the partitionRetentionInDays property: Retention period for query log table partitions, this doesn't have any + * affect on actual data. + * + * @return the partitionRetentionInDays value. + */ + public Integer partitionRetentionInDays() { + return this.partitionRetentionInDays; + } + + /** + * Set the partitionRetentionInDays property: Retention period for query log table partitions, this doesn't have any + * affect on actual data. + * + * @param partitionRetentionInDays the partitionRetentionInDays value to set. + * @return the TrinoTelemetryConfig object itself. + */ + public TrinoTelemetryConfig withPartitionRetentionInDays(Integer partitionRetentionInDays) { + this.partitionRetentionInDays = partitionRetentionInDays; + return this; + } + + /** + * Get the path property: Azure storage location of the blobs. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Azure storage location of the blobs. + * + * @param path the path value to set. + * @return the TrinoTelemetryConfig object itself. + */ + public TrinoTelemetryConfig withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoUserPlugin.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoUserPlugin.java new file mode 100644 index 000000000000..4c13debe0702 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoUserPlugin.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trino user plugin. */ +@Fluent +public final class TrinoUserPlugin { + /* + * Denotes whether the plugin is active or not. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * This field maps to the sub-directory in trino plugins location, that will contain all the plugins under path. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Fully qualified path to the folder containing the plugins. + */ + @JsonProperty(value = "path") + private String path; + + /** Creates an instance of TrinoUserPlugin class. */ + public TrinoUserPlugin() { + } + + /** + * Get the enabled property: Denotes whether the plugin is active or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Denotes whether the plugin is active or not. + * + * @param enabled the enabled value to set. + * @return the TrinoUserPlugin object itself. + */ + public TrinoUserPlugin withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the name property: This field maps to the sub-directory in trino plugins location, that will contain all the + * plugins under path. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: This field maps to the sub-directory in trino plugins location, that will contain all the + * plugins under path. + * + * @param name the name value to set. + * @return the TrinoUserPlugin object itself. + */ + public TrinoUserPlugin withName(String name) { + this.name = name; + return this; + } + + /** + * Get the path property: Fully qualified path to the folder containing the plugins. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Fully qualified path to the folder containing the plugins. + * + * @param path the path value to set. + * @return the TrinoUserPlugin object itself. + */ + public TrinoUserPlugin withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoUserPlugins.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoUserPlugins.java new file mode 100644 index 000000000000..88b68f21bf9d --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoUserPlugins.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Trino user plugins spec. */ +@Fluent +public final class TrinoUserPlugins { + /* + * Trino user plugins. + */ + @JsonProperty(value = "plugins") + private List plugins; + + /** Creates an instance of TrinoUserPlugins class. */ + public TrinoUserPlugins() { + } + + /** + * Get the plugins property: Trino user plugins. + * + * @return the plugins value. + */ + public List plugins() { + return this.plugins; + } + + /** + * Set the plugins property: Trino user plugins. + * + * @param plugins the plugins value to set. + * @return the TrinoUserPlugins object itself. + */ + public TrinoUserPlugins withPlugins(List plugins) { + this.plugins = plugins; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (plugins() != null) { + plugins().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoUserTelemetry.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoUserTelemetry.java new file mode 100644 index 000000000000..36396fa70f65 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoUserTelemetry.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** User telemetry. */ +@Fluent +public final class TrinoUserTelemetry { + /* + * Trino user telemetry definition. + */ + @JsonProperty(value = "storage") + private TrinoTelemetryConfig storage; + + /** Creates an instance of TrinoUserTelemetry class. */ + public TrinoUserTelemetry() { + } + + /** + * Get the storage property: Trino user telemetry definition. + * + * @return the storage value. + */ + public TrinoTelemetryConfig storage() { + return this.storage; + } + + /** + * Set the storage property: Trino user telemetry definition. + * + * @param storage the storage value to set. + * @return the TrinoUserTelemetry object itself. + */ + public TrinoUserTelemetry withStorage(TrinoTelemetryConfig storage) { + this.storage = storage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storage() != null) { + storage().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoWorker.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoWorker.java new file mode 100644 index 000000000000..52bf19d6e168 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/TrinoWorker.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.TrinoDebugConfig; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Trino worker. */ +@Fluent +public final class TrinoWorker { + /* + * Trino debug configuration. + */ + @JsonProperty(value = "debug") + private TrinoDebugConfig innerDebug; + + /** Creates an instance of TrinoWorker class. */ + public TrinoWorker() { + } + + /** + * Get the innerDebug property: Trino debug configuration. + * + * @return the innerDebug value. + */ + private TrinoDebugConfig innerDebug() { + return this.innerDebug; + } + + /** + * Get the enable property: The flag that if enable debug or not. + * + * @return the enable value. + */ + public Boolean enable() { + return this.innerDebug() == null ? null : this.innerDebug().enable(); + } + + /** + * Set the enable property: The flag that if enable debug or not. + * + * @param enable the enable value to set. + * @return the TrinoWorker object itself. + */ + public TrinoWorker withEnable(Boolean enable) { + if (this.innerDebug() == null) { + this.innerDebug = new TrinoDebugConfig(); + } + this.innerDebug().withEnable(enable); + return this; + } + + /** + * Get the port property: The debug port. + * + * @return the port value. + */ + public Integer port() { + return this.innerDebug() == null ? null : this.innerDebug().port(); + } + + /** + * Set the port property: The debug port. + * + * @param port the port value to set. + * @return the TrinoWorker object itself. + */ + public TrinoWorker withPort(Integer port) { + if (this.innerDebug() == null) { + this.innerDebug = new TrinoDebugConfig(); + } + this.innerDebug().withPort(port); + return this; + } + + /** + * Get the suspend property: The flag that if suspend debug or not. + * + * @return the suspend value. + */ + public Boolean suspend() { + return this.innerDebug() == null ? null : this.innerDebug().suspend(); + } + + /** + * Set the suspend property: The flag that if suspend debug or not. + * + * @param suspend the suspend value to set. + * @return the TrinoWorker object itself. + */ + public TrinoWorker withSuspend(Boolean suspend) { + if (this.innerDebug() == null) { + this.innerDebug = new TrinoDebugConfig(); + } + this.innerDebug().withSuspend(suspend); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerDebug() != null) { + innerDebug().validate(); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/UpdatableClusterProfile.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/UpdatableClusterProfile.java new file mode 100644 index 000000000000..221764eb7fc0 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/UpdatableClusterProfile.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cluster resource patch properties. */ +@Fluent +public final class UpdatableClusterProfile { + /* + * The service configs profiles. + */ + @JsonProperty(value = "serviceConfigsProfiles") + private List serviceConfigsProfiles; + + /* + * Ssh profile for the cluster. + */ + @JsonProperty(value = "sshProfile") + private SshProfile sshProfile; + + /* + * This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with + * Autoscale. + */ + @JsonProperty(value = "autoscaleProfile") + private AutoscaleProfile autoscaleProfile; + + /* + * Authorization profile with details of AAD user Ids and group Ids authorized for data plane access. + */ + @JsonProperty(value = "authorizationProfile") + private AuthorizationProfile authorizationProfile; + + /* + * Cluster log analytics profile to enable or disable OMS agent for cluster. + */ + @JsonProperty(value = "logAnalyticsProfile") + private ClusterLogAnalyticsProfile logAnalyticsProfile; + + /* + * Cluster Prometheus profile. + */ + @JsonProperty(value = "prometheusProfile") + private ClusterPrometheusProfile prometheusProfile; + + /* + * The script action profile list. + */ + @JsonProperty(value = "scriptActionProfiles") + private List scriptActionProfiles; + + /** Creates an instance of UpdatableClusterProfile class. */ + public UpdatableClusterProfile() { + } + + /** + * Get the serviceConfigsProfiles property: The service configs profiles. + * + * @return the serviceConfigsProfiles value. + */ + public List serviceConfigsProfiles() { + return this.serviceConfigsProfiles; + } + + /** + * Set the serviceConfigsProfiles property: The service configs profiles. + * + * @param serviceConfigsProfiles the serviceConfigsProfiles value to set. + * @return the UpdatableClusterProfile object itself. + */ + public UpdatableClusterProfile withServiceConfigsProfiles( + List serviceConfigsProfiles) { + this.serviceConfigsProfiles = serviceConfigsProfiles; + return this; + } + + /** + * Get the sshProfile property: Ssh profile for the cluster. + * + * @return the sshProfile value. + */ + public SshProfile sshProfile() { + return this.sshProfile; + } + + /** + * Set the sshProfile property: Ssh profile for the cluster. + * + * @param sshProfile the sshProfile value to set. + * @return the UpdatableClusterProfile object itself. + */ + public UpdatableClusterProfile withSshProfile(SshProfile sshProfile) { + this.sshProfile = sshProfile; + return this; + } + + /** + * Get the autoscaleProfile property: This is the Autoscale profile for the cluster. This will allow customer to + * create cluster enabled with Autoscale. + * + * @return the autoscaleProfile value. + */ + public AutoscaleProfile autoscaleProfile() { + return this.autoscaleProfile; + } + + /** + * Set the autoscaleProfile property: This is the Autoscale profile for the cluster. This will allow customer to + * create cluster enabled with Autoscale. + * + * @param autoscaleProfile the autoscaleProfile value to set. + * @return the UpdatableClusterProfile object itself. + */ + public UpdatableClusterProfile withAutoscaleProfile(AutoscaleProfile autoscaleProfile) { + this.autoscaleProfile = autoscaleProfile; + return this; + } + + /** + * Get the authorizationProfile property: Authorization profile with details of AAD user Ids and group Ids + * authorized for data plane access. + * + * @return the authorizationProfile value. + */ + public AuthorizationProfile authorizationProfile() { + return this.authorizationProfile; + } + + /** + * Set the authorizationProfile property: Authorization profile with details of AAD user Ids and group Ids + * authorized for data plane access. + * + * @param authorizationProfile the authorizationProfile value to set. + * @return the UpdatableClusterProfile object itself. + */ + public UpdatableClusterProfile withAuthorizationProfile(AuthorizationProfile authorizationProfile) { + this.authorizationProfile = authorizationProfile; + return this; + } + + /** + * Get the logAnalyticsProfile property: Cluster log analytics profile to enable or disable OMS agent for cluster. + * + * @return the logAnalyticsProfile value. + */ + public ClusterLogAnalyticsProfile logAnalyticsProfile() { + return this.logAnalyticsProfile; + } + + /** + * Set the logAnalyticsProfile property: Cluster log analytics profile to enable or disable OMS agent for cluster. + * + * @param logAnalyticsProfile the logAnalyticsProfile value to set. + * @return the UpdatableClusterProfile object itself. + */ + public UpdatableClusterProfile withLogAnalyticsProfile(ClusterLogAnalyticsProfile logAnalyticsProfile) { + this.logAnalyticsProfile = logAnalyticsProfile; + return this; + } + + /** + * Get the prometheusProfile property: Cluster Prometheus profile. + * + * @return the prometheusProfile value. + */ + public ClusterPrometheusProfile prometheusProfile() { + return this.prometheusProfile; + } + + /** + * Set the prometheusProfile property: Cluster Prometheus profile. + * + * @param prometheusProfile the prometheusProfile value to set. + * @return the UpdatableClusterProfile object itself. + */ + public UpdatableClusterProfile withPrometheusProfile(ClusterPrometheusProfile prometheusProfile) { + this.prometheusProfile = prometheusProfile; + return this; + } + + /** + * Get the scriptActionProfiles property: The script action profile list. + * + * @return the scriptActionProfiles value. + */ + public List scriptActionProfiles() { + return this.scriptActionProfiles; + } + + /** + * Set the scriptActionProfiles property: The script action profile list. + * + * @param scriptActionProfiles the scriptActionProfiles value to set. + * @return the UpdatableClusterProfile object itself. + */ + public UpdatableClusterProfile withScriptActionProfiles(List scriptActionProfiles) { + this.scriptActionProfiles = scriptActionProfiles; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceConfigsProfiles() != null) { + serviceConfigsProfiles().forEach(e -> e.validate()); + } + if (sshProfile() != null) { + sshProfile().validate(); + } + if (autoscaleProfile() != null) { + autoscaleProfile().validate(); + } + if (authorizationProfile() != null) { + authorizationProfile().validate(); + } + if (logAnalyticsProfile() != null) { + logAnalyticsProfile().validate(); + } + if (prometheusProfile() != null) { + prometheusProfile().validate(); + } + if (scriptActionProfiles() != null) { + scriptActionProfiles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/WebConnectivityEndpoint.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/WebConnectivityEndpoint.java new file mode 100644 index 000000000000..0c9f1e02b8b7 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/WebConnectivityEndpoint.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.hdinsightmicrosofthdinsighthdinsightonaks.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Web connectivity endpoint details. */ +@Fluent +public class WebConnectivityEndpoint { + /* + * Web connectivity endpoint. + */ + @JsonProperty(value = "fqdn", required = true) + private String fqdn; + + /** Creates an instance of WebConnectivityEndpoint class. */ + public WebConnectivityEndpoint() { + } + + /** + * Get the fqdn property: Web connectivity endpoint. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: Web connectivity endpoint. + * + * @param fqdn the fqdn value to set. + * @return the WebConnectivityEndpoint object itself. + */ + public WebConnectivityEndpoint withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fqdn() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property fqdn in model WebConnectivityEndpoint")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebConnectivityEndpoint.class); +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/package-info.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/models/package-info.java new file mode 100644 index 000000000000..3317e4cbbba9 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/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 HDInsightOnAksManagementClient. HDInsight On Aks Management Client. */ +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/package-info.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/package-info.java new file mode 100644 index 000000000000..fbc80ff29741 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/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 HDInsightOnAksManagementClient. HDInsight On Aks Management Client. */ +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks; diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/module-info.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/main/java/module-info.java new file mode 100644 index 000000000000..15b34bf4ce01 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/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.hdinsightmicrosofthdinsighthdinsightonaks { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks; + exports com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent; + exports com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models; + exports com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models; + + opens com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Availabl.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Availabl.java new file mode 100644 index 000000000000..7d49dbf3fd57 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Availabl.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.generated; + +/** Samples for AvailableClusterVersions ListByLocation. */ +public final class Availabl { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/ListAvailableClusterVersions.json + */ + /** + * Sample code: ClusterVersionListResult. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void clusterVersionListResult( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.availableClusterVersions().listByLocation("westus2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/ClusterJ.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/ClusterJ.java new file mode 100644 index 000000000000..e09f83a3cd24 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/ClusterJ.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.hdinsightmicrosofthdinsighthdinsightonaks.generated; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.fluent.models.ClusterJobInner; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Action; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.FlinkJobProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ClusterJobs RunJob. */ +public final class ClusterJ { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/RunClusterJob.json + */ + /** + * Sample code: RunClusterJob. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void runClusterJob( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .clusterJobs() + .runJob( + "hiloResourcegroup", + "clusterpool1", + "cluster1", + new ClusterJobInner() + .withProperties( + new FlinkJobProperties() + .withJobName("flink-job-name") + .withJobJarDirectory("abfs://flinkjob@hilosa.dfs.core.windows.net/jars") + .withJarName("flink-sleep-job-0.0.1-SNAPSHOT.jar") + .withEntryClass("com.microsoft.hilo.flink.job.streaming.SleepJob") + .withAction(Action.START) + .withFlinkConfiguration( + mapOf( + "parallelism", + "1", + "savepoint.directory", + "abfs://flinkjob@hilosa.dfs.core.windows.net/savepoint"))), + com.azure.core.util.Context.NONE); + } + + @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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/ClusterP.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/ClusterP.java new file mode 100644 index 000000000000..424680e17c7b --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/ClusterP.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.hdinsightmicrosofthdinsighthdinsightonaks.generated; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterPool; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ClusterPools UpdateTags. */ +public final class ClusterP { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/PatchClusterPool.json + */ + /** + * Sample code: ClusterPoolsPatchTags. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void clusterPoolsPatchTags( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + ClusterPool resource = + manager + .clusterPools() + .getByResourceGroupWithResponse("hiloResourcegroup", "clusterpool1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Clusters.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Clusters.java new file mode 100644 index 000000000000..b26e49cbc549 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Clusters.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.hdinsightmicrosofthdinsighthdinsightonaks.generated; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AuthorizationProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AutoscaleProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.AutoscaleType; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Cluster; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterConfigFile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterLogAnalyticsApplicationLogs; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterLogAnalyticsProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterServiceConfig; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ClusterServiceConfigsProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.Schedule; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ScheduleBasedConfig; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.ScheduleDay; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.SshProfile; +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.UpdatableClusterProfile; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Clusters Update. */ +public final class Clusters { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/PatchCluster.json + */ + /** + * Sample code: HDInsightClustersPatchTags. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void hDInsightClustersPatchTags( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + Cluster resource = + manager + .clusters() + .getWithResponse("hiloResourcegroup", "clusterpool1", "cluster1", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withClusterProfile( + new UpdatableClusterProfile() + .withServiceConfigsProfiles( + Arrays + .asList( + new ClusterServiceConfigsProfile() + .withServiceName("TestService1") + .withConfigs( + Arrays + .asList( + new ClusterServiceConfig() + .withComponent("TestComp1") + .withFiles( + Arrays + .asList( + new ClusterConfigFile() + .withFileName("TestFile1") + .withValues( + mapOf( + "Test.config.1", + "1", + "Test.config.2", + "2")), + new ClusterConfigFile() + .withFileName("TestFile2") + .withValues( + mapOf( + "Test.config.3", + "3", + "Test.config.4", + "4")))), + new ClusterServiceConfig() + .withComponent("TestComp2") + .withFiles( + Arrays + .asList( + new ClusterConfigFile() + .withFileName("TestFile3") + .withContent("TestContent") + .withPath("TestPath"), + new ClusterConfigFile() + .withFileName("TestFile4") + .withValues( + mapOf( + "Test.config.7", + "7", + "Test.config.8", + "8")))))), + new ClusterServiceConfigsProfile() + .withServiceName("TestService2") + .withConfigs( + Arrays + .asList( + new ClusterServiceConfig() + .withComponent("TestComp3") + .withFiles( + Arrays + .asList( + new ClusterConfigFile() + .withFileName("TestFile5") + .withValues(mapOf("Test.config.9", "9")))))))) + .withSshProfile(new SshProfile().withCount(2)) + .withAutoscaleProfile( + new AutoscaleProfile() + .withEnabled(true) + .withGracefulDecommissionTimeout(-1) + .withAutoscaleType(AutoscaleType.SCHEDULE_BASED) + .withScheduleBasedConfig( + new ScheduleBasedConfig() + .withTimeZone("Cen. Australia Standard Time") + .withDefaultCount(3) + .withSchedules( + Arrays + .asList( + new Schedule() + .withStartTime("00:00") + .withEndTime("12:00") + .withCount(3) + .withDays( + Arrays + .asList( + ScheduleDay.fromString("Monday, Tuesday, Wednesday"))), + new Schedule() + .withStartTime("00:00") + .withEndTime("12:00") + .withCount(3) + .withDays(Arrays.asList(ScheduleDay.SUNDAY)))))) + .withAuthorizationProfile( + new AuthorizationProfile().withUserIds(Arrays.asList("Testuser1", "Testuser2"))) + .withLogAnalyticsProfile( + new ClusterLogAnalyticsProfile() + .withEnabled(true) + .withApplicationLogs( + new ClusterLogAnalyticsApplicationLogs() + .withStdOutEnabled(true) + .withStdErrorEnabled(true)) + .withMetricsEnabled(true))) + .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; + } +} +new ScheduleBasedConfig() + .withTimeZone("Cen. Australia Standard Time") + .withDefaultCount(10) + .withSchedules( + Arrays + .asList( + new Schedule() + .withStartTime("00:00") + .withEndTime("12:00") + .withCount(20) + .withDays(Arrays.asList(ScheduleDay.MONDAY)), + new Schedule() + .withStartTime("00:00") + .withEndTime("12:00") + .withCount(25) + .withDays(Arrays.asList(ScheduleDay.SUNDAY))))) + .withLoadBasedConfig( + new LoadBasedConfig() + .withMinNodes(10) + .withMaxNodes(20) + .withPollInterval(60) + .withCooldownPeriod(300) + .withScalingRules( + Arrays + .asList( + new ScalingRule() + .withActionType(ScaleActionType.SCALEUP) + .withEvaluationCount(3) + .withScalingMetric("cpu") + .withComparisonRule( + new ComparisonRule() + .withOperator(ComparisonOperator.GREATER_THAN) + .withThreshold(90f)), + new ScalingRule() + .withActionType(ScaleActionType.SCALEDOWN) + .withEvaluationCount(3) + .withScalingMetric("cpu") + .withComparisonRule( + new ComparisonRule() + .withOperator(ComparisonOperator.LESS_THAN) + .withThreshold(20f)))))) + .withKafkaProfile(mapOf())) + .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/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Location.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Location.java new file mode 100644 index 000000000000..f58a853c5ed6 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Location.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.hdinsightmicrosofthdinsighthdinsightonaks.generated; + +import com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.models.NameAvailabilityParameters; + +/** Samples for Locations CheckNameAvailability. */ +public final class Location { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/LocationsNameAvailability.json + */ + /** + * Sample code: LocationsNameAvailability. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void locationsNameAvailability( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager + .locations() + .checkNameAvailabilityWithResponse( + "southeastasia", + new NameAvailabilityParameters() + .withName("contosemember1") + .withType("Microsoft.HDInsight/clusterPools/clusters"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Operatio.java b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Operatio.java new file mode 100644 index 000000000000..8015120c6465 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/src/samples/java/com/azure/resourcemanager/hdinsightmicrosofthdinsighthdinsightonaks/generated/Operatio.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.generated; + +/** Samples for Operations List. */ +public final class Operatio { + /* + * x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/HDInsightOnAks/preview/2023-06-01-preview/examples/GetOperations.json + */ + /** + * Sample code: ListOperations. + * + * @param manager Entry point to HDInsightOnAksManager. + */ + public static void listOperations( + com.azure.resourcemanager.hdinsightmicrosofthdinsighthdinsightonaks.HDInsightOnAksManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/ci.yml b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/ci.yml new file mode 100644 index 000000000000..c483dd1394df --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightmicrosofthdinsighthdinsightonaks/ci.yml + - sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/ + exclude: + - sdk/hdinsightmicrosofthdinsighthdinsightonaks/pom.xml + - sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightmicrosofthdinsighthdinsightonaks/ci.yml + - sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/ + exclude: + - sdk/hdinsightmicrosofthdinsighthdinsightonaks/pom.xml + - sdk/hdinsightmicrosofthdinsighthdinsightonaks/azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks/pom.xml + +parameters: + - name: release_azureresourcemanagerhdinsightmicrosofthdinsighthdinsightonaks + displayName: azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: hdinsightmicrosofthdinsighthdinsightonaks + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerhdinsightmicrosofthdinsighthdinsightonaks + releaseInBatch: ${{ parameters.release_azureresourcemanagerhdinsightmicrosofthdinsighthdinsightonaks }} diff --git a/sdk/hdinsightmicrosofthdinsighthdinsightonaks/pom.xml b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/pom.xml new file mode 100644 index 000000000000..d2cf9dbc3595 --- /dev/null +++ b/sdk/hdinsightmicrosofthdinsighthdinsightonaks/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-hdinsightmicrosofthdinsighthdinsightonaks-service + pom + 1.0.0 + + + azure-resourcemanager-hdinsightmicrosofthdinsighthdinsightonaks + +