From e131d7d7e07511388464baccbd3609ecf3610122 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 9 Dec 2020 02:18:55 +0000 Subject: [PATCH] CodeGen from PR 11966 in Azure/azure-rest-api-specs Update listHosts response to include new optional properties added for BYOK auto rotation (#11966) Co-authored-by: karuna --- eng/versioning/external_dependencies.txt | 1 + eng/versioning/version_client.txt | 25 +- pom.xml | 12 +- .../CHANGELOG.md | 5 + .../azure-resourcemanager-hdinsight/README.md | 84 + .../azure-resourcemanager-hdinsight/pom.xml | 62 + .../hdinsight/HDInsightManager.java | 297 ++ .../hdinsight/fluent/ApplicationsClient.java | 206 ++ .../hdinsight/fluent/ClustersClient.java | 600 ++++ .../fluent/ConfigurationsClient.java | 152 + .../hdinsight/fluent/ExtensionsClient.java | 308 ++ .../fluent/HDInsightManagementClient.java | 110 + .../hdinsight/fluent/LocationsClient.java | 91 + .../hdinsight/fluent/OperationsClient.java | 36 + .../hdinsight/fluent/ScriptActionsClient.java | 102 + .../ScriptExecutionHistoriesClient.java | 72 + .../fluent/VirtualMachinesClient.java | 102 + .../fluent/models/ApplicationInner.java | 108 + .../BillingResponseListResultInner.java | 114 + .../models/CapabilitiesResultInner.java | 212 ++ .../models/ClusterConfigurationsInner.java | 54 + .../hdinsight/fluent/models/ClusterInner.java | 126 + .../ClusterMonitoringResponseInner.java | 80 + .../fluent/models/ExtensionInner.java | 76 + .../fluent/models/GatewaySettingsInner.java | 71 + .../fluent/models/HostInfoInner.java | 102 + .../fluent/models/OperationInner.java | 80 + .../RuntimeScriptActionDetailInner.java | 165 + .../fluent/models/UsagesListResultInner.java | 55 + .../hdinsight/fluent/models/package-info.java | 6 + .../hdinsight/fluent/package-info.java | 6 + .../implementation/ApplicationImpl.java | 132 + .../ApplicationsClientImpl.java | 1116 ++++++ .../implementation/ApplicationsImpl.java | 189 + .../BillingResponseListResultImpl.java | 59 + .../CapabilitiesResultImpl.java | 85 + .../ClusterConfigurationsImpl.java | 39 + .../hdinsight/implementation/ClusterImpl.java | 201 ++ .../ClusterMonitoringResponseImpl.java | 36 + .../implementation/ClustersClientImpl.java | 3071 +++++++++++++++++ .../implementation/ClustersImpl.java | 265 ++ .../ConfigurationsClientImpl.java | 736 ++++ .../implementation/ConfigurationsImpl.java | 91 + .../implementation/ExtensionImpl.java | 36 + .../implementation/ExtensionsClientImpl.java | 1510 ++++++++ .../implementation/ExtensionsImpl.java | 126 + .../implementation/GatewaySettingsImpl.java | 40 + .../HDInsightManagementClientBuilder.java | 149 + .../HDInsightManagementClientImpl.java | 410 +++ .../implementation/HostInfoImpl.java | 40 + .../implementation/LocationsClientImpl.java | 489 +++ .../implementation/LocationsImpl.java | 108 + .../implementation/OperationImpl.java | 37 + .../implementation/OperationsClientImpl.java | 269 ++ .../implementation/OperationsImpl.java | 46 + .../RuntimeScriptActionDetailImpl.java | 89 + .../ScriptActionsClientImpl.java | 692 ++++ .../implementation/ScriptActionsImpl.java | 88 + .../ScriptExecutionHistoriesClientImpl.java | 513 +++ .../ScriptExecutionHistoriesImpl.java | 59 + .../implementation/UsagesListResultImpl.java | 40 + .../hdinsight/implementation/Utils.java | 31 + .../VirtualMachinesClientImpl.java | 495 +++ .../implementation/VirtualMachinesImpl.java | 81 + .../implementation/package-info.java | 6 + .../hdinsight/models/Application.java | 148 + .../models/ApplicationGetEndpoint.java | 102 + .../models/ApplicationGetHttpsEndpoint.java | 181 + .../models/ApplicationListResult.java | 73 + .../models/ApplicationProperties.java | 285 ++ .../hdinsight/models/Applications.java | 142 + .../hdinsight/models/AsyncOperationState.java | 50 + .../hdinsight/models/Autoscale.java | 82 + .../hdinsight/models/AutoscaleCapacity.java | 76 + ...AutoscaleConfigurationUpdateParameter.java | 53 + .../hdinsight/models/AutoscaleRecurrence.java | 80 + .../hdinsight/models/AutoscaleSchedule.java | 80 + .../models/AutoscaleTimeAndCapacity.java | 102 + .../hdinsight/models/BillingMeters.java | 102 + .../hdinsight/models/BillingResources.java | 109 + .../models/BillingResponseListResult.java | 40 + .../hdinsight/models/CapabilitiesResult.java | 61 + .../hdinsight/models/ClientGroupInfo.java | 76 + .../hdinsight/models/Cluster.java | 234 ++ .../models/ClusterConfigurations.java | 26 + .../ClusterCreateParametersExtended.java | 135 + .../models/ClusterCreateProperties.java | 361 ++ .../hdinsight/models/ClusterDefinition.java | 129 + .../ClusterDiskEncryptionParameters.java | 105 + .../models/ClusterGetProperties.java | 529 +++ .../hdinsight/models/ClusterIdentity.java | 132 + ...ClusterIdentityUserAssignedIdentities.java | 54 + .../hdinsight/models/ClusterListResult.java | 70 + .../models/ClusterMonitoringRequest.java | 76 + .../models/ClusterMonitoringResponse.java | 33 + .../models/ClusterPatchParameters.java | 51 + .../models/ClusterResizeParameters.java | 50 + .../hdinsight/models/Clusters.java | 329 ++ .../hdinsight/models/ComputeProfile.java | 54 + .../hdinsight/models/Configurations.java | 101 + .../models/ConnectivityEndpoint.java | 128 + .../hdinsight/models/DataDisksGroups.java | 80 + .../hdinsight/models/DaysOfWeek.java | 62 + .../hdinsight/models/DirectoryType.java | 44 + .../hdinsight/models/DiskBillingMeters.java | 102 + .../models/DiskEncryptionProperties.java | 183 + .../models/EncryptionInTransitProperties.java | 53 + .../hdinsight/models/Errors.java | 76 + .../models/ExecuteScriptActionParameters.java | 80 + .../hdinsight/models/Extension.java | 31 + .../hdinsight/models/Extensions.java | 168 + .../hdinsight/models/FilterMode.java | 34 + .../hdinsight/models/GatewaySettings.java | 39 + .../HDInsightClusterProvisioningState.java | 56 + .../hdinsight/models/HardwareProfile.java | 50 + .../hdinsight/models/HostInfo.java | 38 + .../models/JsonWebKeyEncryptionAlgorithm.java | 37 + .../hdinsight/models/KafkaRestProperties.java | 53 + .../models/LinuxOperatingSystemProfile.java | 105 + .../hdinsight/models/LocalizedName.java | 76 + .../hdinsight/models/Locations.java | 80 + .../hdinsight/models/NetworkProperties.java | 76 + .../hdinsight/models/OSType.java | 47 + .../hdinsight/models/Operation.java | 31 + .../hdinsight/models/OperationDisplay.java | 103 + .../hdinsight/models/OperationListResult.java | 85 + .../hdinsight/models/Operations.java | 31 + .../hdinsight/models/OsProfile.java | 53 + .../hdinsight/models/PrivateLink.java | 34 + .../hdinsight/models/QuotaCapability.java | 106 + .../hdinsight/models/QuotaInfo.java | 50 + .../models/RegionalQuotaCapability.java | 102 + .../hdinsight/models/RegionsCapability.java | 51 + .../models/ResourceIdentityType.java | 53 + .../models/ResourceProviderConnection.java | 34 + .../hdinsight/models/Role.java | 277 ++ .../hdinsight/models/RoleName.java | 31 + .../hdinsight/models/RuntimeScriptAction.java | 159 + .../models/RuntimeScriptActionDetail.java | 102 + .../hdinsight/models/ScriptAction.java | 117 + .../ScriptActionExecutionHistoryList.java | 59 + .../models/ScriptActionExecutionSummary.java | 54 + .../hdinsight/models/ScriptActions.java | 93 + .../hdinsight/models/ScriptActionsList.java | 70 + .../models/ScriptExecutionHistories.java | 65 + .../hdinsight/models/SecurityProfile.java | 265 ++ .../hdinsight/models/SshProfile.java | 54 + .../hdinsight/models/SshPublicKey.java | 50 + .../hdinsight/models/StorageAccount.java | 213 ++ .../hdinsight/models/StorageProfile.java | 54 + .../hdinsight/models/Tier.java | 47 + .../UpdateGatewaySettingsParameters.java | 105 + .../hdinsight/models/Usage.java | 120 + .../hdinsight/models/UsagesListResult.java | 25 + .../hdinsight/models/VersionSpec.java | 129 + .../hdinsight/models/VersionsCapability.java | 54 + .../hdinsight/models/VirtualMachines.java | 62 + .../models/VirtualNetworkProfile.java | 76 + .../models/VmSizeCompatibilityFilter.java | 181 + .../models/VmSizeCompatibilityFilterV2.java | 215 ++ .../hdinsight/models/VmSizesCapability.java | 51 + .../hdinsight/models/package-info.java | 6 + .../hdinsight/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/hdinsight/ci.yml | 31 + sdk/hdinsight/pom.xml | 14 + 166 files changed, 24424 insertions(+), 16 deletions(-) create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/CHANGELOG.md create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/README.md create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/HDInsightManager.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ApplicationsClient.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ClustersClient.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ConfigurationsClient.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ExtensionsClient.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/HDInsightManagementClient.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/LocationsClient.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/OperationsClient.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ScriptActionsClient.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ScriptExecutionHistoriesClient.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/VirtualMachinesClient.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ApplicationInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/BillingResponseListResultInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/CapabilitiesResultInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterConfigurationsInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterMonitoringResponseInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ExtensionInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/GatewaySettingsInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/HostInfoInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/OperationInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/RuntimeScriptActionDetailInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/UsagesListResultInner.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/package-info.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/package-info.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsClientImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/BillingResponseListResultImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/CapabilitiesResultImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterConfigurationsImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterMonitoringResponseImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersClientImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsClientImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsClientImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/GatewaySettingsImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientBuilder.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HostInfoImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsClientImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsClientImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/RuntimeScriptActionDetailImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsClientImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesClientImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/UsagesListResultImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/Utils.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesClientImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesImpl.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/package-info.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Application.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationGetEndpoint.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationGetHttpsEndpoint.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationListResult.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationProperties.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Applications.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AsyncOperationState.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Autoscale.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleCapacity.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleConfigurationUpdateParameter.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleRecurrence.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleSchedule.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleTimeAndCapacity.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingMeters.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingResources.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingResponseListResult.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/CapabilitiesResult.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClientGroupInfo.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Cluster.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterConfigurations.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateParametersExtended.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateProperties.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDefinition.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDiskEncryptionParameters.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterGetProperties.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterIdentity.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterIdentityUserAssignedIdentities.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterListResult.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterMonitoringRequest.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterMonitoringResponse.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterPatchParameters.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterResizeParameters.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Clusters.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ComputeProfile.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Configurations.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ConnectivityEndpoint.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DataDisksGroups.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DaysOfWeek.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DirectoryType.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DiskBillingMeters.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DiskEncryptionProperties.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/EncryptionInTransitProperties.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Errors.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ExecuteScriptActionParameters.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Extension.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Extensions.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/FilterMode.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/GatewaySettings.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HDInsightClusterProvisioningState.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HardwareProfile.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HostInfo.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/JsonWebKeyEncryptionAlgorithm.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/KafkaRestProperties.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/LinuxOperatingSystemProfile.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/LocalizedName.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Locations.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/NetworkProperties.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OSType.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Operation.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OperationDisplay.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OperationListResult.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Operations.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OsProfile.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/PrivateLink.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/QuotaCapability.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/QuotaInfo.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RegionalQuotaCapability.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RegionsCapability.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ResourceIdentityType.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ResourceProviderConnection.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Role.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RoleName.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RuntimeScriptAction.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RuntimeScriptActionDetail.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptAction.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionExecutionHistoryList.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionExecutionSummary.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActions.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionsList.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptExecutionHistories.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SecurityProfile.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SshProfile.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SshPublicKey.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/StorageAccount.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/StorageProfile.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Tier.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UpdateGatewaySettingsParameters.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Usage.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UsagesListResult.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VersionSpec.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VersionsCapability.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VirtualMachines.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VirtualNetworkProfile.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizeCompatibilityFilter.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizeCompatibilityFilterV2.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizesCapability.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/package-info.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/package-info.java create mode 100644 sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/module-info.java create mode 100644 sdk/hdinsight/ci.yml create mode 100644 sdk/hdinsight/pom.xml diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 62906a566feea..464bc9b7cf1a7 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -110,6 +110,7 @@ org.springframework.kafka:spring-kafka;2.5.7.RELEASE org.springframework.security:spring-security-config;5.3.5.RELEASE org.springframework.security:spring-security-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-client;5.3.5.RELEASE +org.springframework.security:spring-security-oauth2-resource-server;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-core;5.3.5.RELEASE org.springframework.security:spring-security-oauth2-jose;5.3.5.RELEASE org.springframework.security:spring-security-web;5.3.5.RELEASE diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index fa2e6238ee364..271b6c645d74d 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -40,17 +40,22 @@ com.azure:azure-ai-anomalydetector;3.0.0-beta.1;3.0.0-beta.2 com.azure:azure-ai-formrecognizer;3.0.3;3.1.0-beta.2 com.azure:azure-ai-metricsadvisor;1.0.0-beta.2;1.0.0-beta.3 com.azure:azure-ai-textanalytics;5.0.1;5.1.0-beta.4 +com.azure:azure-analytics-synapse-accesscontrol;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-spark;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-communication-chat;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-common;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-administration;1.0.0-beta.3;1.0.0-beta.4 com.azure:azure-communication-sms;1.0.0-beta.3;1.0.0-beta.4 -com.azure:azure-core;1.10.0;1.11.0 -com.azure:azure-core-amqp;1.6.0;1.7.0-beta.3 +com.azure:azure-core;1.11.0;1.12.0-beta.1 +com.azure:azure-core-amqp;2.0.0;2.1.0-beta.1 com.azure:azure-core-amqp-experimental;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-core-experimental;1.0.0-beta.8;1.0.0-beta.9 com.azure:azure-core-http-jdk-httpclient;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-core-http-netty;1.6.3;1.7.0 -com.azure:azure-core-http-okhttp;1.3.3;1.4.0 +com.azure:azure-core-http-netty;1.7.0;1.8.0-beta.1 +com.azure:azure-core-http-okhttp;1.4.0;1.5.0-beta.1 com.azure:azure-core-management;1.0.0;1.1.0-beta.1 com.azure:azure-core-serializer-avro-apache;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-core-serializer-avro-jackson;1.0.0-beta.1;1.0.0-beta.2 @@ -68,12 +73,12 @@ com.azure:azure-data-schemaregistry-avro;1.0.0-beta.4;1.0.0-beta.5 com.azure:azure-data-tables;12.0.0-beta.3;12.0.0-beta.4 com.azure:azure-digitaltwins-core;1.0.1;1.1.0-beta.1 com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-identity;1.2.0;1.3.0-beta.1 +com.azure:azure-identity;1.2.0;1.2.1 com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-eventgrid;2.0.0-beta.3;2.0.0-beta.4 com.azure:azure-messaging-eventhubs;5.3.1;5.4.0-beta.2 com.azure:azure-messaging-eventhubs-checkpointstore-blob;1.3.1;1.4.0-beta.2 -com.azure:azure-messaging-servicebus;7.0.0-beta.7;7.0.0-beta.8 +com.azure:azure-messaging-servicebus;7.0.0;7.1.0-beta.1 com.azure:azure-messaging-servicebus-track1-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-search-documents;11.1.2;11.2.0-beta.4 @@ -94,7 +99,7 @@ com.azure:azure-storage-blob-nio;12.0.0-beta.2;12.0.0-beta.3 com.azure:azure-storage-common;12.9.0;12.10.0-beta.1 com.azure:azure-storage-file-share;12.7.0;12.8.0-beta.1 com.azure:azure-storage-file-datalake;12.3.0;12.4.0-beta.1 -com.azure:azure-storage-internal-avro;12.0.1;12.1.0-beta.1 +com.azure:azure-storage-internal-avro;12.0.1;12.0.2-beta.1 com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-storage-queue;12.7.0;12.8.0-beta.1 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 @@ -168,6 +173,7 @@ com.azure.resourcemanager:azure-resourcemanager-sql;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-storage;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-trafficmanager;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-test;2.0.0-beta.1;2.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-hdinsight;1.0.0-beta.1;1.0.0-beta.1 com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-beta.2 @@ -176,9 +182,7 @@ com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-b # Format; # unreleased_:;dependency-version # note: The unreleased dependencies will not be manipulated with the automatic PR creation code. -unreleased_com.azure:azure-core;1.11.0 -unreleased_com.azure:azure-core-amqp;1.7.0-beta.3 -unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 +unreleased_com.azure:azure-messaging-servicebus;7.0.0 # Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current # version and set the version to the released beta. Released beta dependencies are only valid @@ -188,4 +192,3 @@ unreleased_com.azure:azure-messaging-servicebus;7.0.0-beta.7 # beta_:;dependency-version # note: Released beta versions will not be manipulated with the automatic PR creation code. beta_com.azure:azure-security-keyvault-keys;4.3.0-beta.1 -beta_com.azure:azure-core-amqp;1.7.0-beta.2 diff --git a/pom.xml b/pom.xml index d97614e5dba32..66d491bf93b4a 100644 --- a/pom.xml +++ b/pom.xml @@ -9,35 +9,37 @@ 1.0.0 common/perf-test-core - eng/jacoco-test-coverage eng/code-quality-reports + eng/jacoco-test-coverage sdk/anomalydetector sdk/appconfiguration sdk/authorization sdk/batch sdk/boms - sdk/core - sdk/cosmos sdk/cognitiveservices sdk/communication + sdk/core + sdk/cosmos sdk/digitaltwins sdk/eventgrid sdk/eventhubs sdk/formrecognizer + sdk/hdinsight sdk/identity sdk/keyvault sdk/loganalytics sdk/mediaservices - sdk/monitor sdk/metricsadvisor + sdk/monitor sdk/resourcemanager sdk/schemaregistry sdk/search sdk/servicebus + sdk/spring sdk/storage + sdk/synapse sdk/tables sdk/template sdk/textanalytics - sdk/spring diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/CHANGELOG.md b/sdk/hdinsight/azure-resourcemanager-hdinsight/CHANGELOG.md new file mode 100644 index 0000000000000..3a1a88e05de3e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2020-12-09) + +- Azure Resource Manager HDInsight client library for Java. This package contains Microsoft Azure SDK for HDInsight Management SDK. HDInsight Management Client. Package tag package-2018-06-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). \ No newline at end of file diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/README.md b/sdk/hdinsight/azure-resourcemanager-hdinsight/README.md new file mode 100644 index 0000000000000..901ff7c1d2d77 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/README.md @@ -0,0 +1,84 @@ +# Azure Resource Manager HDInsight client library for Java + +Azure Resource Manager HDInsight client library for Java. + +This package contains Microsoft Azure SDK for HDInsight Management SDK. HDInsight Management Client. Package tag package-2018-06-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +```xml + + com.azure.resourcemanager + azure-resourcemanager-hdinsight + 1.0.0-beta.1 + +``` + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-hdinsight;current}) +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +HDInsightManager manager = HDInsightManager + .authenticate(credential, profile); +``` +[//]: # ({x-version-update-end}) + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +## Troubleshooting + +## Next steps + +## Contributing + +If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft +Azure Projects Contribution Guidelines](http://azure.github.io/guidelines.html). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[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/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml b/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml new file mode 100644 index 0000000000000..efc07c8ec0960 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-hdinsight + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for HDInsight Management + This package contains Microsoft Azure SDK for HDInsight Management SDK. HDInsight Management Client. Package tag package-2018-06-preview. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core-management + 1.0.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/HDInsightManager.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/HDInsightManager.java new file mode 100644 index 0000000000000..b6345b45bb2a9 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/HDInsightManager.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.fluent.HDInsightManagementClient; +import com.azure.resourcemanager.hdinsight.implementation.ApplicationsImpl; +import com.azure.resourcemanager.hdinsight.implementation.ClustersImpl; +import com.azure.resourcemanager.hdinsight.implementation.ConfigurationsImpl; +import com.azure.resourcemanager.hdinsight.implementation.ExtensionsImpl; +import com.azure.resourcemanager.hdinsight.implementation.HDInsightManagementClientBuilder; +import com.azure.resourcemanager.hdinsight.implementation.LocationsImpl; +import com.azure.resourcemanager.hdinsight.implementation.OperationsImpl; +import com.azure.resourcemanager.hdinsight.implementation.ScriptActionsImpl; +import com.azure.resourcemanager.hdinsight.implementation.ScriptExecutionHistoriesImpl; +import com.azure.resourcemanager.hdinsight.implementation.VirtualMachinesImpl; +import com.azure.resourcemanager.hdinsight.models.Applications; +import com.azure.resourcemanager.hdinsight.models.Clusters; +import com.azure.resourcemanager.hdinsight.models.Configurations; +import com.azure.resourcemanager.hdinsight.models.Extensions; +import com.azure.resourcemanager.hdinsight.models.Locations; +import com.azure.resourcemanager.hdinsight.models.Operations; +import com.azure.resourcemanager.hdinsight.models.ScriptActions; +import com.azure.resourcemanager.hdinsight.models.ScriptExecutionHistories; +import com.azure.resourcemanager.hdinsight.models.VirtualMachines; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to HDInsightManager. HDInsight Management Client. */ +public final class HDInsightManager { + private Clusters clusters; + + private Applications applications; + + private Locations locations; + + private Configurations configurations; + + private Extensions extensions; + + private ScriptActions scriptActions; + + private ScriptExecutionHistories scriptExecutionHistories; + + private Operations operations; + + private VirtualMachines virtualMachines; + + private final HDInsightManagementClient clientObject; + + private HDInsightManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new HDInsightManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of HDInsight service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HDInsight service API instance. + */ + public static HDInsightManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create HDInsightManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new HDInsightManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of HDInsight service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the HDInsight service API instance. + */ + public HDInsightManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies + .add( + new UserAgentPolicy( + null, + "com.azure.resourcemanager.hdinsight", + "1.0.0-beta.1", + Configuration.getGlobalConfiguration())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new HDInsightManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Clusters. */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); + } + return clusters; + } + + /** @return Resource collection API of Applications. */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(clientObject.getApplications(), this); + } + return applications; + } + + /** @return Resource collection API of Locations. */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(clientObject.getLocations(), this); + } + return locations; + } + + /** @return Resource collection API of Configurations. */ + public Configurations configurations() { + if (this.configurations == null) { + this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this); + } + return configurations; + } + + /** @return Resource collection API of Extensions. */ + public Extensions extensions() { + if (this.extensions == null) { + this.extensions = new ExtensionsImpl(clientObject.getExtensions(), this); + } + return extensions; + } + + /** @return Resource collection API of ScriptActions. */ + public ScriptActions scriptActions() { + if (this.scriptActions == null) { + this.scriptActions = new ScriptActionsImpl(clientObject.getScriptActions(), this); + } + return scriptActions; + } + + /** @return Resource collection API of ScriptExecutionHistories. */ + public ScriptExecutionHistories scriptExecutionHistories() { + if (this.scriptExecutionHistories == null) { + this.scriptExecutionHistories = + new ScriptExecutionHistoriesImpl(clientObject.getScriptExecutionHistories(), this); + } + return scriptExecutionHistories; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of VirtualMachines. */ + public VirtualMachines virtualMachines() { + if (this.virtualMachines == null) { + this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this); + } + return virtualMachines; + } + + /** + * @return Wrapped service client HDInsightManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public HDInsightManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ApplicationsClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ApplicationsClient.java new file mode 100644 index 0000000000000..333e9f3c837d0 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ApplicationsClient.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.hdinsight.fluent.models.ApplicationInner; + +/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ +public interface ApplicationsClient { + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the specified application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner get(String resourceGroupName, String clusterName, String applicationName); + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the specified application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String applicationName, Context context); + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationInner> beginCreate( + String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters); + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ApplicationInner> beginCreate( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationInner parameters, + Context context); + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner create( + String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters); + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationInner create( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationInner parameters, + Context context); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName, Context context); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String applicationName); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String applicationName, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ClustersClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ClustersClient.java new file mode 100644 index 0000000000000..aeaad38a70896 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ClustersClient.java @@ -0,0 +1,600 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.hdinsight.fluent.models.ClusterInner; +import com.azure.resourcemanager.hdinsight.fluent.models.GatewaySettingsInner; +import com.azure.resourcemanager.hdinsight.models.AutoscaleConfigurationUpdateParameter; +import com.azure.resourcemanager.hdinsight.models.ClusterCreateParametersExtended; +import com.azure.resourcemanager.hdinsight.models.ClusterDiskEncryptionParameters; +import com.azure.resourcemanager.hdinsight.models.ClusterPatchParameters; +import com.azure.resourcemanager.hdinsight.models.ClusterResizeParameters; +import com.azure.resourcemanager.hdinsight.models.ExecuteScriptActionParameters; +import com.azure.resourcemanager.hdinsight.models.RoleName; +import com.azure.resourcemanager.hdinsight.models.UpdateGatewaySettingsParameters; + +/** An instance of this class provides access to all the operations defined in ClustersClient. */ +public interface ClustersClient { + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginCreate( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters); + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ClusterInner> beginCreate( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, Context context); + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner create(String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters); + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner create( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, Context context); + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The PatchCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner update(String resourceGroupName, String clusterName, ClusterPatchParameters parameters); + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The PatchCluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String clusterName, ClusterPatchParameters parameters, Context context); + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName); + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginResize( + String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginResize( + String resourceGroupName, + String clusterName, + RoleName roleName, + ClusterResizeParameters parameters, + Context context); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resize(String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resize( + String resourceGroupName, + String clusterName, + RoleName roleName, + ClusterResizeParameters parameters, + Context context); + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginUpdateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters); + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginUpdateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters, + Context context); + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters); + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters, + Context context); + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters); + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context); + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 rotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters); + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 rotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context); + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the gateway settings for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewaySettingsInner getGatewaySettings(String resourceGroupName, String clusterName); + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the gateway settings for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getGatewaySettingsWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginUpdateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters); + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginUpdateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context); + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters); + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context); + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginExecuteScriptActions( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters); + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginExecuteScriptActions( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context); + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running 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 executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters); + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running 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 executeScriptActions( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ConfigurationsClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ConfigurationsClient.java new file mode 100644 index 0000000000000..47b4698aeea8d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ConfigurationsClient.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterConfigurationsInner; +import java.util.Map; + +/** An instance of this class provides access to all the operations defined in ConfigurationsClient. */ +public interface ConfigurationsClient { + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all configuration information for an HDI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterConfigurationsInner list(String resourceGroupName, String clusterName); + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all configuration information for an HDI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginUpdate( + String resourceGroupName, String clusterName, String configurationName, Map parameters); + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginUpdate( + String resourceGroupName, + String clusterName, + String configurationName, + Map parameters, + Context context); + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified 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 update(String resourceGroupName, String clusterName, String configurationName, Map parameters); + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified 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 update( + String resourceGroupName, + String clusterName, + String configurationName, + Map parameters, + Context context); + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the + * future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration object for the specified configuration for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Map get(String resourceGroupName, String clusterName, String configurationName); + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the + * future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration object for the specified configuration for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> getWithResponse( + String resourceGroupName, String clusterName, String configurationName, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ExtensionsClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ExtensionsClient.java new file mode 100644 index 0000000000000..c77c7afb9c377 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ExtensionsClient.java @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterMonitoringResponseInner; +import com.azure.resourcemanager.hdinsight.fluent.models.ExtensionInner; +import com.azure.resourcemanager.hdinsight.models.ClusterMonitoringRequest; + +/** An instance of this class provides access to all the operations defined in ExtensionsClient. */ +public interface ExtensionsClient { + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginEnableMonitoring( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters); + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginEnableMonitoring( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context); + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters); + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enableMonitoring( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context); + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of Operations Management Suite (OMS) on the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ClusterMonitoringResponseInner getMonitoringStatus(String resourceGroupName, String clusterName); + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of Operations Management Suite (OMS) on the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getMonitoringStatusWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDisableMonitoring(String resourceGroupName, String clusterName); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDisableMonitoring( + String resourceGroupName, String clusterName, Context context); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disableMonitoring(String resourceGroupName, String clusterName); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disableMonitoring(String resourceGroupName, String clusterName, Context context); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginCreate( + String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginCreate( + String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters, Context context); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 create(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 create( + String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters, Context context); + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the extension properties for the specified HDInsight cluster extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionInner get(String resourceGroupName, String clusterName, String extensionName); + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the extension properties for the specified HDInsight cluster extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String clusterName, String extensionName, Context context); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String extensionName); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String extensionName, Context context); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String extensionName); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String extensionName, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/HDInsightManagementClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/HDInsightManagementClient.java new file mode 100644 index 0000000000000..790cd2ba03d1b --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/HDInsightManagementClient.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.hdinsight.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for HDInsightManagementClient class. */ +public interface HDInsightManagementClient { + /** + * Gets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets 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 ClustersClient object to access its operations. + * + * @return the ClustersClient object. + */ + ClustersClient getClusters(); + + /** + * Gets the ApplicationsClient object to access its operations. + * + * @return the ApplicationsClient object. + */ + ApplicationsClient getApplications(); + + /** + * Gets the LocationsClient object to access its operations. + * + * @return the LocationsClient object. + */ + LocationsClient getLocations(); + + /** + * Gets the ConfigurationsClient object to access its operations. + * + * @return the ConfigurationsClient object. + */ + ConfigurationsClient getConfigurations(); + + /** + * Gets the ExtensionsClient object to access its operations. + * + * @return the ExtensionsClient object. + */ + ExtensionsClient getExtensions(); + + /** + * Gets the ScriptActionsClient object to access its operations. + * + * @return the ScriptActionsClient object. + */ + ScriptActionsClient getScriptActions(); + + /** + * Gets the ScriptExecutionHistoriesClient object to access its operations. + * + * @return the ScriptExecutionHistoriesClient object. + */ + ScriptExecutionHistoriesClient getScriptExecutionHistories(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the VirtualMachinesClient object to access its operations. + * + * @return the VirtualMachinesClient object. + */ + VirtualMachinesClient getVirtualMachines(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/LocationsClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/LocationsClient.java new file mode 100644 index 0000000000000..0f3ea2cc8b706 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/LocationsClient.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.hdinsight.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.hdinsight.fluent.models.BillingResponseListResultInner; +import com.azure.resourcemanager.hdinsight.fluent.models.CapabilitiesResultInner; +import com.azure.resourcemanager.hdinsight.fluent.models.UsagesListResultInner; + +/** An instance of this class provides access to all the operations defined in LocationsClient. */ +public interface LocationsClient { + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the capabilities for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilitiesResultInner getCapabilities(String location); + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the capabilities for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCapabilitiesWithResponse(String location, Context context); + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional usages for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UsagesListResultInner listUsages(String location); + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional usages for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listUsagesWithResponse(String location, Context context); + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional billingSpecs for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BillingResponseListResultInner listBillingSpecs(String location); + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional billingSpecs for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listBillingSpecsWithResponse(String location, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/OperationsClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/OperationsClient.java new file mode 100644 index 0000000000000..5faa1c3c3cda0 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.hdinsight.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ScriptActionsClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ScriptActionsClient.java new file mode 100644 index 0000000000000..1a1060e044ff7 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ScriptActionsClient.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.hdinsight.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; + +/** An instance of this class provides access to all the operations defined in ScriptActionsClient. */ +public interface ScriptActionsClient { + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String clusterName, String scriptName); + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String clusterName, String scriptName, Context context); + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context); + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the script execution detail for the given script execution ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RuntimeScriptActionDetailInner getExecutionDetail( + String resourceGroupName, String clusterName, String scriptExecutionId); + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the script execution detail for the given script execution ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getExecutionDetailWithResponse( + String resourceGroupName, String clusterName, String scriptExecutionId, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ScriptExecutionHistoriesClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ScriptExecutionHistoriesClient.java new file mode 100644 index 0000000000000..32b50ec09c748 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/ScriptExecutionHistoriesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; + +/** An instance of this class provides access to all the operations defined in ScriptExecutionHistoriesClient. */ +public interface ScriptExecutionHistoriesClient { + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context); + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void promote(String resourceGroupName, String clusterName, String scriptExecutionId); + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response promoteWithResponse( + String resourceGroupName, String clusterName, String scriptExecutionId, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/VirtualMachinesClient.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/VirtualMachinesClient.java new file mode 100644 index 0000000000000..6ce35c4490631 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/VirtualMachinesClient.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.hdinsight.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsight.fluent.models.HostInfoInner; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ +public interface VirtualMachinesClient { + /** + * Lists the HDInsight clusters hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster hosts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List listHosts(String resourceGroupName, String clusterName); + + /** + * Lists the HDInsight clusters hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster hosts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listHostsWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestartHosts( + String resourceGroupName, String clusterName, List hosts); + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestartHosts( + String resourceGroupName, String clusterName, List hosts, Context context); + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restartHosts(String resourceGroupName, String clusterName, List hosts); + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restartHosts(String resourceGroupName, String clusterName, List hosts, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ApplicationInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ApplicationInner.java new file mode 100644 index 0000000000000..c010938ad55c8 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ApplicationInner.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.hdinsight.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.models.ApplicationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The HDInsight cluster application. */ +@Fluent +public final class ApplicationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationInner.class); + + /* + * The ETag for the application + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The tags for the application. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The properties of the application. + */ + @JsonProperty(value = "properties") + private ApplicationProperties properties; + + /** + * Get the etag property: The ETag for the application. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The ETag for the application. + * + * @param etag the etag value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the tags property: The tags for the application. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags for the application. + * + * @param tags the tags value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The properties of the application. + * + * @return the properties value. + */ + public ApplicationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the application. + * + * @param properties the properties value to set. + * @return the ApplicationInner object itself. + */ + public ApplicationInner withProperties(ApplicationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/BillingResponseListResultInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/BillingResponseListResultInner.java new file mode 100644 index 0000000000000..cc48b95dfac27 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/BillingResponseListResultInner.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.models.BillingResources; +import com.azure.resourcemanager.hdinsight.models.VmSizeCompatibilityFilterV2; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response for the operation to get regional billingSpecs for a subscription. */ +@Fluent +public final class BillingResponseListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingResponseListResultInner.class); + + /* + * The virtual machine sizes to include or exclude. + */ + @JsonProperty(value = "vmSizes") + private List vmSizes; + + /* + * The virtual machine filtering mode. Effectively this can enabling or + * disabling the virtual machine sizes in a particular set. + */ + @JsonProperty(value = "vmSizeFilters") + private List vmSizeFilters; + + /* + * The billing and managed disk billing resources for a region. + */ + @JsonProperty(value = "billingResources") + private List billingResources; + + /** + * Get the vmSizes property: The virtual machine sizes to include or exclude. + * + * @return the vmSizes value. + */ + public List vmSizes() { + return this.vmSizes; + } + + /** + * Set the vmSizes property: The virtual machine sizes to include or exclude. + * + * @param vmSizes the vmSizes value to set. + * @return the BillingResponseListResultInner object itself. + */ + public BillingResponseListResultInner withVmSizes(List vmSizes) { + this.vmSizes = vmSizes; + return this; + } + + /** + * Get the vmSizeFilters property: The virtual machine filtering mode. Effectively this can enabling or disabling + * the virtual machine sizes in a particular set. + * + * @return the vmSizeFilters value. + */ + public List vmSizeFilters() { + return this.vmSizeFilters; + } + + /** + * Set the vmSizeFilters property: The virtual machine filtering mode. Effectively this can enabling or disabling + * the virtual machine sizes in a particular set. + * + * @param vmSizeFilters the vmSizeFilters value to set. + * @return the BillingResponseListResultInner object itself. + */ + public BillingResponseListResultInner withVmSizeFilters(List vmSizeFilters) { + this.vmSizeFilters = vmSizeFilters; + return this; + } + + /** + * Get the billingResources property: The billing and managed disk billing resources for a region. + * + * @return the billingResources value. + */ + public List billingResources() { + return this.billingResources; + } + + /** + * Set the billingResources property: The billing and managed disk billing resources for a region. + * + * @param billingResources the billingResources value to set. + * @return the BillingResponseListResultInner object itself. + */ + public BillingResponseListResultInner withBillingResources(List billingResources) { + this.billingResources = billingResources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmSizeFilters() != null) { + vmSizeFilters().forEach(e -> e.validate()); + } + if (billingResources() != null) { + billingResources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/CapabilitiesResultInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/CapabilitiesResultInner.java new file mode 100644 index 0000000000000..bd97700876eba --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/CapabilitiesResultInner.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.models.QuotaCapability; +import com.azure.resourcemanager.hdinsight.models.RegionsCapability; +import com.azure.resourcemanager.hdinsight.models.VersionsCapability; +import com.azure.resourcemanager.hdinsight.models.VmSizeCompatibilityFilter; +import com.azure.resourcemanager.hdinsight.models.VmSizesCapability; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The Get Capabilities operation response. */ +@Fluent +public final class CapabilitiesResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CapabilitiesResultInner.class); + + /* + * The version capability. + */ + @JsonProperty(value = "versions") + private Map versions; + + /* + * The virtual machine size compatibility features. + */ + @JsonProperty(value = "regions") + private Map regions; + + /* + * The virtual machine sizes. + */ + @JsonProperty(value = "vmSizes") + private Map vmSizes; + + /* + * The virtual machine size compatibility filters. + */ + @JsonProperty(value = "vmSize_filters") + private List vmSizeFilters; + + /* + * The capability features. + */ + @JsonProperty(value = "features") + private List features; + + /* + * The quota capability. + */ + @JsonProperty(value = "quota", access = JsonProperty.Access.WRITE_ONLY) + private QuotaCapability quota; + + /** + * Get the versions property: The version capability. + * + * @return the versions value. + */ + public Map versions() { + return this.versions; + } + + /** + * Set the versions property: The version capability. + * + * @param versions the versions value to set. + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVersions(Map versions) { + this.versions = versions; + return this; + } + + /** + * Get the regions property: The virtual machine size compatibility features. + * + * @return the regions value. + */ + public Map regions() { + return this.regions; + } + + /** + * Set the regions property: The virtual machine size compatibility features. + * + * @param regions the regions value to set. + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withRegions(Map regions) { + this.regions = regions; + return this; + } + + /** + * Get the vmSizes property: The virtual machine sizes. + * + * @return the vmSizes value. + */ + public Map vmSizes() { + return this.vmSizes; + } + + /** + * Set the vmSizes property: The virtual machine sizes. + * + * @param vmSizes the vmSizes value to set. + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVmSizes(Map vmSizes) { + this.vmSizes = vmSizes; + return this; + } + + /** + * Get the vmSizeFilters property: The virtual machine size compatibility filters. + * + * @return the vmSizeFilters value. + */ + public List vmSizeFilters() { + return this.vmSizeFilters; + } + + /** + * Set the vmSizeFilters property: The virtual machine size compatibility filters. + * + * @param vmSizeFilters the vmSizeFilters value to set. + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withVmSizeFilters(List vmSizeFilters) { + this.vmSizeFilters = vmSizeFilters; + return this; + } + + /** + * Get the features property: The capability features. + * + * @return the features value. + */ + public List features() { + return this.features; + } + + /** + * Set the features property: The capability features. + * + * @param features the features value to set. + * @return the CapabilitiesResultInner object itself. + */ + public CapabilitiesResultInner withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Get the quota property: The quota capability. + * + * @return the quota value. + */ + public QuotaCapability quota() { + return this.quota; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (versions() != null) { + versions() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (regions() != null) { + regions() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (vmSizes() != null) { + vmSizes() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (vmSizeFilters() != null) { + vmSizeFilters().forEach(e -> e.validate()); + } + if (quota() != null) { + quota().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterConfigurationsInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterConfigurationsInner.java new file mode 100644 index 0000000000000..52a534aeb29a6 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterConfigurationsInner.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.hdinsight.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The configuration object for the specified cluster. */ +@Fluent +public final class ClusterConfigurationsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterConfigurationsInner.class); + + /* + * The configuration object for the specified configuration for the + * specified cluster. + */ + @JsonProperty(value = "configurations") + private Map configurations; + + /** + * Get the configurations property: The configuration object for the specified configuration for the specified + * cluster. + * + * @return the configurations value. + */ + public Map configurations() { + return this.configurations; + } + + /** + * Set the configurations property: The configuration object for the specified configuration for the specified + * cluster. + * + * @param configurations the configurations value to set. + * @return the ClusterConfigurationsInner object itself. + */ + public ClusterConfigurationsInner withConfigurations(Map configurations) { + this.configurations = configurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterInner.java new file mode 100644 index 0000000000000..7991b66e059ee --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterInner.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.hdinsight.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.models.ClusterGetProperties; +import com.azure.resourcemanager.hdinsight.models.ClusterIdentity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The HDInsight cluster. */ +@Fluent +public final class ClusterInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterInner.class); + + /* + * The ETag for the resource + */ + @JsonProperty(value = "etag") + private String etag; + + /* + * The properties of the cluster. + */ + @JsonProperty(value = "properties") + private ClusterGetProperties properties; + + /* + * The identity of the cluster, if configured. + */ + @JsonProperty(value = "identity") + private ClusterIdentity identity; + + /** + * Get the etag property: The ETag for the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: The ETag for the resource. + * + * @param etag the etag value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the properties property: The properties of the cluster. + * + * @return the properties value. + */ + public ClusterGetProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the cluster. + * + * @param properties the properties value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withProperties(ClusterGetProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The identity of the cluster, if configured. + * + * @return the identity value. + */ + public ClusterIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the cluster, if configured. + * + * @param identity the identity value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withIdentity(ClusterIdentity identity) { + this.identity = identity; + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ClusterInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterMonitoringResponseInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterMonitoringResponseInner.java new file mode 100644 index 0000000000000..a2926587d3a64 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ClusterMonitoringResponseInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Operations Management Suite (OMS) status response. */ +@Fluent +public final class ClusterMonitoringResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterMonitoringResponseInner.class); + + /* + * The status of the Operations Management Suite (OMS) on the HDInsight + * cluster. + */ + @JsonProperty(value = "clusterMonitoringEnabled") + private Boolean clusterMonitoringEnabled; + + /* + * The workspace ID of the Operations Management Suite (OMS) on the + * HDInsight cluster. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /** + * Get the clusterMonitoringEnabled property: The status of the Operations Management Suite (OMS) on the HDInsight + * cluster. + * + * @return the clusterMonitoringEnabled value. + */ + public Boolean clusterMonitoringEnabled() { + return this.clusterMonitoringEnabled; + } + + /** + * Set the clusterMonitoringEnabled property: The status of the Operations Management Suite (OMS) on the HDInsight + * cluster. + * + * @param clusterMonitoringEnabled the clusterMonitoringEnabled value to set. + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner withClusterMonitoringEnabled(Boolean clusterMonitoringEnabled) { + this.clusterMonitoringEnabled = clusterMonitoringEnabled; + return this; + } + + /** + * Get the workspaceId property: The workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param workspaceId the workspaceId value to set. + * @return the ClusterMonitoringResponseInner object itself. + */ + public ClusterMonitoringResponseInner 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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ExtensionInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ExtensionInner.java new file mode 100644 index 0000000000000..4e075c2667f0d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/ExtensionInner.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.hdinsight.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Cluster monitoring extensions. */ +@Fluent +public final class ExtensionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionInner.class); + + /* + * The workspace ID for the cluster monitoring extension. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /* + * The certificate for the cluster monitoring extensions. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the workspaceId property: The workspace ID for the cluster monitoring extension. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The workspace ID for the cluster monitoring extension. + * + * @param workspaceId the workspaceId value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the primaryKey property: The certificate for the cluster monitoring extensions. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: The certificate for the cluster monitoring extensions. + * + * @param primaryKey the primaryKey value to set. + * @return the ExtensionInner object itself. + */ + public ExtensionInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/GatewaySettingsInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/GatewaySettingsInner.java new file mode 100644 index 0000000000000..ff714f42f044f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/GatewaySettingsInner.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.hdinsight.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gateway settings. */ +@Immutable +public final class GatewaySettingsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewaySettingsInner.class); + + /* + * Indicates whether or not the gateway settings based authorization is + * enabled. + */ + @JsonProperty(value = "restAuthCredential.isEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String isCredentialEnabled; + + /* + * The gateway settings user name. + */ + @JsonProperty(value = "restAuthCredential.username", access = JsonProperty.Access.WRITE_ONLY) + private String username; + + /* + * The gateway settings user password. + */ + @JsonProperty(value = "restAuthCredential.password", access = JsonProperty.Access.WRITE_ONLY) + private String password; + + /** + * Get the isCredentialEnabled property: Indicates whether or not the gateway settings based authorization is + * enabled. + * + * @return the isCredentialEnabled value. + */ + public String isCredentialEnabled() { + return this.isCredentialEnabled; + } + + /** + * Get the username property: The gateway settings user name. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Get the password property: The gateway settings user password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/HostInfoInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/HostInfoInner.java new file mode 100644 index 0000000000000..21242672dae4b --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/HostInfoInner.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.hdinsight.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The cluster host information. */ +@Fluent +public final class HostInfoInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HostInfoInner.class); + + /* + * The host name + */ + @JsonProperty(value = "name") + private String name; + + /* + * The Fully Qualified Domain Name of host + */ + @JsonProperty(value = "fqdn") + private String fqdn; + + /* + * The effective disk encryption key URL used by the host + */ + @JsonProperty(value = "effectiveDiskEncryptionKeyUrl") + private String effectiveDiskEncryptionKeyUrl; + + /** + * Get the name property: The host name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The host name. + * + * @param name the name value to set. + * @return the HostInfoInner object itself. + */ + public HostInfoInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the fqdn property: The Fully Qualified Domain Name of host. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Set the fqdn property: The Fully Qualified Domain Name of host. + * + * @param fqdn the fqdn value to set. + * @return the HostInfoInner object itself. + */ + public HostInfoInner withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * Get the effectiveDiskEncryptionKeyUrl property: The effective disk encryption key URL used by the host. + * + * @return the effectiveDiskEncryptionKeyUrl value. + */ + public String effectiveDiskEncryptionKeyUrl() { + return this.effectiveDiskEncryptionKeyUrl; + } + + /** + * Set the effectiveDiskEncryptionKeyUrl property: The effective disk encryption key URL used by the host. + * + * @param effectiveDiskEncryptionKeyUrl the effectiveDiskEncryptionKeyUrl value to set. + * @return the HostInfoInner object itself. + */ + public HostInfoInner withEffectiveDiskEncryptionKeyUrl(String effectiveDiskEncryptionKeyUrl) { + this.effectiveDiskEncryptionKeyUrl = effectiveDiskEncryptionKeyUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/OperationInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..d29edde0daad5 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/OperationInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The HDInsight REST API operation. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * The operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name") + private String name; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the name property: The operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that represents the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/RuntimeScriptActionDetailInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/RuntimeScriptActionDetailInner.java new file mode 100644 index 0000000000000..79a60c78a6e2d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/RuntimeScriptActionDetailInner.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.models.RuntimeScriptAction; +import com.azure.resourcemanager.hdinsight.models.ScriptActionExecutionSummary; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The execution details of a script action. */ +@Immutable +public final class RuntimeScriptActionDetailInner extends RuntimeScriptAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuntimeScriptActionDetailInner.class); + + /* + * The execution id of the script action. + */ + @JsonProperty(value = "scriptExecutionId", access = JsonProperty.Access.WRITE_ONLY) + private Long scriptExecutionId; + + /* + * The start time of script action execution. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /* + * The end time of script action execution. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private String endTime; + + /* + * The current execution status of the script action. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * The reason why the script action was executed. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The summary of script action execution result. + */ + @JsonProperty(value = "executionSummary", access = JsonProperty.Access.WRITE_ONLY) + private List executionSummary; + + /* + * The script action execution debug information. + */ + @JsonProperty(value = "debugInformation", access = JsonProperty.Access.WRITE_ONLY) + private String debugInformation; + + /** + * Get the scriptExecutionId property: The execution id of the script action. + * + * @return the scriptExecutionId value. + */ + public Long scriptExecutionId() { + return this.scriptExecutionId; + } + + /** + * Get the startTime property: The start time of script action execution. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of script action execution. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * Get the status property: The current execution status of the script action. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the operation property: The reason why the script action was executed. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the executionSummary property: The summary of script action execution result. + * + * @return the executionSummary value. + */ + public List executionSummary() { + return this.executionSummary; + } + + /** + * Get the debugInformation property: The script action execution debug information. + * + * @return the debugInformation value. + */ + public String debugInformation() { + return this.debugInformation; + } + + /** {@inheritDoc} */ + @Override + public RuntimeScriptActionDetailInner withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuntimeScriptActionDetailInner withUri(String uri) { + super.withUri(uri); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuntimeScriptActionDetailInner withParameters(String parameters) { + super.withParameters(parameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public RuntimeScriptActionDetailInner withRoles(List roles) { + super.withRoles(roles); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (executionSummary() != null) { + executionSummary().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/UsagesListResultInner.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/UsagesListResultInner.java new file mode 100644 index 0000000000000..f02f9989a95f0 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/UsagesListResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.models.Usage; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response for the operation to get regional usages for a subscription. */ +@Fluent +public final class UsagesListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesListResultInner.class); + + /* + * The list of usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of usages. + * + * @param value the value value to set. + * @return the UsagesListResultInner object itself. + */ + public UsagesListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/package-info.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/models/package-info.java new file mode 100644 index 0000000000000..70052bc7bfb4b --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/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 HDInsightManagementClient. HDInsight Management Client. */ +package com.azure.resourcemanager.hdinsight.fluent.models; diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/package-info.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/fluent/package-info.java new file mode 100644 index 0000000000000..de5f0649eed44 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/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 HDInsightManagementClient. HDInsight Management Client. */ +package com.azure.resourcemanager.hdinsight.fluent; diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationImpl.java new file mode 100644 index 0000000000000..3629ffda46835 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationImpl.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.ApplicationInner; +import com.azure.resourcemanager.hdinsight.models.Application; +import com.azure.resourcemanager.hdinsight.models.ApplicationProperties; +import java.util.Collections; +import java.util.Map; + +public final class ApplicationImpl implements Application, Application.Definition { + private ApplicationInner innerObject; + + private final HDInsightManager serviceManager; + + public ApplicationImpl(ApplicationInner innerObject, HDInsightManager 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 etag() { + return this.innerModel().etag(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ApplicationProperties properties() { + return this.innerModel().properties(); + } + + public ApplicationInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private String applicationName; + + public ApplicationImpl withExistingCluster(String resourceGroupName, String clusterName) { + this.resourceGroupName = resourceGroupName; + this.clusterName = clusterName; + return this; + } + + public Application create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .create(resourceGroupName, clusterName, applicationName, this.innerModel(), Context.NONE); + return this; + } + + public Application create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .create(resourceGroupName, clusterName, applicationName, this.innerModel(), context); + return this; + } + + public ApplicationImpl(String name, HDInsightManager serviceManager) { + this.innerObject = new ApplicationInner(); + this.serviceManager = serviceManager; + this.applicationName = name; + } + + public Application refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .getWithResponse(resourceGroupName, clusterName, applicationName, Context.NONE) + .getValue(); + return this; + } + + public Application refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplications() + .getWithResponse(resourceGroupName, clusterName, applicationName, context) + .getValue(); + return this; + } + + public ApplicationImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ApplicationImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + + public ApplicationImpl withProperties(ApplicationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsClientImpl.java new file mode 100644 index 0000000000000..cd07acb50a843 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsClientImpl.java @@ -0,0 +1,1116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsight.fluent.ApplicationsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.ApplicationInner; +import com.azure.resourcemanager.hdinsight.models.ApplicationListResult; +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 ApplicationsClient. */ +public final class ApplicationsClientImpl implements ApplicationsClient { + private final ClientLogger logger = new ClientLogger(ApplicationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ApplicationsService service; + + /** The service client containing this operation class. */ + private final HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationsClientImpl(HDInsightManagementClientImpl client) { + this.service = + RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightManagementClientApplications to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightManagementC") + private interface ApplicationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/applications") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/applications/{applicationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/applications/{applicationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ApplicationInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/applications/{applicationName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("applicationName") String applicationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + } + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the specified application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String applicationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the specified application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String applicationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName 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, + clusterName, + applicationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the specified application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String applicationName) { + return getWithResponseAsync(resourceGroupName, clusterName, applicationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the specified application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner get(String resourceGroupName, String clusterName, String applicationName) { + return getAsync(resourceGroupName, clusterName, applicationName).block(); + } + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the specified application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String applicationName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, applicationName, context).block(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApplicationInner> beginCreateAsync( + String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApplicationInner.class, ApplicationInner.class, Context.NONE); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ApplicationInner> beginCreateAsync( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterName, applicationName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApplicationInner.class, ApplicationInner.class, context); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationInner> beginCreate( + String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateAsync(resourceGroupName, clusterName, applicationName, parameters).getSyncPoller(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ApplicationInner> beginCreate( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, clusterName, applicationName, parameters, context).getSyncPoller(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return beginCreateAsync(resourceGroupName, clusterName, applicationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, clusterName, applicationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner create( + String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) { + return createAsync(resourceGroupName, clusterName, applicationName, parameters).block(); + } + + /** + * Creates applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param parameters The HDInsight cluster application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationInner create( + String resourceGroupName, + String clusterName, + String applicationName, + ApplicationInner parameters, + Context context) { + return createAsync(resourceGroupName, clusterName, applicationName, parameters, context).block(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String applicationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + applicationName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String applicationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (applicationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter applicationName 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, + clusterName, + applicationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String applicationName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, applicationName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String applicationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, applicationName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationName).getSyncPoller(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String applicationName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationName, context).getSyncPoller(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String applicationName) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String applicationName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, applicationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String applicationName) { + deleteAsync(resourceGroupName, clusterName, applicationName).block(); + } + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String applicationName, Context context) { + deleteAsync(resourceGroupName, clusterName, applicationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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 + .listByClusterNext(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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsImpl.java new file mode 100644 index 0000000000000..296274801ce37 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ApplicationsImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.ApplicationsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.ApplicationInner; +import com.azure.resourcemanager.hdinsight.models.Application; +import com.azure.resourcemanager.hdinsight.models.Applications; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApplicationsImpl implements Applications { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationsImpl.class); + + private final ApplicationsClient innerClient; + + private final HDInsightManager serviceManager; + + public ApplicationsImpl(ApplicationsClient innerClient, HDInsightManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = this.serviceClient().listByCluster(resourceGroupName, clusterName); + return inner.mapPage(inner1 -> new ApplicationImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return inner.mapPage(inner1 -> new ApplicationImpl(inner1, this.manager())); + } + + public Application get(String resourceGroupName, String clusterName, String applicationName) { + ApplicationInner inner = this.serviceClient().get(resourceGroupName, clusterName, applicationName); + if (inner != null) { + return new ApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String applicationName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, applicationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String applicationName) { + this.serviceClient().delete(resourceGroupName, clusterName, applicationName); + } + + public void delete(String resourceGroupName, String clusterName, String applicationName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, applicationName, context); + } + + public Application getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, applicationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.getWithResponse(resourceGroupName, clusterName, applicationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + this.delete(resourceGroupName, clusterName, applicationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "clusters"); + if (clusterName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id))); + } + String applicationName = Utils.getValueFromIdByName(id, "applications"); + if (applicationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + this.delete(resourceGroupName, clusterName, applicationName, context); + } + + private ApplicationsClient serviceClient() { + return this.innerClient; + } + + private HDInsightManager manager() { + return this.serviceManager; + } + + public ApplicationImpl define(String name) { + return new ApplicationImpl(name, this.manager()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/BillingResponseListResultImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/BillingResponseListResultImpl.java new file mode 100644 index 0000000000000..8c2b389515a1e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/BillingResponseListResultImpl.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.hdinsight.implementation; + +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.BillingResponseListResultInner; +import com.azure.resourcemanager.hdinsight.models.BillingResources; +import com.azure.resourcemanager.hdinsight.models.BillingResponseListResult; +import com.azure.resourcemanager.hdinsight.models.VmSizeCompatibilityFilterV2; +import java.util.Collections; +import java.util.List; + +public final class BillingResponseListResultImpl implements BillingResponseListResult { + private BillingResponseListResultInner innerObject; + + private final HDInsightManager serviceManager; + + public BillingResponseListResultImpl(BillingResponseListResultInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List vmSizes() { + List inner = this.innerModel().vmSizes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List vmSizeFilters() { + List inner = this.innerModel().vmSizeFilters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List billingResources() { + List inner = this.innerModel().billingResources(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public BillingResponseListResultInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/CapabilitiesResultImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/CapabilitiesResultImpl.java new file mode 100644 index 0000000000000..c15a1024e2ef1 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/CapabilitiesResultImpl.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.hdinsight.implementation; + +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.CapabilitiesResultInner; +import com.azure.resourcemanager.hdinsight.models.CapabilitiesResult; +import com.azure.resourcemanager.hdinsight.models.QuotaCapability; +import com.azure.resourcemanager.hdinsight.models.RegionsCapability; +import com.azure.resourcemanager.hdinsight.models.VersionsCapability; +import com.azure.resourcemanager.hdinsight.models.VmSizeCompatibilityFilter; +import com.azure.resourcemanager.hdinsight.models.VmSizesCapability; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class CapabilitiesResultImpl implements CapabilitiesResult { + private CapabilitiesResultInner innerObject; + + private final HDInsightManager serviceManager; + + public CapabilitiesResultImpl(CapabilitiesResultInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Map versions() { + Map inner = this.innerModel().versions(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map regions() { + Map inner = this.innerModel().regions(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map vmSizes() { + Map inner = this.innerModel().vmSizes(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public List vmSizeFilters() { + List inner = this.innerModel().vmSizeFilters(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List features() { + List inner = this.innerModel().features(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public QuotaCapability quota() { + return this.innerModel().quota(); + } + + public CapabilitiesResultInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterConfigurationsImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterConfigurationsImpl.java new file mode 100644 index 0000000000000..bbf2e62d5f13b --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterConfigurationsImpl.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.hdinsight.implementation; + +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterConfigurationsInner; +import com.azure.resourcemanager.hdinsight.models.ClusterConfigurations; +import java.util.Collections; +import java.util.Map; + +public final class ClusterConfigurationsImpl implements ClusterConfigurations { + private ClusterConfigurationsInner innerObject; + + private final HDInsightManager serviceManager; + + public ClusterConfigurationsImpl(ClusterConfigurationsInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Map configurations() { + Map inner = this.innerModel().configurations(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ClusterConfigurationsInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterImpl.java new file mode 100644 index 0000000000000..4e285684f83e5 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterImpl.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterInner; +import com.azure.resourcemanager.hdinsight.models.Cluster; +import com.azure.resourcemanager.hdinsight.models.ClusterCreateParametersExtended; +import com.azure.resourcemanager.hdinsight.models.ClusterCreateProperties; +import com.azure.resourcemanager.hdinsight.models.ClusterGetProperties; +import com.azure.resourcemanager.hdinsight.models.ClusterIdentity; +import com.azure.resourcemanager.hdinsight.models.ClusterPatchParameters; +import java.util.Collections; +import java.util.Map; + +public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterInner innerObject; + + private final HDInsightManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String etag() { + return this.innerModel().etag(); + } + + public ClusterGetProperties properties() { + return this.innerModel().properties(); + } + + public ClusterIdentity identity() { + return this.innerModel().identity(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ClusterInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String clusterName; + + private ClusterCreateParametersExtended createParameters; + + private ClusterPatchParameters updateParameters; + + public ClusterImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Cluster create() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .create(resourceGroupName, clusterName, createParameters, Context.NONE); + return this; + } + + public Cluster create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .create(resourceGroupName, clusterName, createParameters, context); + return this; + } + + public ClusterImpl(String name, HDInsightManager serviceManager) { + this.innerObject = new ClusterInner(); + this.serviceManager = serviceManager; + this.clusterName = name; + this.createParameters = new ClusterCreateParametersExtended(); + } + + public ClusterImpl update() { + this.updateParameters = new ClusterPatchParameters(); + return this; + } + + public Cluster apply() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .updateWithResponse(resourceGroupName, clusterName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public Cluster apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .updateWithResponse(resourceGroupName, clusterName, updateParameters, context) + .getValue(); + return this; + } + + public ClusterImpl(ClusterInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.clusterName = Utils.getValueFromIdByName(innerObject.id(), "clusters"); + } + + public Cluster refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE) + .getValue(); + return this; + } + + public Cluster refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getClusters() + .getByResourceGroupWithResponse(resourceGroupName, clusterName, context) + .getValue(); + return this; + } + + public ClusterImpl withRegion(Region location) { + this.createParameters.withLocation(location.toString()); + return this; + } + + public ClusterImpl withRegion(String location) { + this.createParameters.withLocation(location); + return this; + } + + public ClusterImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ClusterImpl withProperties(ClusterCreateProperties properties) { + this.createParameters.withProperties(properties); + return this; + } + + public ClusterImpl withIdentity(ClusterIdentity identity) { + this.createParameters.withIdentity(identity); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterMonitoringResponseImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterMonitoringResponseImpl.java new file mode 100644 index 0000000000000..ae2b642c19bea --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClusterMonitoringResponseImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterMonitoringResponseInner; +import com.azure.resourcemanager.hdinsight.models.ClusterMonitoringResponse; + +public final class ClusterMonitoringResponseImpl implements ClusterMonitoringResponse { + private ClusterMonitoringResponseInner innerObject; + + private final HDInsightManager serviceManager; + + public ClusterMonitoringResponseImpl(ClusterMonitoringResponseInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean clusterMonitoringEnabled() { + return this.innerModel().clusterMonitoringEnabled(); + } + + public String workspaceId() { + return this.innerModel().workspaceId(); + } + + public ClusterMonitoringResponseInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersClientImpl.java new file mode 100644 index 0000000000000..f8f697e3bc070 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersClientImpl.java @@ -0,0 +1,3071 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsight.fluent.ClustersClient; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterInner; +import com.azure.resourcemanager.hdinsight.fluent.models.GatewaySettingsInner; +import com.azure.resourcemanager.hdinsight.models.AutoscaleConfigurationUpdateParameter; +import com.azure.resourcemanager.hdinsight.models.ClusterCreateParametersExtended; +import com.azure.resourcemanager.hdinsight.models.ClusterDiskEncryptionParameters; +import com.azure.resourcemanager.hdinsight.models.ClusterListResult; +import com.azure.resourcemanager.hdinsight.models.ClusterPatchParameters; +import com.azure.resourcemanager.hdinsight.models.ClusterResizeParameters; +import com.azure.resourcemanager.hdinsight.models.ExecuteScriptActionParameters; +import com.azure.resourcemanager.hdinsight.models.RoleName; +import com.azure.resourcemanager.hdinsight.models.UpdateGatewaySettingsParameters; +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 { + private final ClientLogger logger = new ClientLogger(ClustersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ClustersService service; + + /** The service client containing this operation class. */ + private final HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClustersClientImpl(HDInsightManagementClientImpl client) { + this.service = RestProxy.create(ClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightManagementClientClusters to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightManagementC") + private interface ClustersService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterCreateParametersExtended parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterPatchParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters") + @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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/roles/{roleName}/resize") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resize( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("roleName") RoleName roleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterResizeParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/roles/{roleName}/autoscale") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAutoScaleConfiguration( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("roleName") RoleName roleName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AutoscaleConfigurationUpdateParameter parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/rotatediskencryptionkey") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> rotateDiskEncryptionKey( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterDiskEncryptionParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/getGatewaySettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getGatewaySettings( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/updateGatewaySettings") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateGatewaySettings( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateGatewaySettingsParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/executeScriptActions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> executeScriptActions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExecuteScriptActionParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginCreateAsync( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, Context.NONE); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ClusterInner> beginCreateAsync( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ClusterInner.class, ClusterInner.class, context); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginCreate( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ClusterInner> beginCreate( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, Context context) { + return beginCreateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return beginCreateAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, Context context) { + return beginCreateAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner create( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters) { + return createAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Creates a new HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The CreateCluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner create( + String resourceGroupName, String clusterName, ClusterCreateParametersExtended parameters, Context context) { + return createAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The PatchCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterPatchParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The PatchCluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String clusterName, ClusterPatchParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The PatchCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ClusterPatchParameters parameters) { + return updateWithResponseAsync(resourceGroupName, clusterName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The PatchCluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatchParameters parameters) { + return updateAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Patch HDInsight cluster with the specified parameters. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The PatchCluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String clusterName, ClusterPatchParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupAsync(resourceGroupName, clusterName).block(); + } + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @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 clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resizeWithResponseAsync( + String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (roleName == null) { + return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resize( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + roleName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resizeWithResponseAsync( + String resourceGroupName, + String clusterName, + RoleName roleName, + ClusterResizeParameters parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (roleName == null) { + return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resize( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + roleName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResizeAsync( + String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters) { + Mono>> mono = + resizeWithResponseAsync(resourceGroupName, clusterName, roleName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginResizeAsync( + String resourceGroupName, + String clusterName, + RoleName roleName, + ClusterResizeParameters parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resizeWithResponseAsync(resourceGroupName, clusterName, roleName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginResize( + String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters) { + return beginResizeAsync(resourceGroupName, clusterName, roleName, parameters).getSyncPoller(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginResize( + String resourceGroupName, + String clusterName, + RoleName roleName, + ClusterResizeParameters parameters, + Context context) { + return beginResizeAsync(resourceGroupName, clusterName, roleName, parameters, context).getSyncPoller(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resizeAsync( + String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters) { + return beginResizeAsync(resourceGroupName, clusterName, roleName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resizeAsync( + String resourceGroupName, + String clusterName, + RoleName roleName, + ClusterResizeParameters parameters, + Context context) { + return beginResizeAsync(resourceGroupName, clusterName, roleName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resize( + String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters) { + resizeAsync(resourceGroupName, clusterName, roleName, parameters).block(); + } + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resize( + String resourceGroupName, + String clusterName, + RoleName roleName, + ClusterResizeParameters parameters, + Context context) { + resizeAsync(resourceGroupName, clusterName, roleName, parameters, context).block(); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateAutoScaleConfigurationWithResponseAsync( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (roleName == null) { + return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAutoScaleConfiguration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + roleName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateAutoScaleConfigurationWithResponseAsync( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (roleName == null) { + return Mono.error(new IllegalArgumentException("Parameter roleName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateAutoScaleConfiguration( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + roleName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginUpdateAutoScaleConfigurationAsync( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters) { + Mono>> mono = + updateAutoScaleConfigurationWithResponseAsync(resourceGroupName, clusterName, roleName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginUpdateAutoScaleConfigurationAsync( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateAutoScaleConfigurationWithResponseAsync( + resourceGroupName, clusterName, roleName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginUpdateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters) { + return beginUpdateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters) + .getSyncPoller(); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginUpdateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters, + Context context) { + return beginUpdateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAutoScaleConfigurationAsync( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters) { + return beginUpdateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAutoScaleConfigurationAsync( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters, + Context context) { + return beginUpdateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters) { + updateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters).block(); + } + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters, + Context context) { + updateAutoScaleConfigurationAsync(resourceGroupName, clusterName, roleName, parameters, context).block(); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @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.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateDiskEncryptionKeyWithResponseAsync( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .rotateDiskEncryptionKey( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> rotateDiskEncryptionKeyWithResponseAsync( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .rotateDiskEncryptionKey( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRotateDiskEncryptionKeyAsync( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + Mono>> mono = + rotateDiskEncryptionKeyWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRotateDiskEncryptionKeyAsync( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + rotateDiskEncryptionKeyWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + return beginRotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context) { + return beginRotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateDiskEncryptionKeyAsync( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + return beginRotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rotateDiskEncryptionKeyAsync( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context) { + return beginRotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 rotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + rotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 rotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context) { + rotateDiskEncryptionKeyAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the gateway settings for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getGatewaySettingsWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getGatewaySettings( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the gateway settings for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getGatewaySettingsWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getGatewaySettings( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the gateway settings for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getGatewaySettingsAsync(String resourceGroupName, String clusterName) { + return getGatewaySettingsWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the gateway settings for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewaySettingsInner getGatewaySettings(String resourceGroupName, String clusterName) { + return getGatewaySettingsAsync(resourceGroupName, clusterName).block(); + } + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the gateway settings for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGatewaySettingsWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getGatewaySettingsWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateGatewaySettingsWithResponseAsync( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateGatewaySettings( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateGatewaySettingsWithResponseAsync( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateGatewaySettings( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginUpdateGatewaySettingsAsync( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + Mono>> mono = + updateGatewaySettingsWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginUpdateGatewaySettingsAsync( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateGatewaySettingsWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginUpdateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + return beginUpdateGatewaySettingsAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginUpdateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context) { + return beginUpdateGatewaySettingsAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateGatewaySettingsAsync( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + return beginUpdateGatewaySettingsAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateGatewaySettingsAsync( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context) { + return beginUpdateGatewaySettingsAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + updateGatewaySettingsAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 updateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context) { + updateGatewaySettingsAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> executeScriptActionsWithResponseAsync( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .executeScriptActions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> executeScriptActionsWithResponseAsync( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .executeScriptActions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginExecuteScriptActionsAsync( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + Mono>> mono = + executeScriptActionsWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginExecuteScriptActionsAsync( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + executeScriptActionsWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginExecuteScriptActions( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return beginExecuteScriptActionsAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginExecuteScriptActions( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context) { + return beginExecuteScriptActionsAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono executeScriptActionsAsync( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + return beginExecuteScriptActionsAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono executeScriptActionsAsync( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context) { + return beginExecuteScriptActionsAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running 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 executeScriptActions( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + executeScriptActionsAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running 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 executeScriptActions( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context) { + executeScriptActionsAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + @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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersImpl.java new file mode 100644 index 0000000000000..5abefce28cfb7 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ClustersImpl.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.ClustersClient; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterInner; +import com.azure.resourcemanager.hdinsight.fluent.models.GatewaySettingsInner; +import com.azure.resourcemanager.hdinsight.models.AutoscaleConfigurationUpdateParameter; +import com.azure.resourcemanager.hdinsight.models.Cluster; +import com.azure.resourcemanager.hdinsight.models.ClusterDiskEncryptionParameters; +import com.azure.resourcemanager.hdinsight.models.ClusterResizeParameters; +import com.azure.resourcemanager.hdinsight.models.Clusters; +import com.azure.resourcemanager.hdinsight.models.ExecuteScriptActionParameters; +import com.azure.resourcemanager.hdinsight.models.GatewaySettings; +import com.azure.resourcemanager.hdinsight.models.RoleName; +import com.azure.resourcemanager.hdinsight.models.UpdateGatewaySettingsParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ClustersImpl implements Clusters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClustersImpl.class); + + private final ClustersClient innerClient; + + private final HDInsightManager serviceManager; + + public ClustersImpl(ClustersClient innerClient, HDInsightManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String clusterName) { + this.serviceClient().delete(resourceGroupName, clusterName); + } + + public void delete(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, context); + } + + public Cluster getByResourceGroup(String resourceGroupName, String clusterName) { + ClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return inner.mapPage(inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public void resize( + String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters) { + this.serviceClient().resize(resourceGroupName, clusterName, roleName, parameters); + } + + public void resize( + String resourceGroupName, + String clusterName, + RoleName roleName, + ClusterResizeParameters parameters, + Context context) { + this.serviceClient().resize(resourceGroupName, clusterName, roleName, parameters, context); + } + + public void updateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters) { + this.serviceClient().updateAutoScaleConfiguration(resourceGroupName, clusterName, roleName, parameters); + } + + public void updateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters, + Context context) { + this + .serviceClient() + .updateAutoScaleConfiguration(resourceGroupName, clusterName, roleName, parameters, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new ClusterImpl(inner1, this.manager())); + } + + public void rotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) { + this.serviceClient().rotateDiskEncryptionKey(resourceGroupName, clusterName, parameters); + } + + public void rotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context) { + this.serviceClient().rotateDiskEncryptionKey(resourceGroupName, clusterName, parameters, context); + } + + public GatewaySettings getGatewaySettings(String resourceGroupName, String clusterName) { + GatewaySettingsInner inner = this.serviceClient().getGatewaySettings(resourceGroupName, clusterName); + if (inner != null) { + return new GatewaySettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getGatewaySettingsWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getGatewaySettingsWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GatewaySettingsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void updateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters) { + this.serviceClient().updateGatewaySettings(resourceGroupName, clusterName, parameters); + } + + public void updateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context) { + this.serviceClient().updateGatewaySettings(resourceGroupName, clusterName, parameters, context); + } + + public void executeScriptActions( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters) { + this.serviceClient().executeScriptActions(resourceGroupName, clusterName, parameters); + } + + public void executeScriptActions( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context) { + this.serviceClient().executeScriptActions(resourceGroupName, clusterName, parameters, context); + } + + 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 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.getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "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.getByResourceGroupWithResponse(resourceGroupName, clusterName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "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, clusterName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String clusterName = Utils.getValueFromIdByName(id, "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, clusterName, context); + } + + private ClustersClient serviceClient() { + return this.innerClient; + } + + private HDInsightManager manager() { + return this.serviceManager; + } + + public ClusterImpl define(String name) { + return new ClusterImpl(name, this.manager()); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsClientImpl.java new file mode 100644 index 0000000000000..13444d0d0d970 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsClientImpl.java @@ -0,0 +1,736 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsight.fluent.ConfigurationsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterConfigurationsInner; +import java.nio.ByteBuffer; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConfigurationsClient. */ +public final class ConfigurationsClientImpl implements ConfigurationsClient { + private final ClientLogger logger = new ClientLogger(ConfigurationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ConfigurationsService service; + + /** The service client containing this operation class. */ + private final HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigurationsClientImpl(HDInsightManagementClientImpl client) { + this.service = + RestProxy.create(ConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightManagementClientConfigurations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightManagementC") + private interface ConfigurationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/configurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/configurations/{configurationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("configurationName") String configurationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Map parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/configurations/{configurationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("configurationName") String configurationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all configuration information for an HDI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all configuration information for an HDI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all configuration information for an HDI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String clusterName) { + return listWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all configuration information for an HDI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterConfigurationsInner list(String resourceGroupName, String clusterName) { + return listAsync(resourceGroupName, clusterName).block(); + } + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all configuration information for an HDI cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String clusterName, Context context) { + return listWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String clusterName, String configurationName, Map parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + configurationName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String clusterName, + String configurationName, + Map parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + configurationName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginUpdateAsync( + String resourceGroupName, String clusterName, String configurationName, Map parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, configurationName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginUpdateAsync( + String resourceGroupName, + String clusterName, + String configurationName, + Map parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, configurationName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginUpdate( + String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, configurationName, parameters).getSyncPoller(); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginUpdate( + String resourceGroupName, + String clusterName, + String configurationName, + Map parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, configurationName, parameters, context).getSyncPoller(); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, String configurationName, Map parameters) { + return beginUpdateAsync(resourceGroupName, clusterName, configurationName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String clusterName, + String configurationName, + Map parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, configurationName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified 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 update( + String resourceGroupName, String clusterName, String configurationName, Map parameters) { + updateAsync(resourceGroupName, clusterName, configurationName, parameters).block(); + } + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified 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 update( + String resourceGroupName, + String clusterName, + String configurationName, + Map parameters, + Context context) { + updateAsync(resourceGroupName, clusterName, configurationName, parameters, context).block(); + } + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the + * future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration object for the specified configuration for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getWithResponseAsync( + String resourceGroupName, String clusterName, String configurationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + configurationName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the + * future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration object for the specified configuration for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getWithResponseAsync( + String resourceGroupName, String clusterName, String configurationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (configurationName == null) { + return Mono + .error(new IllegalArgumentException("Parameter configurationName 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, + clusterName, + configurationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the + * future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration object for the specified configuration for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAsync(String resourceGroupName, String clusterName, String configurationName) { + return getWithResponseAsync(resourceGroupName, clusterName, configurationName) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the + * future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration object for the specified configuration for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Map get(String resourceGroupName, String clusterName, String configurationName) { + return getAsync(resourceGroupName, clusterName, configurationName).block(); + } + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the + * future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration object for the specified configuration for the specified cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> getWithResponse( + String resourceGroupName, String clusterName, String configurationName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, configurationName, context).block(); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsImpl.java new file mode 100644 index 0000000000000..2dbb9e723fd84 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ConfigurationsImpl.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.hdinsight.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.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.ConfigurationsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterConfigurationsInner; +import com.azure.resourcemanager.hdinsight.models.ClusterConfigurations; +import com.azure.resourcemanager.hdinsight.models.Configurations; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.Map; + +public final class ConfigurationsImpl implements Configurations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationsImpl.class); + + private final ConfigurationsClient innerClient; + + private final HDInsightManager serviceManager; + + public ConfigurationsImpl(ConfigurationsClient innerClient, HDInsightManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ClusterConfigurations list(String resourceGroupName, String clusterName) { + ClusterConfigurationsInner inner = this.serviceClient().list(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterConfigurationsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterConfigurationsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void update( + String resourceGroupName, String clusterName, String configurationName, Map parameters) { + this.serviceClient().update(resourceGroupName, clusterName, configurationName, parameters); + } + + public void update( + String resourceGroupName, + String clusterName, + String configurationName, + Map parameters, + Context context) { + this.serviceClient().update(resourceGroupName, clusterName, configurationName, parameters, context); + } + + public Map get(String resourceGroupName, String clusterName, String configurationName) { + Map inner = this.serviceClient().get(resourceGroupName, clusterName, configurationName); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Response> getWithResponse( + String resourceGroupName, String clusterName, String configurationName, Context context) { + return this.serviceClient().getWithResponse(resourceGroupName, clusterName, configurationName, context); + } + + private ConfigurationsClient serviceClient() { + return this.innerClient; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionImpl.java new file mode 100644 index 0000000000000..ce5a30c9294c9 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.ExtensionInner; +import com.azure.resourcemanager.hdinsight.models.Extension; + +public final class ExtensionImpl implements Extension { + private ExtensionInner innerObject; + + private final HDInsightManager serviceManager; + + public ExtensionImpl(ExtensionInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String workspaceId() { + return this.innerModel().workspaceId(); + } + + public String primaryKey() { + return this.innerModel().primaryKey(); + } + + public ExtensionInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsClientImpl.java new file mode 100644 index 0000000000000..af04ac11e93c9 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsClientImpl.java @@ -0,0 +1,1510 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsight.fluent.ExtensionsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterMonitoringResponseInner; +import com.azure.resourcemanager.hdinsight.fluent.models.ExtensionInner; +import com.azure.resourcemanager.hdinsight.models.ClusterMonitoringRequest; +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 ExtensionsClient. */ +public final class ExtensionsClientImpl implements ExtensionsClient { + private final ClientLogger logger = new ClientLogger(ExtensionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExtensionsService service; + + /** The service client containing this operation class. */ + private final HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ExtensionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExtensionsClientImpl(HDInsightManagementClientImpl client) { + this.service = + RestProxy.create(ExtensionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightManagementClientExtensions to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightManagementC") + private interface ExtensionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/extensions/clustermonitoring") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableMonitoring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ClusterMonitoringRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/extensions/clustermonitoring") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getMonitoringStatus( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/extensions/clustermonitoring") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disableMonitoring( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/extensions/{extensionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExtensionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/extensions/{extensionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/extensions/{extensionName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("extensionName") String extensionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableMonitoringWithResponseAsync( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enableMonitoring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableMonitoringWithResponseAsync( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enableMonitoring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginEnableMonitoringAsync( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + Mono>> mono = + enableMonitoringWithResponseAsync(resourceGroupName, clusterName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginEnableMonitoringAsync( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + enableMonitoringWithResponseAsync(resourceGroupName, clusterName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginEnableMonitoring( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return beginEnableMonitoringAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginEnableMonitoring( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context) { + return beginEnableMonitoringAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableMonitoringAsync( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + return beginEnableMonitoringAsync(resourceGroupName, clusterName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableMonitoringAsync( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context) { + return beginEnableMonitoringAsync(resourceGroupName, clusterName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + enableMonitoringAsync(resourceGroupName, clusterName, parameters).block(); + } + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enableMonitoring( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context) { + enableMonitoringAsync(resourceGroupName, clusterName, parameters, context).block(); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of Operations Management Suite (OMS) on the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getMonitoringStatusWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getMonitoringStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of Operations Management Suite (OMS) on the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getMonitoringStatusWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getMonitoringStatus( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of Operations Management Suite (OMS) on the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getMonitoringStatusAsync( + String resourceGroupName, String clusterName) { + return getMonitoringStatusWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of Operations Management Suite (OMS) on the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterMonitoringResponseInner getMonitoringStatus(String resourceGroupName, String clusterName) { + return getMonitoringStatusAsync(resourceGroupName, clusterName).block(); + } + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of Operations Management Suite (OMS) on the HDInsight cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMonitoringStatusWithResponse( + String resourceGroupName, String clusterName, Context context) { + return getMonitoringStatusWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableMonitoringWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disableMonitoring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableMonitoringWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disableMonitoring( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDisableMonitoringAsync( + String resourceGroupName, String clusterName) { + Mono>> mono = disableMonitoringWithResponseAsync(resourceGroupName, clusterName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDisableMonitoringAsync( + String resourceGroupName, String clusterName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disableMonitoringWithResponseAsync(resourceGroupName, clusterName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDisableMonitoring(String resourceGroupName, String clusterName) { + return beginDisableMonitoringAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDisableMonitoring( + String resourceGroupName, String clusterName, Context context) { + return beginDisableMonitoringAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableMonitoringAsync(String resourceGroupName, String clusterName) { + return beginDisableMonitoringAsync(resourceGroupName, clusterName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableMonitoringAsync(String resourceGroupName, String clusterName, Context context) { + return beginDisableMonitoringAsync(resourceGroupName, clusterName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableMonitoring(String resourceGroupName, String clusterName) { + disableMonitoringAsync(resourceGroupName, clusterName).block(); + } + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableMonitoring(String resourceGroupName, String clusterName, Context context) { + disableMonitoringAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + extensionName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String clusterName, + String extensionName, + ExtensionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + extensionName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginCreateAsync( + String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterName, extensionName, parameters); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginCreateAsync( + String resourceGroupName, + String clusterName, + String extensionName, + ExtensionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, clusterName, extensionName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCreate( + String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + return beginCreateAsync(resourceGroupName, clusterName, extensionName, parameters).getSyncPoller(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginCreate( + String resourceGroupName, + String clusterName, + String extensionName, + ExtensionInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, clusterName, extensionName, parameters, context).getSyncPoller(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + return beginCreateAsync(resourceGroupName, clusterName, extensionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String clusterName, + String extensionName, + ExtensionInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, clusterName, extensionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 create(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + createAsync(resourceGroupName, clusterName, extensionName, parameters).block(); + } + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 create( + String resourceGroupName, + String clusterName, + String extensionName, + ExtensionInner parameters, + Context context) { + createAsync(resourceGroupName, clusterName, extensionName, parameters, context).block(); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the extension properties for the specified HDInsight cluster extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String extensionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + extensionName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the extension properties for the specified HDInsight cluster extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String clusterName, String extensionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName 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, + clusterName, + extensionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the extension properties for the specified HDInsight cluster extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String clusterName, String extensionName) { + return getWithResponseAsync(resourceGroupName, clusterName, extensionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the extension properties for the specified HDInsight cluster extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionInner get(String resourceGroupName, String clusterName, String extensionName) { + return getAsync(resourceGroupName, clusterName, extensionName).block(); + } + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the extension properties for the specified HDInsight cluster extension. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String clusterName, String extensionName, Context context) { + return getWithResponseAsync(resourceGroupName, clusterName, extensionName, context).block(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String extensionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + extensionName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String extensionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (extensionName == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionName 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, + clusterName, + extensionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String extensionName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, extensionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String clusterName, String extensionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, clusterName, extensionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String extensionName) { + return beginDeleteAsync(resourceGroupName, clusterName, extensionName).getSyncPoller(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String clusterName, String extensionName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, extensionName, context).getSyncPoller(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String extensionName) { + return beginDeleteAsync(resourceGroupName, clusterName, extensionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String clusterName, String extensionName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, extensionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String extensionName) { + deleteAsync(resourceGroupName, clusterName, extensionName).block(); + } + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String extensionName, Context context) { + deleteAsync(resourceGroupName, clusterName, extensionName, context).block(); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsImpl.java new file mode 100644 index 0000000000000..cfcc475c8fed5 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsImpl.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.hdinsight.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.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.ExtensionsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterMonitoringResponseInner; +import com.azure.resourcemanager.hdinsight.fluent.models.ExtensionInner; +import com.azure.resourcemanager.hdinsight.models.ClusterMonitoringRequest; +import com.azure.resourcemanager.hdinsight.models.ClusterMonitoringResponse; +import com.azure.resourcemanager.hdinsight.models.Extension; +import com.azure.resourcemanager.hdinsight.models.Extensions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExtensionsImpl implements Extensions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionsImpl.class); + + private final ExtensionsClient innerClient; + + private final HDInsightManager serviceManager; + + public ExtensionsImpl(ExtensionsClient innerClient, HDInsightManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters) { + this.serviceClient().enableMonitoring(resourceGroupName, clusterName, parameters); + } + + public void enableMonitoring( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context) { + this.serviceClient().enableMonitoring(resourceGroupName, clusterName, parameters, context); + } + + public ClusterMonitoringResponse getMonitoringStatus(String resourceGroupName, String clusterName) { + ClusterMonitoringResponseInner inner = this.serviceClient().getMonitoringStatus(resourceGroupName, clusterName); + if (inner != null) { + return new ClusterMonitoringResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getMonitoringStatusWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response inner = + this.serviceClient().getMonitoringStatusWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ClusterMonitoringResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void disableMonitoring(String resourceGroupName, String clusterName) { + this.serviceClient().disableMonitoring(resourceGroupName, clusterName); + } + + public void disableMonitoring(String resourceGroupName, String clusterName, Context context) { + this.serviceClient().disableMonitoring(resourceGroupName, clusterName, context); + } + + public void create(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters) { + this.serviceClient().create(resourceGroupName, clusterName, extensionName, parameters); + } + + public void create( + String resourceGroupName, + String clusterName, + String extensionName, + ExtensionInner parameters, + Context context) { + this.serviceClient().create(resourceGroupName, clusterName, extensionName, parameters, context); + } + + public Extension get(String resourceGroupName, String clusterName, String extensionName) { + ExtensionInner inner = this.serviceClient().get(resourceGroupName, clusterName, extensionName); + if (inner != null) { + return new ExtensionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String clusterName, String extensionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, clusterName, extensionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExtensionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String clusterName, String extensionName) { + this.serviceClient().delete(resourceGroupName, clusterName, extensionName); + } + + public void delete(String resourceGroupName, String clusterName, String extensionName, Context context) { + this.serviceClient().delete(resourceGroupName, clusterName, extensionName, context); + } + + private ExtensionsClient serviceClient() { + return this.innerClient; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/GatewaySettingsImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/GatewaySettingsImpl.java new file mode 100644 index 0000000000000..942696818d482 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/GatewaySettingsImpl.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.hdinsight.implementation; + +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.GatewaySettingsInner; +import com.azure.resourcemanager.hdinsight.models.GatewaySettings; + +public final class GatewaySettingsImpl implements GatewaySettings { + private GatewaySettingsInner innerObject; + + private final HDInsightManager serviceManager; + + public GatewaySettingsImpl(GatewaySettingsInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String isCredentialEnabled() { + return this.innerModel().isCredentialEnabled(); + } + + public String username() { + return this.innerModel().username(); + } + + public String password() { + return this.innerModel().password(); + } + + public GatewaySettingsInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientBuilder.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientBuilder.java new file mode 100644 index 0000000000000..1db260ef91fa7 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the HDInsightManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {HDInsightManagementClientImpl.class}) +public final class HDInsightManagementClientBuilder { + /* + * The subscription credentials which uniquely identify Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the HDInsightManagementClientBuilder. + */ + public HDInsightManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the HDInsightManagementClientBuilder. + */ + public HDInsightManagementClientBuilder 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 HDInsightManagementClientBuilder. + */ + public HDInsightManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the HDInsightManagementClientBuilder. + */ + public HDInsightManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the HDInsightManagementClientBuilder. + */ + public HDInsightManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the HDInsightManagementClientBuilder. + */ + public HDInsightManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of HDInsightManagementClientImpl with the provided parameters. + * + * @return an instance of HDInsightManagementClientImpl. + */ + public HDInsightManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + HDInsightManagementClientImpl client = + new HDInsightManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientImpl.java new file mode 100644 index 0000000000000..0bd23b7442d69 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HDInsightManagementClientImpl.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.hdinsight.fluent.ApplicationsClient; +import com.azure.resourcemanager.hdinsight.fluent.ClustersClient; +import com.azure.resourcemanager.hdinsight.fluent.ConfigurationsClient; +import com.azure.resourcemanager.hdinsight.fluent.ExtensionsClient; +import com.azure.resourcemanager.hdinsight.fluent.HDInsightManagementClient; +import com.azure.resourcemanager.hdinsight.fluent.LocationsClient; +import com.azure.resourcemanager.hdinsight.fluent.OperationsClient; +import com.azure.resourcemanager.hdinsight.fluent.ScriptActionsClient; +import com.azure.resourcemanager.hdinsight.fluent.ScriptExecutionHistoriesClient; +import com.azure.resourcemanager.hdinsight.fluent.VirtualMachinesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the HDInsightManagementClientImpl type. */ +@ServiceClient(builder = HDInsightManagementClientBuilder.class) +public final class HDInsightManagementClientImpl implements HDInsightManagementClient { + private final ClientLogger logger = new ClientLogger(HDInsightManagementClientImpl.class); + + /** + * The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part + * of the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** 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 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 ApplicationsClient object to access its operations. */ + private final ApplicationsClient applications; + + /** + * Gets the ApplicationsClient object to access its operations. + * + * @return the ApplicationsClient object. + */ + public ApplicationsClient getApplications() { + return this.applications; + } + + /** 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 ConfigurationsClient object to access its operations. */ + private final ConfigurationsClient configurations; + + /** + * Gets the ConfigurationsClient object to access its operations. + * + * @return the ConfigurationsClient object. + */ + public ConfigurationsClient getConfigurations() { + return this.configurations; + } + + /** The ExtensionsClient object to access its operations. */ + private final ExtensionsClient extensions; + + /** + * Gets the ExtensionsClient object to access its operations. + * + * @return the ExtensionsClient object. + */ + public ExtensionsClient getExtensions() { + return this.extensions; + } + + /** The ScriptActionsClient object to access its operations. */ + private final ScriptActionsClient scriptActions; + + /** + * Gets the ScriptActionsClient object to access its operations. + * + * @return the ScriptActionsClient object. + */ + public ScriptActionsClient getScriptActions() { + return this.scriptActions; + } + + /** The ScriptExecutionHistoriesClient object to access its operations. */ + private final ScriptExecutionHistoriesClient scriptExecutionHistories; + + /** + * Gets the ScriptExecutionHistoriesClient object to access its operations. + * + * @return the ScriptExecutionHistoriesClient object. + */ + public ScriptExecutionHistoriesClient getScriptExecutionHistories() { + return this.scriptExecutionHistories; + } + + /** 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 VirtualMachinesClient object to access its operations. */ + private final VirtualMachinesClient virtualMachines; + + /** + * Gets the VirtualMachinesClient object to access its operations. + * + * @return the VirtualMachinesClient object. + */ + public VirtualMachinesClient getVirtualMachines() { + return this.virtualMachines; + } + + /** + * Initializes an instance of HDInsightManagementClient 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 subscription credentials which uniquely identify Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + HDInsightManagementClientImpl( + 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 = "2018-06-01-preview"; + this.clusters = new ClustersClientImpl(this); + this.applications = new ApplicationsClientImpl(this); + this.locations = new LocationsClientImpl(this); + this.configurations = new ConfigurationsClientImpl(this); + this.extensions = new ExtensionsClientImpl(this); + this.scriptActions = new ScriptActionsClientImpl(this); + this.scriptExecutionHistories = new ScriptExecutionHistoriesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.virtualMachines = new VirtualMachinesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException 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.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HostInfoImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HostInfoImpl.java new file mode 100644 index 0000000000000..dd5211819067a --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/HostInfoImpl.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.hdinsight.implementation; + +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.HostInfoInner; +import com.azure.resourcemanager.hdinsight.models.HostInfo; + +public final class HostInfoImpl implements HostInfo { + private HostInfoInner innerObject; + + private final HDInsightManager serviceManager; + + public HostInfoImpl(HostInfoInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public String effectiveDiskEncryptionKeyUrl() { + return this.innerModel().effectiveDiskEncryptionKeyUrl(); + } + + public HostInfoInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsClientImpl.java new file mode 100644 index 0000000000000..1c15cb59af081 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsClientImpl.java @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.fluent.LocationsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.BillingResponseListResultInner; +import com.azure.resourcemanager.hdinsight.fluent.models.CapabilitiesResultInner; +import com.azure.resourcemanager.hdinsight.fluent.models.UsagesListResultInner; +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 { + private final ClientLogger logger = new ClientLogger(LocationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LocationsService service; + + /** The service client containing this operation class. */ + private final HDInsightManagementClientImpl client; + + /** + * Initializes an instance of LocationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LocationsClientImpl(HDInsightManagementClientImpl client) { + this.service = + RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightManagementClientLocations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightManagementC") + private interface LocationsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/capabilities") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCapabilities( + @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("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsages( + @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("/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/billingSpecs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBillingSpecs( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the capabilities for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCapabilitiesWithResponseAsync(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 + .getCapabilities( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the capabilities for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCapabilitiesWithResponseAsync(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 + .getCapabilities( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the capabilities for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getCapabilitiesAsync(String location) { + return getCapabilitiesWithResponseAsync(location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the capabilities for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilitiesResultInner getCapabilities(String location) { + return getCapabilitiesAsync(location).block(); + } + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the capabilities for the specified location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCapabilitiesWithResponse(String location, Context context) { + return getCapabilitiesWithResponseAsync(location, context).block(); + } + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional usages for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesWithResponseAsync(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 + .listUsages( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional usages for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesWithResponseAsync(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 + .listUsages( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional usages for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listUsagesAsync(String location) { + return listUsagesWithResponseAsync(location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional usages for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UsagesListResultInner listUsages(String location) { + return listUsagesAsync(location).block(); + } + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional usages for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listUsagesWithResponse(String location, Context context) { + return listUsagesWithResponseAsync(location, context).block(); + } + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional billingSpecs for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBillingSpecsWithResponseAsync(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 + .listBillingSpecs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional billingSpecs for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBillingSpecsWithResponseAsync( + 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 + .listBillingSpecs( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional billingSpecs for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listBillingSpecsAsync(String location) { + return listBillingSpecsWithResponseAsync(location) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional billingSpecs for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingResponseListResultInner listBillingSpecs(String location) { + return listBillingSpecsAsync(location).block(); + } + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional billingSpecs for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listBillingSpecsWithResponse(String location, Context context) { + return listBillingSpecsWithResponseAsync(location, context).block(); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsImpl.java new file mode 100644 index 0000000000000..40094c0dda72c --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/LocationsImpl.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.hdinsight.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.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.LocationsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.BillingResponseListResultInner; +import com.azure.resourcemanager.hdinsight.fluent.models.CapabilitiesResultInner; +import com.azure.resourcemanager.hdinsight.fluent.models.UsagesListResultInner; +import com.azure.resourcemanager.hdinsight.models.BillingResponseListResult; +import com.azure.resourcemanager.hdinsight.models.CapabilitiesResult; +import com.azure.resourcemanager.hdinsight.models.Locations; +import com.azure.resourcemanager.hdinsight.models.UsagesListResult; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LocationsImpl implements Locations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationsImpl.class); + + private final LocationsClient innerClient; + + private final HDInsightManager serviceManager; + + public LocationsImpl(LocationsClient innerClient, HDInsightManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CapabilitiesResult getCapabilities(String location) { + CapabilitiesResultInner inner = this.serviceClient().getCapabilities(location); + if (inner != null) { + return new CapabilitiesResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getCapabilitiesWithResponse(String location, Context context) { + Response inner = this.serviceClient().getCapabilitiesWithResponse(location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CapabilitiesResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public UsagesListResult listUsages(String location) { + UsagesListResultInner inner = this.serviceClient().listUsages(location); + if (inner != null) { + return new UsagesListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listUsagesWithResponse(String location, Context context) { + Response inner = this.serviceClient().listUsagesWithResponse(location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new UsagesListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BillingResponseListResult listBillingSpecs(String location) { + BillingResponseListResultInner inner = this.serviceClient().listBillingSpecs(location); + if (inner != null) { + return new BillingResponseListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listBillingSpecsWithResponse(String location, Context context) { + Response inner = + this.serviceClient().listBillingSpecsWithResponse(location, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BillingResponseListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LocationsClient serviceClient() { + return this.innerClient; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationImpl.java new file mode 100644 index 0000000000000..97a43b6aac201 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.OperationInner; +import com.azure.resourcemanager.hdinsight.models.Operation; +import com.azure.resourcemanager.hdinsight.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final HDInsightManager serviceManager; + + public OperationImpl(OperationInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..59dd646176b4f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.fluent.OperationsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.OperationInner; +import com.azure.resourcemanager.hdinsight.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final HDInsightManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(HDInsightManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightManagementC") + private 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); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String 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)); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + @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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + @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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..ee86b6a94654d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.OperationsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.OperationInner; +import com.azure.resourcemanager.hdinsight.models.Operation; +import com.azure.resourcemanager.hdinsight.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final HDInsightManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, HDInsightManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/RuntimeScriptActionDetailImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/RuntimeScriptActionDetailImpl.java new file mode 100644 index 0000000000000..37c7de6dbad16 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/RuntimeScriptActionDetailImpl.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; +import com.azure.resourcemanager.hdinsight.models.RuntimeScriptActionDetail; +import com.azure.resourcemanager.hdinsight.models.ScriptActionExecutionSummary; +import java.util.Collections; +import java.util.List; + +public final class RuntimeScriptActionDetailImpl implements RuntimeScriptActionDetail { + private RuntimeScriptActionDetailInner innerObject; + + private final HDInsightManager serviceManager; + + public RuntimeScriptActionDetailImpl(RuntimeScriptActionDetailInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String uri() { + return this.innerModel().uri(); + } + + public String parameters() { + return this.innerModel().parameters(); + } + + public List roles() { + List inner = this.innerModel().roles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String applicationName() { + return this.innerModel().applicationName(); + } + + public Long scriptExecutionId() { + return this.innerModel().scriptExecutionId(); + } + + public String startTime() { + return this.innerModel().startTime(); + } + + public String endTime() { + return this.innerModel().endTime(); + } + + public String status() { + return this.innerModel().status(); + } + + public String operation() { + return this.innerModel().operation(); + } + + public List executionSummary() { + List inner = this.innerModel().executionSummary(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String debugInformation() { + return this.innerModel().debugInformation(); + } + + public RuntimeScriptActionDetailInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsClientImpl.java new file mode 100644 index 0000000000000..022f382416409 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsClientImpl.java @@ -0,0 +1,692 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.fluent.ScriptActionsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; +import com.azure.resourcemanager.hdinsight.models.ScriptActionsList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ScriptActionsClient. */ +public final class ScriptActionsClientImpl implements ScriptActionsClient { + private final ClientLogger logger = new ClientLogger(ScriptActionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ScriptActionsService service; + + /** The service client containing this operation class. */ + private final HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptActionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScriptActionsClientImpl(HDInsightManagementClientImpl client) { + this.service = + RestProxy.create(ScriptActionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightManagementClientScriptActions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightManagementC") + private interface ScriptActionsService { + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/scriptActions/{scriptName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("scriptName") String scriptName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/scriptActions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/scriptExecutionHistory/{scriptExecutionId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getExecutionDetail( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("scriptExecutionId") String scriptExecutionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String scriptName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (scriptName == null) { + return Mono.error(new IllegalArgumentException("Parameter scriptName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + scriptName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String clusterName, String scriptName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (scriptName == null) { + return Mono.error(new IllegalArgumentException("Parameter scriptName 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, + clusterName, + scriptName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String clusterName, String scriptName) { + return deleteWithResponseAsync(resourceGroupName, clusterName, scriptName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String clusterName, String scriptName) { + deleteAsync(resourceGroupName, clusterName, scriptName).block(); + } + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String clusterName, String scriptName, Context context) { + return deleteWithResponseAsync(resourceGroupName, clusterName, scriptName, context).block(); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + } + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the script execution detail for the given script execution ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getExecutionDetailWithResponseAsync( + String resourceGroupName, String clusterName, String scriptExecutionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (scriptExecutionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getExecutionDetail( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + scriptExecutionId, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the script execution detail for the given script execution ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getExecutionDetailWithResponseAsync( + String resourceGroupName, String clusterName, String scriptExecutionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (scriptExecutionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getExecutionDetail( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + scriptExecutionId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the script execution detail for the given script execution ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getExecutionDetailAsync( + String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailWithResponseAsync(resourceGroupName, clusterName, scriptExecutionId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the script execution detail for the given script execution ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RuntimeScriptActionDetailInner getExecutionDetail( + String resourceGroupName, String clusterName, String scriptExecutionId) { + return getExecutionDetailAsync(resourceGroupName, clusterName, scriptExecutionId).block(); + } + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the script execution detail for the given script execution ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getExecutionDetailWithResponse( + String resourceGroupName, String clusterName, String scriptExecutionId, Context context) { + return getExecutionDetailWithResponseAsync(resourceGroupName, clusterName, scriptExecutionId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync( + 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 + .listByClusterNext(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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsImpl.java new file mode 100644 index 0000000000000..931387f2a5b48 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptActionsImpl.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.hdinsight.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.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.ScriptActionsClient; +import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; +import com.azure.resourcemanager.hdinsight.models.RuntimeScriptActionDetail; +import com.azure.resourcemanager.hdinsight.models.ScriptActions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ScriptActionsImpl implements ScriptActions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptActionsImpl.class); + + private final ScriptActionsClient innerClient; + + private final HDInsightManager serviceManager; + + public ScriptActionsImpl(ScriptActionsClient innerClient, HDInsightManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String clusterName, String scriptName) { + this.serviceClient().delete(resourceGroupName, clusterName, scriptName); + } + + public Response deleteWithResponse( + String resourceGroupName, String clusterName, String scriptName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, clusterName, scriptName, context); + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName); + return inner.mapPage(inner1 -> new RuntimeScriptActionDetailImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return inner.mapPage(inner1 -> new RuntimeScriptActionDetailImpl(inner1, this.manager())); + } + + public RuntimeScriptActionDetail getExecutionDetail( + String resourceGroupName, String clusterName, String scriptExecutionId) { + RuntimeScriptActionDetailInner inner = + this.serviceClient().getExecutionDetail(resourceGroupName, clusterName, scriptExecutionId); + if (inner != null) { + return new RuntimeScriptActionDetailImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getExecutionDetailWithResponse( + String resourceGroupName, String clusterName, String scriptExecutionId, Context context) { + Response inner = + this + .serviceClient() + .getExecutionDetailWithResponse(resourceGroupName, clusterName, scriptExecutionId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RuntimeScriptActionDetailImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ScriptActionsClient serviceClient() { + return this.innerClient; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesClientImpl.java new file mode 100644 index 0000000000000..df4df33e4b3df --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesClientImpl.java @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.fluent.ScriptExecutionHistoriesClient; +import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; +import com.azure.resourcemanager.hdinsight.models.ScriptActionExecutionHistoryList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ScriptExecutionHistoriesClient. */ +public final class ScriptExecutionHistoriesClientImpl implements ScriptExecutionHistoriesClient { + private final ClientLogger logger = new ClientLogger(ScriptExecutionHistoriesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ScriptExecutionHistoriesService service; + + /** The service client containing this operation class. */ + private final HDInsightManagementClientImpl client; + + /** + * Initializes an instance of ScriptExecutionHistoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ScriptExecutionHistoriesClientImpl(HDInsightManagementClientImpl client) { + this.service = + RestProxy + .create(ScriptExecutionHistoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightManagementClientScriptExecutionHistories to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightManagementC") + private interface ScriptExecutionHistoriesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/scriptExecutionHistory") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCluster( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> promote( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @PathParam("scriptExecutionId") String scriptExecutionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterSinglePageAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCluster( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listByClusterNextSinglePageAsync(nextLink)); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByClusterAsync( + String resourceGroupName, String clusterName, Context context) { + return new PagedFlux<>( + () -> listByClusterSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listByClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName)); + } + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listByClusterAsync(resourceGroupName, clusterName, context)); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> promoteWithResponseAsync( + String resourceGroupName, String clusterName, String scriptExecutionId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (scriptExecutionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .promote( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + scriptExecutionId, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> promoteWithResponseAsync( + String resourceGroupName, String clusterName, String scriptExecutionId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (scriptExecutionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter scriptExecutionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .promote( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + scriptExecutionId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono promoteAsync(String resourceGroupName, String clusterName, String scriptExecutionId) { + return promoteWithResponseAsync(resourceGroupName, clusterName, scriptExecutionId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void promote(String resourceGroupName, String clusterName, String scriptExecutionId) { + promoteAsync(resourceGroupName, clusterName, scriptExecutionId).block(); + } + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response promoteWithResponse( + String resourceGroupName, String clusterName, String scriptExecutionId, Context context) { + return promoteWithResponseAsync(resourceGroupName, clusterName, scriptExecutionId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync(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.listByClusterNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByClusterNextSinglePageAsync( + 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 + .listByClusterNext(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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesImpl.java new file mode 100644 index 0000000000000..78c44c86c101e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ScriptExecutionHistoriesImpl.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.hdinsight.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.ScriptExecutionHistoriesClient; +import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; +import com.azure.resourcemanager.hdinsight.models.RuntimeScriptActionDetail; +import com.azure.resourcemanager.hdinsight.models.ScriptExecutionHistories; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ScriptExecutionHistoriesImpl implements ScriptExecutionHistories { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptExecutionHistoriesImpl.class); + + private final ScriptExecutionHistoriesClient innerClient; + + private final HDInsightManager serviceManager; + + public ScriptExecutionHistoriesImpl(ScriptExecutionHistoriesClient innerClient, HDInsightManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByCluster(String resourceGroupName, String clusterName) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName); + return inner.mapPage(inner1 -> new RuntimeScriptActionDetailImpl(inner1, this.manager())); + } + + public PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context) { + PagedIterable inner = + this.serviceClient().listByCluster(resourceGroupName, clusterName, context); + return inner.mapPage(inner1 -> new RuntimeScriptActionDetailImpl(inner1, this.manager())); + } + + public void promote(String resourceGroupName, String clusterName, String scriptExecutionId) { + this.serviceClient().promote(resourceGroupName, clusterName, scriptExecutionId); + } + + public Response promoteWithResponse( + String resourceGroupName, String clusterName, String scriptExecutionId, Context context) { + return this.serviceClient().promoteWithResponse(resourceGroupName, clusterName, scriptExecutionId, context); + } + + private ScriptExecutionHistoriesClient serviceClient() { + return this.innerClient; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/UsagesListResultImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/UsagesListResultImpl.java new file mode 100644 index 0000000000000..d00fe92e082fd --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/UsagesListResultImpl.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.hdinsight.implementation; + +import com.azure.resourcemanager.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.models.UsagesListResultInner; +import com.azure.resourcemanager.hdinsight.models.Usage; +import com.azure.resourcemanager.hdinsight.models.UsagesListResult; +import java.util.Collections; +import java.util.List; + +public final class UsagesListResultImpl implements UsagesListResult { + private UsagesListResultInner innerObject; + + private final HDInsightManager serviceManager; + + public UsagesListResultImpl(UsagesListResultInner innerObject, HDInsightManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public UsagesListResultInner innerModel() { + return this.innerObject; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/Utils.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/Utils.java new file mode 100644 index 0000000000000..063725926a837 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/Utils.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.implementation; + +import java.util.Arrays; +import java.util.Iterator; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesClientImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesClientImpl.java new file mode 100644 index 0000000000000..09bdfc1145ca4 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesClientImpl.java @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hdinsight.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.hdinsight.fluent.models.HostInfoInner; +import java.nio.ByteBuffer; +import java.util.List; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in VirtualMachinesClient. */ +public final class VirtualMachinesClientImpl implements VirtualMachinesClient { + private final ClientLogger logger = new ClientLogger(VirtualMachinesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final VirtualMachinesService service; + + /** The service client containing this operation class. */ + private final HDInsightManagementClientImpl client; + + /** + * Initializes an instance of VirtualMachinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VirtualMachinesClientImpl(HDInsightManagementClientImpl client) { + this.service = + RestProxy.create(VirtualMachinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HDInsightManagementClientVirtualMachines to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HDInsightManagementC") + private interface VirtualMachinesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/listHosts") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listHosts( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters" + + "/{clusterName}/restartHosts") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restartHosts( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") List hosts, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the HDInsight clusters hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster hosts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listHostsWithResponseAsync( + String resourceGroupName, String clusterName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listHosts( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the HDInsight clusters hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster hosts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listHostsWithResponseAsync( + String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listHosts( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Lists the HDInsight clusters hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster hosts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listHostsAsync(String resourceGroupName, String clusterName) { + return listHostsWithResponseAsync(resourceGroupName, clusterName) + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Lists the HDInsight clusters hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster hosts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List listHosts(String resourceGroupName, String clusterName) { + return listHostsAsync(resourceGroupName, clusterName).block(); + } + + /** + * Lists the HDInsight clusters hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster hosts. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listHostsWithResponse( + String resourceGroupName, String clusterName, Context context) { + return listHostsWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartHostsWithResponseAsync( + String resourceGroupName, String clusterName, List hosts) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (hosts == null) { + return Mono.error(new IllegalArgumentException("Parameter hosts is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restartHosts( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + hosts, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartHostsWithResponseAsync( + String resourceGroupName, String clusterName, List hosts, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (hosts == null) { + return Mono.error(new IllegalArgumentException("Parameter hosts is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restartHosts( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + this.client.getApiVersion(), + hosts, + accept, + context); + } + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartHostsAsync( + String resourceGroupName, String clusterName, List hosts) { + Mono>> mono = restartHostsWithResponseAsync(resourceGroupName, clusterName, hosts); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartHostsAsync( + String resourceGroupName, String clusterName, List hosts, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartHostsWithResponseAsync(resourceGroupName, clusterName, hosts, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestartHosts( + String resourceGroupName, String clusterName, List hosts) { + return beginRestartHostsAsync(resourceGroupName, clusterName, hosts).getSyncPoller(); + } + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestartHosts( + String resourceGroupName, String clusterName, List hosts, Context context) { + return beginRestartHostsAsync(resourceGroupName, clusterName, hosts, context).getSyncPoller(); + } + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartHostsAsync(String resourceGroupName, String clusterName, List hosts) { + return beginRestartHostsAsync(resourceGroupName, clusterName, hosts) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartHostsAsync( + String resourceGroupName, String clusterName, List hosts, Context context) { + return beginRestartHostsAsync(resourceGroupName, clusterName, hosts, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 restartHosts(String resourceGroupName, String clusterName, List hosts) { + restartHostsAsync(resourceGroupName, clusterName, hosts).block(); + } + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 restartHosts(String resourceGroupName, String clusterName, List hosts, Context context) { + restartHostsAsync(resourceGroupName, clusterName, hosts, context).block(); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesImpl.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesImpl.java new file mode 100644 index 0000000000000..aef96992f5173 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/VirtualMachinesImpl.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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.hdinsight.HDInsightManager; +import com.azure.resourcemanager.hdinsight.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.hdinsight.fluent.models.HostInfoInner; +import com.azure.resourcemanager.hdinsight.models.HostInfo; +import com.azure.resourcemanager.hdinsight.models.VirtualMachines; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class VirtualMachinesImpl implements VirtualMachines { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualMachinesImpl.class); + + private final VirtualMachinesClient innerClient; + + private final HDInsightManager serviceManager; + + public VirtualMachinesImpl(VirtualMachinesClient innerClient, HDInsightManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public List listHosts(String resourceGroupName, String clusterName) { + List inner = this.serviceClient().listHosts(resourceGroupName, clusterName); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new HostInfoImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listHostsWithResponse( + String resourceGroupName, String clusterName, Context context) { + Response> inner = + this.serviceClient().listHostsWithResponse(resourceGroupName, clusterName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new HostInfoImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public void restartHosts(String resourceGroupName, String clusterName, List hosts) { + this.serviceClient().restartHosts(resourceGroupName, clusterName, hosts); + } + + public void restartHosts(String resourceGroupName, String clusterName, List hosts, Context context) { + this.serviceClient().restartHosts(resourceGroupName, clusterName, hosts, context); + } + + private VirtualMachinesClient serviceClient() { + return this.innerClient; + } + + private HDInsightManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/package-info.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/package-info.java new file mode 100644 index 0000000000000..ab234062dd0ba --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/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 HDInsightManagementClient. HDInsight Management Client. */ +package com.azure.resourcemanager.hdinsight.implementation; diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Application.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Application.java new file mode 100644 index 0000000000000..6ae31668c9b5b --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Application.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsight.fluent.models.ApplicationInner; +import java.util.Map; + +/** An immutable client-side representation of Application. */ +public interface Application { + /** + * 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 etag property: The ETag for the application. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the tags property: The tags for the application. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The properties of the application. + * + * @return the properties value. + */ + ApplicationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.ApplicationInner object. + * + * @return the inner object. + */ + ApplicationInner innerModel(); + + /** The entirety of the Application definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Application definition stages. */ + interface DefinitionStages { + /** The first stage of the Application definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Application definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, clusterName. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @return the next definition stage. + */ + WithCreate withExistingCluster(String resourceGroupName, String clusterName); + } + /** + * The stage of the Application 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.WithEtag, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Application create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Application create(Context context); + } + /** The stage of the Application definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags for the application.. + * + * @param tags The tags for the application. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Application definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: The ETag for the application. + * + * @param etag The ETag for the application. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } + /** The stage of the Application definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of the application.. + * + * @param properties The properties of the application. + * @return the next definition stage. + */ + WithCreate withProperties(ApplicationProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Application refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Application refresh(Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationGetEndpoint.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationGetEndpoint.java new file mode 100644 index 0000000000000..181b6e8fe5259 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationGetEndpoint.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets the application SSH endpoint. */ +@Fluent +public final class ApplicationGetEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGetEndpoint.class); + + /* + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /* + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * Get the location property: The location of the endpoint. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the endpoint. + * + * @param location the location value to set. + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destinationPort property: The destination port to connect to. + * + * @return the destinationPort value. + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destinationPort property: The destination port to connect to. + * + * @param destinationPort the destinationPort value to set. + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the publicPort property: The public port to connect to. + * + * @return the publicPort value. + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the publicPort property: The public port to connect to. + * + * @param publicPort the publicPort value to set. + * @return the ApplicationGetEndpoint object itself. + */ + public ApplicationGetEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationGetHttpsEndpoint.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationGetHttpsEndpoint.java new file mode 100644 index 0000000000000..1e2ea3cc3513f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationGetHttpsEndpoint.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Gets the application HTTP endpoints. */ +@Fluent +public final class ApplicationGetHttpsEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationGetHttpsEndpoint.class); + + /* + * The list of access modes for the application. + */ + @JsonProperty(value = "accessModes") + private List accessModes; + + /* + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The destination port to connect to. + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /* + * The public port to connect to. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /* + * The subdomain suffix of the application. + */ + @JsonProperty(value = "subDomainSuffix") + private String subDomainSuffix; + + /* + * The value indicates whether to disable GatewayAuth. + */ + @JsonProperty(value = "disableGatewayAuth") + private Boolean disableGatewayAuth; + + /** + * Get the accessModes property: The list of access modes for the application. + * + * @return the accessModes value. + */ + public List accessModes() { + return this.accessModes; + } + + /** + * Set the accessModes property: The list of access modes for the application. + * + * @param accessModes the accessModes value to set. + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withAccessModes(List accessModes) { + this.accessModes = accessModes; + return this; + } + + /** + * Get the location property: The location of the endpoint. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the endpoint. + * + * @param location the location value to set. + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the destinationPort property: The destination port to connect to. + * + * @return the destinationPort value. + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destinationPort property: The destination port to connect to. + * + * @param destinationPort the destinationPort value to set. + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the publicPort property: The public port to connect to. + * + * @return the publicPort value. + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set the publicPort property: The public port to connect to. + * + * @param publicPort the publicPort value to set. + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + + /** + * Get the subDomainSuffix property: The subdomain suffix of the application. + * + * @return the subDomainSuffix value. + */ + public String subDomainSuffix() { + return this.subDomainSuffix; + } + + /** + * Set the subDomainSuffix property: The subdomain suffix of the application. + * + * @param subDomainSuffix the subDomainSuffix value to set. + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withSubDomainSuffix(String subDomainSuffix) { + this.subDomainSuffix = subDomainSuffix; + return this; + } + + /** + * Get the disableGatewayAuth property: The value indicates whether to disable GatewayAuth. + * + * @return the disableGatewayAuth value. + */ + public Boolean disableGatewayAuth() { + return this.disableGatewayAuth; + } + + /** + * Set the disableGatewayAuth property: The value indicates whether to disable GatewayAuth. + * + * @param disableGatewayAuth the disableGatewayAuth value to set. + * @return the ApplicationGetHttpsEndpoint object itself. + */ + public ApplicationGetHttpsEndpoint withDisableGatewayAuth(Boolean disableGatewayAuth) { + this.disableGatewayAuth = disableGatewayAuth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationListResult.java new file mode 100644 index 0000000000000..4ab84d4ac485c --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationListResult.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.fluent.models.ApplicationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list cluster Applications. It contains a list of operations and a URL link to get the next + * set of results. + */ +@Fluent +public final class ApplicationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationListResult.class); + + /* + * The list of HDInsight applications installed on HDInsight cluster. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The 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; + + /** + * Get the value property: The list of HDInsight applications installed on HDInsight cluster. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of HDInsight applications installed on HDInsight cluster. + * + * @param value the value value to set. + * @return the ApplicationListResult object itself. + */ + public ApplicationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The 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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationProperties.java new file mode 100644 index 0000000000000..d3634ec5ad883 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ApplicationProperties.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The HDInsight cluster application GET response. */ +@Fluent +public final class ApplicationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationProperties.class); + + /* + * The list of roles in the cluster. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /* + * The list of install script actions. + */ + @JsonProperty(value = "installScriptActions") + private List installScriptActions; + + /* + * The list of uninstall script actions. + */ + @JsonProperty(value = "uninstallScriptActions") + private List uninstallScriptActions; + + /* + * The list of application HTTPS endpoints. + */ + @JsonProperty(value = "httpsEndpoints") + private List httpsEndpoints; + + /* + * The list of application SSH endpoints. + */ + @JsonProperty(value = "sshEndpoints") + private List sshEndpoints; + + /* + * The provisioning state of the application. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The application type. + */ + @JsonProperty(value = "applicationType") + private String applicationType; + + /* + * The application state. + */ + @JsonProperty(value = "applicationState", access = JsonProperty.Access.WRITE_ONLY) + private String applicationState; + + /* + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /* + * The application create date time. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private String createdDate; + + /* + * The marketplace identifier. + */ + @JsonProperty(value = "marketplaceIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String marketplaceIdentifier; + + /** + * Get the computeProfile property: The list of roles in the cluster. + * + * @return the computeProfile value. + */ + public ComputeProfile computeProfile() { + return this.computeProfile; + } + + /** + * Set the computeProfile property: The list of roles in the cluster. + * + * @param computeProfile the computeProfile value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the installScriptActions property: The list of install script actions. + * + * @return the installScriptActions value. + */ + public List installScriptActions() { + return this.installScriptActions; + } + + /** + * Set the installScriptActions property: The list of install script actions. + * + * @param installScriptActions the installScriptActions value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withInstallScriptActions(List installScriptActions) { + this.installScriptActions = installScriptActions; + return this; + } + + /** + * Get the uninstallScriptActions property: The list of uninstall script actions. + * + * @return the uninstallScriptActions value. + */ + public List uninstallScriptActions() { + return this.uninstallScriptActions; + } + + /** + * Set the uninstallScriptActions property: The list of uninstall script actions. + * + * @param uninstallScriptActions the uninstallScriptActions value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withUninstallScriptActions(List uninstallScriptActions) { + this.uninstallScriptActions = uninstallScriptActions; + return this; + } + + /** + * Get the httpsEndpoints property: The list of application HTTPS endpoints. + * + * @return the httpsEndpoints value. + */ + public List httpsEndpoints() { + return this.httpsEndpoints; + } + + /** + * Set the httpsEndpoints property: The list of application HTTPS endpoints. + * + * @param httpsEndpoints the httpsEndpoints value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withHttpsEndpoints(List httpsEndpoints) { + this.httpsEndpoints = httpsEndpoints; + return this; + } + + /** + * Get the sshEndpoints property: The list of application SSH endpoints. + * + * @return the sshEndpoints value. + */ + public List sshEndpoints() { + return this.sshEndpoints; + } + + /** + * Set the sshEndpoints property: The list of application SSH endpoints. + * + * @param sshEndpoints the sshEndpoints value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withSshEndpoints(List sshEndpoints) { + this.sshEndpoints = sshEndpoints; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the application. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the applicationType property: The application type. + * + * @return the applicationType value. + */ + public String applicationType() { + return this.applicationType; + } + + /** + * Set the applicationType property: The application type. + * + * @param applicationType the applicationType value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withApplicationType(String applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get the applicationState property: The application state. + * + * @return the applicationState value. + */ + public String applicationState() { + return this.applicationState; + } + + /** + * Get the errors property: The list of errors. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: The list of errors. + * + * @param errors the errors value to set. + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the createdDate property: The application create date time. + * + * @return the createdDate value. + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Get the marketplaceIdentifier property: The marketplace identifier. + * + * @return the marketplaceIdentifier value. + */ + public String marketplaceIdentifier() { + return this.marketplaceIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (computeProfile() != null) { + computeProfile().validate(); + } + if (installScriptActions() != null) { + installScriptActions().forEach(e -> e.validate()); + } + if (uninstallScriptActions() != null) { + uninstallScriptActions().forEach(e -> e.validate()); + } + if (httpsEndpoints() != null) { + httpsEndpoints().forEach(e -> e.validate()); + } + if (sshEndpoints() != null) { + sshEndpoints().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Applications.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Applications.java new file mode 100644 index 0000000000000..c88b2d7e603bf --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Applications.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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 Applications. */ +public interface Applications { + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Lists all of the applications for the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster Applications. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName, Context context); + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the specified application. + */ + Application get(String resourceGroupName, String clusterName, String applicationName); + + /** + * Gets properties of the specified application. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of the specified application. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String applicationName, Context context); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String applicationName); + + /** + * Deletes the specified application on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param applicationName The constant value for the application name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String applicationName, Context context); + + /** + * Gets properties of the specified application. + * + * @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 properties of the specified application. + */ + Application getById(String id); + + /** + * Gets properties of the specified application. + * + * @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 properties of the specified application. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified application on the 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. + */ + void deleteById(String id); + + /** + * Deletes the specified application on the 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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Application resource. + * + * @param name resource name. + * @return the first stage of the new Application definition. + */ + Application.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AsyncOperationState.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AsyncOperationState.java new file mode 100644 index 0000000000000..cd10903fe7276 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AsyncOperationState.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.hdinsight.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for AsyncOperationState. */ +public enum AsyncOperationState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a AsyncOperationState instance. */ + private final String value; + + AsyncOperationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AsyncOperationState instance. + * + * @param value the serialized value to parse. + * @return the parsed AsyncOperationState object, or null if unable to parse. + */ + @JsonCreator + public static AsyncOperationState fromString(String value) { + AsyncOperationState[] items = AsyncOperationState.values(); + for (AsyncOperationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Autoscale.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Autoscale.java new file mode 100644 index 0000000000000..94bb42bdc8225 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Autoscale.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The autoscale request parameters. */ +@Fluent +public final class Autoscale { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Autoscale.class); + + /* + * Parameters for load-based autoscale + */ + @JsonProperty(value = "capacity") + private AutoscaleCapacity capacity; + + /* + * Parameters for schedule-based autoscale + */ + @JsonProperty(value = "recurrence") + private AutoscaleRecurrence recurrence; + + /** + * Get the capacity property: Parameters for load-based autoscale. + * + * @return the capacity value. + */ + public AutoscaleCapacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Parameters for load-based autoscale. + * + * @param capacity the capacity value to set. + * @return the Autoscale object itself. + */ + public Autoscale withCapacity(AutoscaleCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the recurrence property: Parameters for schedule-based autoscale. + * + * @return the recurrence value. + */ + public AutoscaleRecurrence recurrence() { + return this.recurrence; + } + + /** + * Set the recurrence property: Parameters for schedule-based autoscale. + * + * @param recurrence the recurrence value to set. + * @return the Autoscale object itself. + */ + public Autoscale withRecurrence(AutoscaleRecurrence recurrence) { + this.recurrence = recurrence; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (recurrence() != null) { + recurrence().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleCapacity.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleCapacity.java new file mode 100644 index 0000000000000..a6485d1133bda --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleCapacity.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The load-based autoscale request parameters. */ +@Fluent +public final class AutoscaleCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoscaleCapacity.class); + + /* + * The minimum instance count of the cluster + */ + @JsonProperty(value = "minInstanceCount") + private Integer minInstanceCount; + + /* + * The maximum instance count of the cluster + */ + @JsonProperty(value = "maxInstanceCount") + private Integer maxInstanceCount; + + /** + * Get the minInstanceCount property: The minimum instance count of the cluster. + * + * @return the minInstanceCount value. + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minInstanceCount property: The minimum instance count of the cluster. + * + * @param minInstanceCount the minInstanceCount value to set. + * @return the AutoscaleCapacity object itself. + */ + public AutoscaleCapacity withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the maxInstanceCount property: The maximum instance count of the cluster. + * + * @return the maxInstanceCount value. + */ + public Integer maxInstanceCount() { + return this.maxInstanceCount; + } + + /** + * Set the maxInstanceCount property: The maximum instance count of the cluster. + * + * @param maxInstanceCount the maxInstanceCount value to set. + * @return the AutoscaleCapacity object itself. + */ + public AutoscaleCapacity withMaxInstanceCount(Integer maxInstanceCount) { + this.maxInstanceCount = maxInstanceCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleConfigurationUpdateParameter.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleConfigurationUpdateParameter.java new file mode 100644 index 0000000000000..c0bba5babdfd4 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleConfigurationUpdateParameter.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The autoscale configuration update parameter. */ +@Fluent +public final class AutoscaleConfigurationUpdateParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoscaleConfigurationUpdateParameter.class); + + /* + * The autoscale configuration. + */ + @JsonProperty(value = "autoscale") + private Autoscale autoscale; + + /** + * Get the autoscale property: The autoscale configuration. + * + * @return the autoscale value. + */ + public Autoscale autoscale() { + return this.autoscale; + } + + /** + * Set the autoscale property: The autoscale configuration. + * + * @param autoscale the autoscale value to set. + * @return the AutoscaleConfigurationUpdateParameter object itself. + */ + public AutoscaleConfigurationUpdateParameter withAutoscale(Autoscale autoscale) { + this.autoscale = autoscale; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoscale() != null) { + autoscale().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleRecurrence.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleRecurrence.java new file mode 100644 index 0000000000000..c64f71f44464f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleRecurrence.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Schedule-based autoscale request parameters. */ +@Fluent +public final class AutoscaleRecurrence { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoscaleRecurrence.class); + + /* + * The time zone for the autoscale schedule times + */ + @JsonProperty(value = "timeZone") + private String timeZone; + + /* + * Array of schedule-based autoscale rules + */ + @JsonProperty(value = "schedule") + private List schedule; + + /** + * Get the timeZone property: The time zone for the autoscale schedule times. + * + * @return the timeZone value. + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Set the timeZone property: The time zone for the autoscale schedule times. + * + * @param timeZone the timeZone value to set. + * @return the AutoscaleRecurrence object itself. + */ + public AutoscaleRecurrence withTimeZone(String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get the schedule property: Array of schedule-based autoscale rules. + * + * @return the schedule value. + */ + public List schedule() { + return this.schedule; + } + + /** + * Set the schedule property: Array of schedule-based autoscale rules. + * + * @param schedule the schedule value to set. + * @return the AutoscaleRecurrence object itself. + */ + public AutoscaleRecurrence withSchedule(List schedule) { + this.schedule = schedule; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (schedule() != null) { + schedule().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleSchedule.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleSchedule.java new file mode 100644 index 0000000000000..399b7ed9b7b36 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleSchedule.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters for a schedule-based autoscale rule, consisting of an array of days + a time and capacity. */ +@Fluent +public final class AutoscaleSchedule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoscaleSchedule.class); + + /* + * Days of the week for a schedule-based autoscale rule + */ + @JsonProperty(value = "days") + private List days; + + /* + * Time and capacity for a schedule-based autoscale rule + */ + @JsonProperty(value = "timeAndCapacity") + private AutoscaleTimeAndCapacity timeAndCapacity; + + /** + * Get the days property: Days of the week for a schedule-based autoscale rule. + * + * @return the days value. + */ + public List days() { + return this.days; + } + + /** + * Set the days property: Days of the week for a schedule-based autoscale rule. + * + * @param days the days value to set. + * @return the AutoscaleSchedule object itself. + */ + public AutoscaleSchedule withDays(List days) { + this.days = days; + return this; + } + + /** + * Get the timeAndCapacity property: Time and capacity for a schedule-based autoscale rule. + * + * @return the timeAndCapacity value. + */ + public AutoscaleTimeAndCapacity timeAndCapacity() { + return this.timeAndCapacity; + } + + /** + * Set the timeAndCapacity property: Time and capacity for a schedule-based autoscale rule. + * + * @param timeAndCapacity the timeAndCapacity value to set. + * @return the AutoscaleSchedule object itself. + */ + public AutoscaleSchedule withTimeAndCapacity(AutoscaleTimeAndCapacity timeAndCapacity) { + this.timeAndCapacity = timeAndCapacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timeAndCapacity() != null) { + timeAndCapacity().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleTimeAndCapacity.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleTimeAndCapacity.java new file mode 100644 index 0000000000000..2bbd3e640453a --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/AutoscaleTimeAndCapacity.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Time and capacity request parameters. */ +@Fluent +public final class AutoscaleTimeAndCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoscaleTimeAndCapacity.class); + + /* + * 24-hour time in the form xx:xx + */ + @JsonProperty(value = "time") + private String time; + + /* + * The minimum instance count of the cluster + */ + @JsonProperty(value = "minInstanceCount") + private Integer minInstanceCount; + + /* + * The maximum instance count of the cluster + */ + @JsonProperty(value = "maxInstanceCount") + private Integer maxInstanceCount; + + /** + * Get the time property: 24-hour time in the form xx:xx. + * + * @return the time value. + */ + public String time() { + return this.time; + } + + /** + * Set the time property: 24-hour time in the form xx:xx. + * + * @param time the time value to set. + * @return the AutoscaleTimeAndCapacity object itself. + */ + public AutoscaleTimeAndCapacity withTime(String time) { + this.time = time; + return this; + } + + /** + * Get the minInstanceCount property: The minimum instance count of the cluster. + * + * @return the minInstanceCount value. + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minInstanceCount property: The minimum instance count of the cluster. + * + * @param minInstanceCount the minInstanceCount value to set. + * @return the AutoscaleTimeAndCapacity object itself. + */ + public AutoscaleTimeAndCapacity withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the maxInstanceCount property: The maximum instance count of the cluster. + * + * @return the maxInstanceCount value. + */ + public Integer maxInstanceCount() { + return this.maxInstanceCount; + } + + /** + * Set the maxInstanceCount property: The maximum instance count of the cluster. + * + * @param maxInstanceCount the maxInstanceCount value to set. + * @return the AutoscaleTimeAndCapacity object itself. + */ + public AutoscaleTimeAndCapacity withMaxInstanceCount(Integer maxInstanceCount) { + this.maxInstanceCount = maxInstanceCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingMeters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingMeters.java new file mode 100644 index 0000000000000..141494adb11ee --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingMeters.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The billing meters. */ +@Fluent +public final class BillingMeters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingMeters.class); + + /* + * The virtual machine sizes. + */ + @JsonProperty(value = "meterParameter") + private String meterParameter; + + /* + * The HDInsight meter guid. + */ + @JsonProperty(value = "meter") + private String meter; + + /* + * The unit of meter, VMHours or CoreHours. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Get the meterParameter property: The virtual machine sizes. + * + * @return the meterParameter value. + */ + public String meterParameter() { + return this.meterParameter; + } + + /** + * Set the meterParameter property: The virtual machine sizes. + * + * @param meterParameter the meterParameter value to set. + * @return the BillingMeters object itself. + */ + public BillingMeters withMeterParameter(String meterParameter) { + this.meterParameter = meterParameter; + return this; + } + + /** + * Get the meter property: The HDInsight meter guid. + * + * @return the meter value. + */ + public String meter() { + return this.meter; + } + + /** + * Set the meter property: The HDInsight meter guid. + * + * @param meter the meter value to set. + * @return the BillingMeters object itself. + */ + public BillingMeters withMeter(String meter) { + this.meter = meter; + return this; + } + + /** + * Get the unit property: The unit of meter, VMHours or CoreHours. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The unit of meter, VMHours or CoreHours. + * + * @param unit the unit value to set. + * @return the BillingMeters object itself. + */ + public BillingMeters withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingResources.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingResources.java new file mode 100644 index 0000000000000..a430a4fbaf02d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingResources.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The billing resources. */ +@Fluent +public final class BillingResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingResources.class); + + /* + * The region or location. + */ + @JsonProperty(value = "region") + private String region; + + /* + * The billing meter information. + */ + @JsonProperty(value = "billingMeters") + private List billingMeters; + + /* + * The managed disk billing information. + */ + @JsonProperty(value = "diskBillingMeters") + private List diskBillingMeters; + + /** + * Get the region property: The region or location. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: The region or location. + * + * @param region the region value to set. + * @return the BillingResources object itself. + */ + public BillingResources withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the billingMeters property: The billing meter information. + * + * @return the billingMeters value. + */ + public List billingMeters() { + return this.billingMeters; + } + + /** + * Set the billingMeters property: The billing meter information. + * + * @param billingMeters the billingMeters value to set. + * @return the BillingResources object itself. + */ + public BillingResources withBillingMeters(List billingMeters) { + this.billingMeters = billingMeters; + return this; + } + + /** + * Get the diskBillingMeters property: The managed disk billing information. + * + * @return the diskBillingMeters value. + */ + public List diskBillingMeters() { + return this.diskBillingMeters; + } + + /** + * Set the diskBillingMeters property: The managed disk billing information. + * + * @param diskBillingMeters the diskBillingMeters value to set. + * @return the BillingResources object itself. + */ + public BillingResources withDiskBillingMeters(List diskBillingMeters) { + this.diskBillingMeters = diskBillingMeters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (billingMeters() != null) { + billingMeters().forEach(e -> e.validate()); + } + if (diskBillingMeters() != null) { + diskBillingMeters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingResponseListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingResponseListResult.java new file mode 100644 index 0000000000000..7a4b90ac0b4a9 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingResponseListResult.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.hdinsight.models; + +import com.azure.resourcemanager.hdinsight.fluent.models.BillingResponseListResultInner; +import java.util.List; + +/** An immutable client-side representation of BillingResponseListResult. */ +public interface BillingResponseListResult { + /** + * Gets the vmSizes property: The virtual machine sizes to include or exclude. + * + * @return the vmSizes value. + */ + List vmSizes(); + + /** + * Gets the vmSizeFilters property: The virtual machine filtering mode. Effectively this can enabling or disabling + * the virtual machine sizes in a particular set. + * + * @return the vmSizeFilters value. + */ + List vmSizeFilters(); + + /** + * Gets the billingResources property: The billing and managed disk billing resources for a region. + * + * @return the billingResources value. + */ + List billingResources(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.BillingResponseListResultInner object. + * + * @return the inner object. + */ + BillingResponseListResultInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/CapabilitiesResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/CapabilitiesResult.java new file mode 100644 index 0000000000000..56a584dd8128b --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/CapabilitiesResult.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.hdinsight.models; + +import com.azure.resourcemanager.hdinsight.fluent.models.CapabilitiesResultInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of CapabilitiesResult. */ +public interface CapabilitiesResult { + /** + * Gets the versions property: The version capability. + * + * @return the versions value. + */ + Map versions(); + + /** + * Gets the regions property: The virtual machine size compatibility features. + * + * @return the regions value. + */ + Map regions(); + + /** + * Gets the vmSizes property: The virtual machine sizes. + * + * @return the vmSizes value. + */ + Map vmSizes(); + + /** + * Gets the vmSizeFilters property: The virtual machine size compatibility filters. + * + * @return the vmSizeFilters value. + */ + List vmSizeFilters(); + + /** + * Gets the features property: The capability features. + * + * @return the features value. + */ + List features(); + + /** + * Gets the quota property: The quota capability. + * + * @return the quota value. + */ + QuotaCapability quota(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.CapabilitiesResultInner object. + * + * @return the inner object. + */ + CapabilitiesResultInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClientGroupInfo.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClientGroupInfo.java new file mode 100644 index 0000000000000..223fb36c07e2d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClientGroupInfo.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The information of AAD security group. */ +@Fluent +public final class ClientGroupInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientGroupInfo.class); + + /* + * The AAD security group name. + */ + @JsonProperty(value = "groupName") + private String groupName; + + /* + * The AAD security group id. + */ + @JsonProperty(value = "groupId") + private String groupId; + + /** + * Get the groupName property: The AAD security group name. + * + * @return the groupName value. + */ + public String groupName() { + return this.groupName; + } + + /** + * Set the groupName property: The AAD security group name. + * + * @param groupName the groupName value to set. + * @return the ClientGroupInfo object itself. + */ + public ClientGroupInfo withGroupName(String groupName) { + this.groupName = groupName; + return this; + } + + /** + * Get the groupId property: The AAD security group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: The AAD security group id. + * + * @param groupId the groupId value to set. + * @return the ClientGroupInfo object itself. + */ + public ClientGroupInfo withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Cluster.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Cluster.java new file mode 100644 index 0000000000000..b2a09c27f13e2 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Cluster.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.hdinsight.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsight.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 etag property: The ETag for the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the properties property: The properties of the cluster. + * + * @return the properties value. + */ + ClusterGetProperties properties(); + + /** + * Gets the identity property: The identity of the cluster, if configured. + * + * @return the identity value. + */ + ClusterIdentity identity(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.ClusterInner object. + * + * @return the inner object. + */ + ClusterInner innerModel(); + + /** The entirety of the Cluster definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + /** The Cluster definition stages. */ + interface DefinitionStages { + /** The first stage of the Cluster definition. */ + interface Blank extends WithResourceGroup { + } + /** The stage of the Cluster definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the 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.WithLocation, + DefinitionStages.WithTags, + DefinitionStages.WithProperties, + DefinitionStages.WithIdentity { + /** + * 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 location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location of the cluster. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location of the cluster. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the Cluster definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The resource tags.. + * + * @param tags The resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Cluster definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The cluster create parameters.. + * + * @param properties The cluster create parameters. + * @return the next definition stage. + */ + WithCreate withProperties(ClusterCreateProperties properties); + } + /** The stage of the Cluster definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the cluster, if configured.. + * + * @param identity The identity of the cluster, if configured. + * @return the next definition stage. + */ + WithCreate withIdentity(ClusterIdentity identity); + } + } + /** + * 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 { + /** + * 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: The resource tags.. + * + * @param tags The resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * 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); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterConfigurations.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterConfigurations.java new file mode 100644 index 0000000000000..e668aa4bc13fc --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterConfigurations.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterConfigurationsInner; +import java.util.Map; + +/** An immutable client-side representation of ClusterConfigurations. */ +public interface ClusterConfigurations { + /** + * Gets the configurations property: The configuration object for the specified configuration for the specified + * cluster. + * + * @return the configurations value. + */ + Map configurations(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.ClusterConfigurationsInner object. + * + * @return the inner object. + */ + ClusterConfigurationsInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateParametersExtended.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateParametersExtended.java new file mode 100644 index 0000000000000..6b20eff9fb8bd --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateParametersExtended.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The CreateCluster request parameters. */ +@Fluent +public final class ClusterCreateParametersExtended { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterCreateParametersExtended.class); + + /* + * The location of the cluster. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The cluster create parameters. + */ + @JsonProperty(value = "properties") + private ClusterCreateProperties properties; + + /* + * The identity of the cluster, if configured. + */ + @JsonProperty(value = "identity") + private ClusterIdentity identity; + + /** + * Get the location property: The location of the cluster. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the cluster. + * + * @param location the location value to set. + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: The resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The resource tags. + * + * @param tags the tags value to set. + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The cluster create parameters. + * + * @return the properties value. + */ + public ClusterCreateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The cluster create parameters. + * + * @param properties the properties value to set. + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withProperties(ClusterCreateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The identity of the cluster, if configured. + * + * @return the identity value. + */ + public ClusterIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the cluster, if configured. + * + * @param identity the identity value to set. + * @return the ClusterCreateParametersExtended object itself. + */ + public ClusterCreateParametersExtended withIdentity(ClusterIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateProperties.java new file mode 100644 index 0000000000000..334688df0ad3e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterCreateProperties.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The cluster create parameters. */ +@Fluent +public final class ClusterCreateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterCreateProperties.class); + + /* + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /* + * The type of operating system. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /* + * The cluster tier. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /* + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition") + private ClusterDefinition clusterDefinition; + + /* + * The cluster kafka rest proxy configuration. + */ + @JsonProperty(value = "kafkaRestProperties") + private KafkaRestProperties kafkaRestProperties; + + /* + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /* + * The storage profile. + */ + @JsonProperty(value = "storageProfile") + private StorageProfile storageProfile; + + /* + * The disk encryption properties. + */ + @JsonProperty(value = "diskEncryptionProperties") + private DiskEncryptionProperties diskEncryptionProperties; + + /* + * The encryption-in-transit properties. + */ + @JsonProperty(value = "encryptionInTransitProperties") + private EncryptionInTransitProperties encryptionInTransitProperties; + + /* + * The minimal supported tls version. + */ + @JsonProperty(value = "minSupportedTlsVersion") + private String minSupportedTlsVersion; + + /* + * The network properties. + */ + @JsonProperty(value = "networkProperties") + private NetworkProperties networkProperties; + + /** + * Get the clusterVersion property: The version of the cluster. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the clusterVersion property: The version of the cluster. + * + * @param clusterVersion the clusterVersion value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the osType property: The type of operating system. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the osType property: The type of operating system. + * + * @param osType the osType value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the tier property: The cluster tier. + * + * @return the tier value. + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the tier property: The cluster tier. + * + * @param tier the tier value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the clusterDefinition property: The cluster definition. + * + * @return the clusterDefinition value. + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the clusterDefinition property: The cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the kafkaRestProperties property: The cluster kafka rest proxy configuration. + * + * @return the kafkaRestProperties value. + */ + public KafkaRestProperties kafkaRestProperties() { + return this.kafkaRestProperties; + } + + /** + * Set the kafkaRestProperties property: The cluster kafka rest proxy configuration. + * + * @param kafkaRestProperties the kafkaRestProperties value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withKafkaRestProperties(KafkaRestProperties kafkaRestProperties) { + this.kafkaRestProperties = kafkaRestProperties; + return this; + } + + /** + * Get the securityProfile property: The security profile. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: The security profile. + * + * @param securityProfile the securityProfile value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * 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 ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the storageProfile property: The storage profile. + * + * @return the storageProfile value. + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile property: The storage profile. + * + * @param storageProfile the storageProfile value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the diskEncryptionProperties property: The disk encryption properties. + * + * @return the diskEncryptionProperties value. + */ + public DiskEncryptionProperties diskEncryptionProperties() { + return this.diskEncryptionProperties; + } + + /** + * Set the diskEncryptionProperties property: The disk encryption properties. + * + * @param diskEncryptionProperties the diskEncryptionProperties value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withDiskEncryptionProperties(DiskEncryptionProperties diskEncryptionProperties) { + this.diskEncryptionProperties = diskEncryptionProperties; + return this; + } + + /** + * Get the encryptionInTransitProperties property: The encryption-in-transit properties. + * + * @return the encryptionInTransitProperties value. + */ + public EncryptionInTransitProperties encryptionInTransitProperties() { + return this.encryptionInTransitProperties; + } + + /** + * Set the encryptionInTransitProperties property: The encryption-in-transit properties. + * + * @param encryptionInTransitProperties the encryptionInTransitProperties value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withEncryptionInTransitProperties( + EncryptionInTransitProperties encryptionInTransitProperties) { + this.encryptionInTransitProperties = encryptionInTransitProperties; + return this; + } + + /** + * Get the minSupportedTlsVersion property: The minimal supported tls version. + * + * @return the minSupportedTlsVersion value. + */ + public String minSupportedTlsVersion() { + return this.minSupportedTlsVersion; + } + + /** + * Set the minSupportedTlsVersion property: The minimal supported tls version. + * + * @param minSupportedTlsVersion the minSupportedTlsVersion value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withMinSupportedTlsVersion(String minSupportedTlsVersion) { + this.minSupportedTlsVersion = minSupportedTlsVersion; + return this; + } + + /** + * Get the networkProperties property: The network properties. + * + * @return the networkProperties value. + */ + public NetworkProperties networkProperties() { + return this.networkProperties; + } + + /** + * Set the networkProperties property: The network properties. + * + * @param networkProperties the networkProperties value to set. + * @return the ClusterCreateProperties object itself. + */ + public ClusterCreateProperties withNetworkProperties(NetworkProperties networkProperties) { + this.networkProperties = networkProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterDefinition() != null) { + clusterDefinition().validate(); + } + if (kafkaRestProperties() != null) { + kafkaRestProperties().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (computeProfile() != null) { + computeProfile().validate(); + } + if (storageProfile() != null) { + storageProfile().validate(); + } + if (diskEncryptionProperties() != null) { + diskEncryptionProperties().validate(); + } + if (encryptionInTransitProperties() != null) { + encryptionInTransitProperties().validate(); + } + if (networkProperties() != null) { + networkProperties().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDefinition.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDefinition.java new file mode 100644 index 0000000000000..e611fb61a2d88 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDefinition.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The cluster definition. */ +@Fluent +public final class ClusterDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterDefinition.class); + + /* + * The link to the blueprint. + */ + @JsonProperty(value = "blueprint") + private String blueprint; + + /* + * The type of cluster. + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * The versions of different services in the cluster. + */ + @JsonProperty(value = "componentVersion") + private Map componentVersion; + + /* + * The cluster configurations. + */ + @JsonProperty(value = "configurations") + private Object configurations; + + /** + * Get the blueprint property: The link to the blueprint. + * + * @return the blueprint value. + */ + public String blueprint() { + return this.blueprint; + } + + /** + * Set the blueprint property: The link to the blueprint. + * + * @param blueprint the blueprint value to set. + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withBlueprint(String blueprint) { + this.blueprint = blueprint; + return this; + } + + /** + * Get the kind property: The type of cluster. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The type of cluster. + * + * @param kind the kind value to set. + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the componentVersion property: The versions of different services in the cluster. + * + * @return the componentVersion value. + */ + public Map componentVersion() { + return this.componentVersion; + } + + /** + * Set the componentVersion property: The versions of different services in the cluster. + * + * @param componentVersion the componentVersion value to set. + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withComponentVersion(Map componentVersion) { + this.componentVersion = componentVersion; + return this; + } + + /** + * Get the configurations property: The cluster configurations. + * + * @return the configurations value. + */ + public Object configurations() { + return this.configurations; + } + + /** + * Set the configurations property: The cluster configurations. + * + * @param configurations the configurations value to set. + * @return the ClusterDefinition object itself. + */ + public ClusterDefinition withConfigurations(Object configurations) { + this.configurations = configurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDiskEncryptionParameters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDiskEncryptionParameters.java new file mode 100644 index 0000000000000..76ee71f3cb69c --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterDiskEncryptionParameters.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Disk Encryption Cluster request parameters. */ +@Fluent +public final class ClusterDiskEncryptionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterDiskEncryptionParameters.class); + + /* + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + */ + @JsonProperty(value = "vaultUri") + private String vaultUri; + + /* + * Key name that is used for enabling disk encryption. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /* + * Specific key version that is used for enabling disk encryption. + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /** + * Get the vaultUri property: Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net. + * + * @return the vaultUri value. + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set the vaultUri property: Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net. + * + * @param vaultUri the vaultUri value to set. + * @return the ClusterDiskEncryptionParameters object itself. + */ + public ClusterDiskEncryptionParameters withVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Get the keyName property: Key name that is used for enabling disk encryption. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: Key name that is used for enabling disk encryption. + * + * @param keyName the keyName value to set. + * @return the ClusterDiskEncryptionParameters object itself. + */ + public ClusterDiskEncryptionParameters withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: Specific key version that is used for enabling disk encryption. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: Specific key version that is used for enabling disk encryption. + * + * @param keyVersion the keyVersion value to set. + * @return the ClusterDiskEncryptionParameters object itself. + */ + public ClusterDiskEncryptionParameters withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterGetProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterGetProperties.java new file mode 100644 index 0000000000000..a26bd9a083e5d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterGetProperties.java @@ -0,0 +1,529 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of cluster. */ +@Fluent +public final class ClusterGetProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterGetProperties.class); + + /* + * The version of the cluster. + */ + @JsonProperty(value = "clusterVersion") + private String clusterVersion; + + /* + * The type of operating system. + */ + @JsonProperty(value = "osType") + private OSType osType; + + /* + * The cluster tier. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /* + * The cluster id. + */ + @JsonProperty(value = "clusterId") + private String clusterId; + + /* + * The cluster definition. + */ + @JsonProperty(value = "clusterDefinition", required = true) + private ClusterDefinition clusterDefinition; + + /* + * The cluster kafka rest proxy configuration. + */ + @JsonProperty(value = "kafkaRestProperties") + private KafkaRestProperties kafkaRestProperties; + + /* + * The security profile. + */ + @JsonProperty(value = "securityProfile") + private SecurityProfile securityProfile; + + /* + * The compute profile. + */ + @JsonProperty(value = "computeProfile") + private ComputeProfile computeProfile; + + /* + * The provisioning state, which only appears in the response. + */ + @JsonProperty(value = "provisioningState") + private HDInsightClusterProvisioningState provisioningState; + + /* + * The date on which the cluster was created. + */ + @JsonProperty(value = "createdDate") + private String createdDate; + + /* + * The state of the cluster. + */ + @JsonProperty(value = "clusterState") + private String clusterState; + + /* + * The quota information. + */ + @JsonProperty(value = "quotaInfo") + private QuotaInfo quotaInfo; + + /* + * The list of errors. + */ + @JsonProperty(value = "errors") + private List errors; + + /* + * The list of connectivity endpoints. + */ + @JsonProperty(value = "connectivityEndpoints") + private List connectivityEndpoints; + + /* + * The disk encryption properties. + */ + @JsonProperty(value = "diskEncryptionProperties") + private DiskEncryptionProperties diskEncryptionProperties; + + /* + * The encryption-in-transit properties. + */ + @JsonProperty(value = "encryptionInTransitProperties") + private EncryptionInTransitProperties encryptionInTransitProperties; + + /* + * The minimal supported tls version. + */ + @JsonProperty(value = "minSupportedTlsVersion") + private String minSupportedTlsVersion; + + /* + * The network properties. + */ + @JsonProperty(value = "networkProperties") + private NetworkProperties networkProperties; + + /** + * Get the clusterVersion property: The version of the cluster. + * + * @return the clusterVersion value. + */ + public String clusterVersion() { + return this.clusterVersion; + } + + /** + * Set the clusterVersion property: The version of the cluster. + * + * @param clusterVersion the clusterVersion value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterVersion(String clusterVersion) { + this.clusterVersion = clusterVersion; + return this; + } + + /** + * Get the osType property: The type of operating system. + * + * @return the osType value. + */ + public OSType osType() { + return this.osType; + } + + /** + * Set the osType property: The type of operating system. + * + * @param osType the osType value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withOsType(OSType osType) { + this.osType = osType; + return this; + } + + /** + * Get the tier property: The cluster tier. + * + * @return the tier value. + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the tier property: The cluster tier. + * + * @param tier the tier value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Get the clusterId property: The cluster id. + * + * @return the clusterId value. + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Set the clusterId property: The cluster id. + * + * @param clusterId the clusterId value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterId(String clusterId) { + this.clusterId = clusterId; + return this; + } + + /** + * Get the clusterDefinition property: The cluster definition. + * + * @return the clusterDefinition value. + */ + public ClusterDefinition clusterDefinition() { + return this.clusterDefinition; + } + + /** + * Set the clusterDefinition property: The cluster definition. + * + * @param clusterDefinition the clusterDefinition value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterDefinition(ClusterDefinition clusterDefinition) { + this.clusterDefinition = clusterDefinition; + return this; + } + + /** + * Get the kafkaRestProperties property: The cluster kafka rest proxy configuration. + * + * @return the kafkaRestProperties value. + */ + public KafkaRestProperties kafkaRestProperties() { + return this.kafkaRestProperties; + } + + /** + * Set the kafkaRestProperties property: The cluster kafka rest proxy configuration. + * + * @param kafkaRestProperties the kafkaRestProperties value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withKafkaRestProperties(KafkaRestProperties kafkaRestProperties) { + this.kafkaRestProperties = kafkaRestProperties; + return this; + } + + /** + * Get the securityProfile property: The security profile. + * + * @return the securityProfile value. + */ + public SecurityProfile securityProfile() { + return this.securityProfile; + } + + /** + * Set the securityProfile property: The security profile. + * + * @param securityProfile the securityProfile value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withSecurityProfile(SecurityProfile securityProfile) { + this.securityProfile = securityProfile; + return this; + } + + /** + * 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 ClusterGetProperties object itself. + */ + public ClusterGetProperties withComputeProfile(ComputeProfile computeProfile) { + this.computeProfile = computeProfile; + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public HDInsightClusterProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state, which only appears in the response. + * + * @param provisioningState the provisioningState value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withProvisioningState(HDInsightClusterProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the createdDate property: The date on which the cluster was created. + * + * @return the createdDate value. + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Set the createdDate property: The date on which the cluster was created. + * + * @param createdDate the createdDate value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withCreatedDate(String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get the clusterState property: The state of the cluster. + * + * @return the clusterState value. + */ + public String clusterState() { + return this.clusterState; + } + + /** + * Set the clusterState property: The state of the cluster. + * + * @param clusterState the clusterState value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withClusterState(String clusterState) { + this.clusterState = clusterState; + return this; + } + + /** + * Get the quotaInfo property: The quota information. + * + * @return the quotaInfo value. + */ + public QuotaInfo quotaInfo() { + return this.quotaInfo; + } + + /** + * Set the quotaInfo property: The quota information. + * + * @param quotaInfo the quotaInfo value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withQuotaInfo(QuotaInfo quotaInfo) { + this.quotaInfo = quotaInfo; + return this; + } + + /** + * Get the errors property: The list of errors. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: The list of errors. + * + * @param errors the errors value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the connectivityEndpoints property: The list of connectivity endpoints. + * + * @return the connectivityEndpoints value. + */ + public List connectivityEndpoints() { + return this.connectivityEndpoints; + } + + /** + * Set the connectivityEndpoints property: The list of connectivity endpoints. + * + * @param connectivityEndpoints the connectivityEndpoints value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withConnectivityEndpoints(List connectivityEndpoints) { + this.connectivityEndpoints = connectivityEndpoints; + return this; + } + + /** + * Get the diskEncryptionProperties property: The disk encryption properties. + * + * @return the diskEncryptionProperties value. + */ + public DiskEncryptionProperties diskEncryptionProperties() { + return this.diskEncryptionProperties; + } + + /** + * Set the diskEncryptionProperties property: The disk encryption properties. + * + * @param diskEncryptionProperties the diskEncryptionProperties value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withDiskEncryptionProperties(DiskEncryptionProperties diskEncryptionProperties) { + this.diskEncryptionProperties = diskEncryptionProperties; + return this; + } + + /** + * Get the encryptionInTransitProperties property: The encryption-in-transit properties. + * + * @return the encryptionInTransitProperties value. + */ + public EncryptionInTransitProperties encryptionInTransitProperties() { + return this.encryptionInTransitProperties; + } + + /** + * Set the encryptionInTransitProperties property: The encryption-in-transit properties. + * + * @param encryptionInTransitProperties the encryptionInTransitProperties value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withEncryptionInTransitProperties( + EncryptionInTransitProperties encryptionInTransitProperties) { + this.encryptionInTransitProperties = encryptionInTransitProperties; + return this; + } + + /** + * Get the minSupportedTlsVersion property: The minimal supported tls version. + * + * @return the minSupportedTlsVersion value. + */ + public String minSupportedTlsVersion() { + return this.minSupportedTlsVersion; + } + + /** + * Set the minSupportedTlsVersion property: The minimal supported tls version. + * + * @param minSupportedTlsVersion the minSupportedTlsVersion value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withMinSupportedTlsVersion(String minSupportedTlsVersion) { + this.minSupportedTlsVersion = minSupportedTlsVersion; + return this; + } + + /** + * Get the networkProperties property: The network properties. + * + * @return the networkProperties value. + */ + public NetworkProperties networkProperties() { + return this.networkProperties; + } + + /** + * Set the networkProperties property: The network properties. + * + * @param networkProperties the networkProperties value to set. + * @return the ClusterGetProperties object itself. + */ + public ClusterGetProperties withNetworkProperties(NetworkProperties networkProperties) { + this.networkProperties = networkProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clusterDefinition() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property clusterDefinition in model ClusterGetProperties")); + } else { + clusterDefinition().validate(); + } + if (kafkaRestProperties() != null) { + kafkaRestProperties().validate(); + } + if (securityProfile() != null) { + securityProfile().validate(); + } + if (computeProfile() != null) { + computeProfile().validate(); + } + if (quotaInfo() != null) { + quotaInfo().validate(); + } + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + if (connectivityEndpoints() != null) { + connectivityEndpoints().forEach(e -> e.validate()); + } + if (diskEncryptionProperties() != null) { + diskEncryptionProperties().validate(); + } + if (encryptionInTransitProperties() != null) { + encryptionInTransitProperties().validate(); + } + if (networkProperties() != null) { + networkProperties().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterIdentity.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterIdentity.java new file mode 100644 index 0000000000000..8037033f31c19 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterIdentity.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the cluster. */ +@Fluent +public class ClusterIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterIdentity.class); + + /* + * The principal id of cluster identity. This property will only be + * provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant id associated with the cluster. This property will only be + * provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The type of identity used for the cluster. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user assigned identities. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with the cluster. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principalId property: The principal id of cluster identity. This property will only be provided for a + * system assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant id associated with the cluster. This property will only be provided for a + * system assigned identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of identity used for the cluster. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of identity used for the cluster. The type 'SystemAssigned, UserAssigned' + * includes both an implicitly created identity and a set of user assigned identities. + * + * @param type the type value to set. + * @return the ClusterIdentity object itself. + */ + public ClusterIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the cluster. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the cluster. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ClusterIdentity object itself. + */ + public ClusterIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterIdentityUserAssignedIdentities.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterIdentityUserAssignedIdentities.java new file mode 100644 index 0000000000000..e78dc09ee0b58 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterIdentityUserAssignedIdentities.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.hdinsight.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ClusterIdentityUserAssignedIdentities model. */ +@Immutable +public final class ClusterIdentityUserAssignedIdentities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterIdentityUserAssignedIdentities.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterListResult.java new file mode 100644 index 0000000000000..a6a73b4d6bcf6 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Cluster operation response. */ +@Fluent +public final class ClusterListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterListResult.class); + + /* + * 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; + + /** + * 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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterMonitoringRequest.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterMonitoringRequest.java new file mode 100644 index 0000000000000..58eaaf5226607 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterMonitoringRequest.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Operations Management Suite (OMS) parameters. */ +@Fluent +public final class ClusterMonitoringRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterMonitoringRequest.class); + + /* + * The Operations Management Suite (OMS) workspace ID. + */ + @JsonProperty(value = "workspaceId") + private String workspaceId; + + /* + * The Operations Management Suite (OMS) workspace key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /** + * Get the workspaceId property: The Operations Management Suite (OMS) workspace ID. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspaceId property: The Operations Management Suite (OMS) workspace ID. + * + * @param workspaceId the workspaceId value to set. + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the primaryKey property: The Operations Management Suite (OMS) workspace key. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: The Operations Management Suite (OMS) workspace key. + * + * @param primaryKey the primaryKey value to set. + * @return the ClusterMonitoringRequest object itself. + */ + public ClusterMonitoringRequest withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterMonitoringResponse.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterMonitoringResponse.java new file mode 100644 index 0000000000000..2137c7a003b41 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterMonitoringResponse.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.hdinsight.models; + +import com.azure.resourcemanager.hdinsight.fluent.models.ClusterMonitoringResponseInner; + +/** An immutable client-side representation of ClusterMonitoringResponse. */ +public interface ClusterMonitoringResponse { + /** + * Gets the clusterMonitoringEnabled property: The status of the Operations Management Suite (OMS) on the HDInsight + * cluster. + * + * @return the clusterMonitoringEnabled value. + */ + Boolean clusterMonitoringEnabled(); + + /** + * Gets the workspaceId property: The workspace ID of the Operations Management Suite (OMS) on the HDInsight + * cluster. + * + * @return the workspaceId value. + */ + String workspaceId(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.ClusterMonitoringResponseInner object. + * + * @return the inner object. + */ + ClusterMonitoringResponseInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterPatchParameters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterPatchParameters.java new file mode 100644 index 0000000000000..23b2da30b2644 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterPatchParameters.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The PatchCluster request parameters. */ +@Fluent +public final class ClusterPatchParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterPatchParameters.class); + + /* + * The resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: The resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The resource tags. + * + * @param tags the tags value to set. + * @return the ClusterPatchParameters object itself. + */ + public ClusterPatchParameters 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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterResizeParameters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterResizeParameters.java new file mode 100644 index 0000000000000..20ed06af73ace --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ClusterResizeParameters.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Resize Cluster request parameters. */ +@Fluent +public final class ClusterResizeParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterResizeParameters.class); + + /* + * The target instance count for the operation. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /** + * Get the targetInstanceCount property: The target instance count for the operation. + * + * @return the targetInstanceCount value. + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the targetInstanceCount property: The target instance count for the operation. + * + * @param targetInstanceCount the targetInstanceCount value to set. + * @return the ClusterResizeParameters object itself. + */ + public ClusterResizeParameters withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Clusters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Clusters.java new file mode 100644 index 0000000000000..b69e2fc130789 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Clusters.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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 { + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName); + + /** + * Deletes the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + Cluster getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Gets the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists the HDInsight clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resize(String resourceGroupName, String clusterName, RoleName roleName, ClusterResizeParameters parameters); + + /** + * Resizes the specified HDInsight cluster to the specified size. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The Resize Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resize( + String resourceGroupName, + String clusterName, + RoleName roleName, + ClusterResizeParameters parameters, + Context context); + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters); + + /** + * Updates the Autoscale Configuration for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param roleName The constant value for the roleName. + * @param parameters The autoscale configuration update parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateAutoScaleConfiguration( + String resourceGroupName, + String clusterName, + RoleName roleName, + AutoscaleConfigurationUpdateParameter parameters, + Context context); + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + PagedIterable list(); + + /** + * Lists all the HDInsight clusters under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the List Cluster operation response. + */ + PagedIterable list(Context context); + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 rotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters); + + /** + * Rotate disk encryption key of the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Disk Encryption Cluster request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 rotateDiskEncryptionKey( + String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters, Context context); + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the gateway settings for the specified cluster. + */ + GatewaySettings getGatewaySettings(String resourceGroupName, String clusterName); + + /** + * Gets the gateway settings for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the gateway settings for the specified cluster. + */ + Response getGatewaySettingsWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters); + + /** + * Configures the gateway settings on the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The update gateway settings request parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 updateGatewaySettings( + String resourceGroupName, String clusterName, UpdateGatewaySettingsParameters parameters, Context context); + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running 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 executeScriptActions(String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters); + + /** + * Executes script actions on the specified HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The parameters for the script actions to execute on a running 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 executeScriptActions( + String resourceGroupName, String clusterName, ExecuteScriptActionParameters parameters, Context context); + + /** + * Gets the specified cluster. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + Cluster getById(String id); + + /** + * Gets the specified cluster. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified cluster. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified 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. + */ + void deleteById(String id); + + /** + * Deletes the specified 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. + */ + 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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ComputeProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ComputeProfile.java new file mode 100644 index 0000000000000..855915af2dfe7 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ComputeProfile.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the compute profile. */ +@Fluent +public final class ComputeProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComputeProfile.class); + + /* + * The list of roles in the cluster. + */ + @JsonProperty(value = "roles") + private List roles; + + /** + * Get the roles property: The list of roles in the cluster. + * + * @return the roles value. + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles property: The list of roles in the cluster. + * + * @param roles the roles value to set. + * @return the ComputeProfile object itself. + */ + public ComputeProfile withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roles() != null) { + roles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Configurations.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Configurations.java new file mode 100644 index 0000000000000..37655c5194a85 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Configurations.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.Map; + +/** Resource collection API of Configurations. */ +public interface Configurations { + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all configuration information for an HDI cluster. + */ + ClusterConfigurations list(String resourceGroupName, String clusterName); + + /** + * Gets all configuration information for an HDI cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all configuration information for an HDI cluster. + */ + Response listWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified 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 update(String resourceGroupName, String clusterName, String configurationName, Map parameters); + + /** + * Configures the HTTP settings on the specified cluster. This API is deprecated, please use UpdateGatewaySettings + * in cluster endpoint instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param parameters The configuration object for the specified configuration for the specified 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 update( + String resourceGroupName, + String clusterName, + String configurationName, + Map parameters, + Context context); + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the + * future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration object for the specified configuration for the specified cluster. + */ + Map get(String resourceGroupName, String clusterName, String configurationName); + + /** + * The configuration object for the specified cluster. This API is not recommended and might be removed in the + * future. Please consider using List configurations API instead. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param configurationName The name of the cluster configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the configuration object for the specified configuration for the specified cluster. + */ + Response> getWithResponse( + String resourceGroupName, String clusterName, String configurationName, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ConnectivityEndpoint.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ConnectivityEndpoint.java new file mode 100644 index 0000000000000..3dbaa3f95a5a8 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ConnectivityEndpoint.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The connectivity properties. */ +@Fluent +public final class ConnectivityEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectivityEndpoint.class); + + /* + * The name of the endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The protocol of the endpoint. + */ + @JsonProperty(value = "protocol") + private String protocol; + + /* + * The location of the endpoint. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The port to connect to. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the name property: The name of the endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the endpoint. + * + * @param name the name value to set. + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withName(String name) { + this.name = name; + return this; + } + + /** + * Get the protocol property: The protocol of the endpoint. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol of the endpoint. + * + * @param protocol the protocol value to set. + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the location property: The location of the endpoint. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the endpoint. + * + * @param location the location value to set. + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the port property: The port to connect to. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: The port to connect to. + * + * @param port the port value to set. + * @return the ConnectivityEndpoint object itself. + */ + public ConnectivityEndpoint withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DataDisksGroups.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DataDisksGroups.java new file mode 100644 index 0000000000000..ae3cd805d367f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DataDisksGroups.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The data disks groups for the role. */ +@Fluent +public final class DataDisksGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataDisksGroups.class); + + /* + * The number of disks per node. + */ + @JsonProperty(value = "disksPerNode") + private Integer disksPerNode; + + /* + * ReadOnly. The storage account type. Do not set this value. + */ + @JsonProperty(value = "storageAccountType", access = JsonProperty.Access.WRITE_ONLY) + private String storageAccountType; + + /* + * ReadOnly. The DiskSize in GB. Do not set this value. + */ + @JsonProperty(value = "diskSizeGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer diskSizeGB; + + /** + * Get the disksPerNode property: The number of disks per node. + * + * @return the disksPerNode value. + */ + public Integer disksPerNode() { + return this.disksPerNode; + } + + /** + * Set the disksPerNode property: The number of disks per node. + * + * @param disksPerNode the disksPerNode value to set. + * @return the DataDisksGroups object itself. + */ + public DataDisksGroups withDisksPerNode(Integer disksPerNode) { + this.disksPerNode = disksPerNode; + return this; + } + + /** + * Get the storageAccountType property: ReadOnly. The storage account type. Do not set this value. + * + * @return the storageAccountType value. + */ + public String storageAccountType() { + return this.storageAccountType; + } + + /** + * Get the diskSizeGB property: ReadOnly. The DiskSize in GB. Do not set this value. + * + * @return the diskSizeGB value. + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DaysOfWeek.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DaysOfWeek.java new file mode 100644 index 0000000000000..35e9d0fd491dd --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DaysOfWeek.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.hdinsight.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DaysOfWeek. */ +public enum DaysOfWeek { + /** Enum value Monday. */ + MONDAY("Monday"), + + /** Enum value Tuesday. */ + TUESDAY("Tuesday"), + + /** Enum value Wednesday. */ + WEDNESDAY("Wednesday"), + + /** Enum value Thursday. */ + THURSDAY("Thursday"), + + /** Enum value Friday. */ + FRIDAY("Friday"), + + /** Enum value Saturday. */ + SATURDAY("Saturday"), + + /** Enum value Sunday. */ + SUNDAY("Sunday"); + + /** The actual serialized value for a DaysOfWeek instance. */ + private final String value; + + DaysOfWeek(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DaysOfWeek instance. + * + * @param value the serialized value to parse. + * @return the parsed DaysOfWeek object, or null if unable to parse. + */ + @JsonCreator + public static DaysOfWeek fromString(String value) { + DaysOfWeek[] items = DaysOfWeek.values(); + for (DaysOfWeek item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DirectoryType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DirectoryType.java new file mode 100644 index 0000000000000..543c64d547998 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DirectoryType.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.hdinsight.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DirectoryType. */ +public enum DirectoryType { + /** Enum value ActiveDirectory. */ + ACTIVE_DIRECTORY("ActiveDirectory"); + + /** The actual serialized value for a DirectoryType instance. */ + private final String value; + + DirectoryType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DirectoryType instance. + * + * @param value the serialized value to parse. + * @return the parsed DirectoryType object, or null if unable to parse. + */ + @JsonCreator + public static DirectoryType fromString(String value) { + DirectoryType[] items = DirectoryType.values(); + for (DirectoryType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DiskBillingMeters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DiskBillingMeters.java new file mode 100644 index 0000000000000..3fe9ba4dcfda5 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DiskBillingMeters.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The disk billing meters. */ +@Fluent +public final class DiskBillingMeters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskBillingMeters.class); + + /* + * The managed disk meter guid. + */ + @JsonProperty(value = "diskRpMeter") + private String diskRpMeter; + + /* + * The managed disk billing sku, P30 or S30. + */ + @JsonProperty(value = "sku") + private String sku; + + /* + * The managed disk billing tier, Standard or Premium. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * Get the diskRpMeter property: The managed disk meter guid. + * + * @return the diskRpMeter value. + */ + public String diskRpMeter() { + return this.diskRpMeter; + } + + /** + * Set the diskRpMeter property: The managed disk meter guid. + * + * @param diskRpMeter the diskRpMeter value to set. + * @return the DiskBillingMeters object itself. + */ + public DiskBillingMeters withDiskRpMeter(String diskRpMeter) { + this.diskRpMeter = diskRpMeter; + return this; + } + + /** + * Get the sku property: The managed disk billing sku, P30 or S30. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The managed disk billing sku, P30 or S30. + * + * @param sku the sku value to set. + * @return the DiskBillingMeters object itself. + */ + public DiskBillingMeters withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the tier property: The managed disk billing tier, Standard or Premium. + * + * @return the tier value. + */ + public Tier tier() { + return this.tier; + } + + /** + * Set the tier property: The managed disk billing tier, Standard or Premium. + * + * @param tier the tier value to set. + * @return the DiskBillingMeters object itself. + */ + public DiskBillingMeters withTier(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DiskEncryptionProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DiskEncryptionProperties.java new file mode 100644 index 0000000000000..662cd59107fca --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/DiskEncryptionProperties.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The disk encryption properties. */ +@Fluent +public final class DiskEncryptionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskEncryptionProperties.class); + + /* + * Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net + */ + @JsonProperty(value = "vaultUri") + private String vaultUri; + + /* + * Key name that is used for enabling disk encryption. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /* + * Specific key version that is used for enabling disk encryption. + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /* + * Algorithm identifier for encryption, default RSA-OAEP. + */ + @JsonProperty(value = "encryptionAlgorithm") + private JsonWebKeyEncryptionAlgorithm encryptionAlgorithm; + + /* + * Resource ID of Managed Identity that is used to access the key vault. + */ + @JsonProperty(value = "msiResourceId") + private String msiResourceId; + + /* + * Indicates whether or not resource disk encryption is enabled. + */ + @JsonProperty(value = "encryptionAtHost") + private Boolean encryptionAtHost; + + /** + * Get the vaultUri property: Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net. + * + * @return the vaultUri value. + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set the vaultUri property: Base key vault URI where the customers key is located eg. + * https://myvault.vault.azure.net. + * + * @param vaultUri the vaultUri value to set. + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Get the keyName property: Key name that is used for enabling disk encryption. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: Key name that is used for enabling disk encryption. + * + * @param keyName the keyName value to set. + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: Specific key version that is used for enabling disk encryption. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: Specific key version that is used for enabling disk encryption. + * + * @param keyVersion the keyVersion value to set. + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the encryptionAlgorithm property: Algorithm identifier for encryption, default RSA-OAEP. + * + * @return the encryptionAlgorithm value. + */ + public JsonWebKeyEncryptionAlgorithm encryptionAlgorithm() { + return this.encryptionAlgorithm; + } + + /** + * Set the encryptionAlgorithm property: Algorithm identifier for encryption, default RSA-OAEP. + * + * @param encryptionAlgorithm the encryptionAlgorithm value to set. + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withEncryptionAlgorithm(JsonWebKeyEncryptionAlgorithm encryptionAlgorithm) { + this.encryptionAlgorithm = encryptionAlgorithm; + return this; + } + + /** + * Get the msiResourceId property: Resource ID of Managed Identity that is used to access the key vault. + * + * @return the msiResourceId value. + */ + public String msiResourceId() { + return this.msiResourceId; + } + + /** + * Set the msiResourceId property: Resource ID of Managed Identity that is used to access the key vault. + * + * @param msiResourceId the msiResourceId value to set. + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withMsiResourceId(String msiResourceId) { + this.msiResourceId = msiResourceId; + return this; + } + + /** + * Get the encryptionAtHost property: Indicates whether or not resource disk encryption is enabled. + * + * @return the encryptionAtHost value. + */ + public Boolean encryptionAtHost() { + return this.encryptionAtHost; + } + + /** + * Set the encryptionAtHost property: Indicates whether or not resource disk encryption is enabled. + * + * @param encryptionAtHost the encryptionAtHost value to set. + * @return the DiskEncryptionProperties object itself. + */ + public DiskEncryptionProperties withEncryptionAtHost(Boolean encryptionAtHost) { + this.encryptionAtHost = encryptionAtHost; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/EncryptionInTransitProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/EncryptionInTransitProperties.java new file mode 100644 index 0000000000000..7a8521c16532f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/EncryptionInTransitProperties.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The encryption-in-transit properties. */ +@Fluent +public final class EncryptionInTransitProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionInTransitProperties.class); + + /* + * Indicates whether or not inter cluster node communication is encrypted + * in transit. + */ + @JsonProperty(value = "isEncryptionInTransitEnabled") + private Boolean isEncryptionInTransitEnabled; + + /** + * Get the isEncryptionInTransitEnabled property: Indicates whether or not inter cluster node communication is + * encrypted in transit. + * + * @return the isEncryptionInTransitEnabled value. + */ + public Boolean isEncryptionInTransitEnabled() { + return this.isEncryptionInTransitEnabled; + } + + /** + * Set the isEncryptionInTransitEnabled property: Indicates whether or not inter cluster node communication is + * encrypted in transit. + * + * @param isEncryptionInTransitEnabled the isEncryptionInTransitEnabled value to set. + * @return the EncryptionInTransitProperties object itself. + */ + public EncryptionInTransitProperties withIsEncryptionInTransitEnabled(Boolean isEncryptionInTransitEnabled) { + this.isEncryptionInTransitEnabled = isEncryptionInTransitEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Errors.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Errors.java new file mode 100644 index 0000000000000..05dab5b370f5c --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Errors.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The error message associated with the cluster creation. */ +@Fluent +public final class Errors { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Errors.class); + + /* + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The error code. + * + * @param code the code value to set. + * @return the Errors object itself. + */ + public Errors withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The error message. + * + * @param message the message value to set. + * @return the Errors object itself. + */ + public Errors 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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ExecuteScriptActionParameters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ExecuteScriptActionParameters.java new file mode 100644 index 0000000000000..b628b28c87cc7 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ExecuteScriptActionParameters.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The parameters for the script actions to execute on a running cluster. */ +@Fluent +public final class ExecuteScriptActionParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExecuteScriptActionParameters.class); + + /* + * The list of run time script actions. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /* + * Gets or sets if the scripts needs to be persisted. + */ + @JsonProperty(value = "persistOnSuccess", required = true) + private boolean persistOnSuccess; + + /** + * Get the scriptActions property: The list of run time script actions. + * + * @return the scriptActions value. + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the scriptActions property: The list of run time script actions. + * + * @param scriptActions the scriptActions value to set. + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + + /** + * Get the persistOnSuccess property: Gets or sets if the scripts needs to be persisted. + * + * @return the persistOnSuccess value. + */ + public boolean persistOnSuccess() { + return this.persistOnSuccess; + } + + /** + * Set the persistOnSuccess property: Gets or sets if the scripts needs to be persisted. + * + * @param persistOnSuccess the persistOnSuccess value to set. + * @return the ExecuteScriptActionParameters object itself. + */ + public ExecuteScriptActionParameters withPersistOnSuccess(boolean persistOnSuccess) { + this.persistOnSuccess = persistOnSuccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (scriptActions() != null) { + scriptActions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Extension.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Extension.java new file mode 100644 index 0000000000000..bd3ea08228300 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Extension.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.resourcemanager.hdinsight.fluent.models.ExtensionInner; + +/** An immutable client-side representation of Extension. */ +public interface Extension { + /** + * Gets the workspaceId property: The workspace ID for the cluster monitoring extension. + * + * @return the workspaceId value. + */ + String workspaceId(); + + /** + * Gets the primaryKey property: The certificate for the cluster monitoring extensions. + * + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.ExtensionInner object. + * + * @return the inner object. + */ + ExtensionInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Extensions.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Extensions.java new file mode 100644 index 0000000000000..cf36bebddede3 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Extensions.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hdinsight.fluent.models.ExtensionInner; + +/** Resource collection API of Extensions. */ +public interface Extensions { + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enableMonitoring(String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters); + + /** + * Enables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param parameters The Operations Management Suite (OMS) parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enableMonitoring( + String resourceGroupName, String clusterName, ClusterMonitoringRequest parameters, Context context); + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of Operations Management Suite (OMS) on the HDInsight cluster. + */ + ClusterMonitoringResponse getMonitoringStatus(String resourceGroupName, String clusterName); + + /** + * Gets the status of Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of Operations Management Suite (OMS) on the HDInsight cluster. + */ + Response getMonitoringStatusWithResponse( + String resourceGroupName, String clusterName, Context context); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableMonitoring(String resourceGroupName, String clusterName); + + /** + * Disables the Operations Management Suite (OMS) on the HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableMonitoring(String resourceGroupName, String clusterName, Context context); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 create(String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters); + + /** + * Creates an HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param parameters Cluster monitoring extensions. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 create( + String resourceGroupName, String clusterName, String extensionName, ExtensionInner parameters, Context context); + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the extension properties for the specified HDInsight cluster extension. + */ + Extension get(String resourceGroupName, String clusterName, String extensionName); + + /** + * Gets the extension properties for the specified HDInsight cluster extension. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the extension properties for the specified HDInsight cluster extension. + */ + Response getWithResponse( + String resourceGroupName, String clusterName, String extensionName, Context context); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String extensionName); + + /** + * Deletes the specified extension for HDInsight cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param extensionName The name of the cluster extension. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String extensionName, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/FilterMode.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/FilterMode.java new file mode 100644 index 0000000000000..bcb7d5d1456fb --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/FilterMode.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.hdinsight.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FilterMode. */ +public final class FilterMode extends ExpandableStringEnum { + /** Static value Exclude for FilterMode. */ + public static final FilterMode EXCLUDE = fromString("Exclude"); + + /** Static value Include for FilterMode. */ + public static final FilterMode INCLUDE = fromString("Include"); + + /** + * Creates or finds a FilterMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding FilterMode. + */ + @JsonCreator + public static FilterMode fromString(String name) { + return fromString(name, FilterMode.class); + } + + /** @return known FilterMode values. */ + public static Collection values() { + return values(FilterMode.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/GatewaySettings.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/GatewaySettings.java new file mode 100644 index 0000000000000..d8edb5f9463de --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/GatewaySettings.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.hdinsight.models; + +import com.azure.resourcemanager.hdinsight.fluent.models.GatewaySettingsInner; + +/** An immutable client-side representation of GatewaySettings. */ +public interface GatewaySettings { + /** + * Gets the isCredentialEnabled property: Indicates whether or not the gateway settings based authorization is + * enabled. + * + * @return the isCredentialEnabled value. + */ + String isCredentialEnabled(); + + /** + * Gets the username property: The gateway settings user name. + * + * @return the username value. + */ + String username(); + + /** + * Gets the password property: The gateway settings user password. + * + * @return the password value. + */ + String password(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.GatewaySettingsInner object. + * + * @return the inner object. + */ + GatewaySettingsInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HDInsightClusterProvisioningState.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HDInsightClusterProvisioningState.java new file mode 100644 index 0000000000000..1d2761069e4d7 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HDInsightClusterProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for HDInsightClusterProvisioningState. */ +public enum HDInsightClusterProvisioningState { + /** Enum value InProgress. */ + IN_PROGRESS("InProgress"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Canceled. */ + CANCELED("Canceled"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a HDInsightClusterProvisioningState instance. */ + private final String value; + + HDInsightClusterProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HDInsightClusterProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed HDInsightClusterProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static HDInsightClusterProvisioningState fromString(String value) { + HDInsightClusterProvisioningState[] items = HDInsightClusterProvisioningState.values(); + for (HDInsightClusterProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HardwareProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HardwareProfile.java new file mode 100644 index 0000000000000..31fbe459db33d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HardwareProfile.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The hardware profile. */ +@Fluent +public final class HardwareProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HardwareProfile.class); + + /* + * The size of the VM + */ + @JsonProperty(value = "vmSize") + private String vmSize; + + /** + * Get the vmSize property: The size of the VM. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The size of the VM. + * + * @param vmSize the vmSize value to set. + * @return the HardwareProfile object itself. + */ + public HardwareProfile withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HostInfo.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HostInfo.java new file mode 100644 index 0000000000000..1f4b68ed0a793 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/HostInfo.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.hdinsight.models; + +import com.azure.resourcemanager.hdinsight.fluent.models.HostInfoInner; + +/** An immutable client-side representation of HostInfo. */ +public interface HostInfo { + /** + * Gets the name property: The host name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the fqdn property: The Fully Qualified Domain Name of host. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the effectiveDiskEncryptionKeyUrl property: The effective disk encryption key URL used by the host. + * + * @return the effectiveDiskEncryptionKeyUrl value. + */ + String effectiveDiskEncryptionKeyUrl(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.HostInfoInner object. + * + * @return the inner object. + */ + HostInfoInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/JsonWebKeyEncryptionAlgorithm.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/JsonWebKeyEncryptionAlgorithm.java new file mode 100644 index 0000000000000..013bc7eb299b9 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/JsonWebKeyEncryptionAlgorithm.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for JsonWebKeyEncryptionAlgorithm. */ +public final class JsonWebKeyEncryptionAlgorithm extends ExpandableStringEnum { + /** Static value RSA-OAEP for JsonWebKeyEncryptionAlgorithm. */ + public static final JsonWebKeyEncryptionAlgorithm RSA_OAEP = fromString("RSA-OAEP"); + + /** Static value RSA-OAEP-256 for JsonWebKeyEncryptionAlgorithm. */ + public static final JsonWebKeyEncryptionAlgorithm RSA_OAEP_256 = fromString("RSA-OAEP-256"); + + /** Static value RSA1_5 for JsonWebKeyEncryptionAlgorithm. */ + public static final JsonWebKeyEncryptionAlgorithm RSA1_5 = fromString("RSA1_5"); + + /** + * Creates or finds a JsonWebKeyEncryptionAlgorithm from its string representation. + * + * @param name a name to look for. + * @return the corresponding JsonWebKeyEncryptionAlgorithm. + */ + @JsonCreator + public static JsonWebKeyEncryptionAlgorithm fromString(String name) { + return fromString(name, JsonWebKeyEncryptionAlgorithm.class); + } + + /** @return known JsonWebKeyEncryptionAlgorithm values. */ + public static Collection values() { + return values(JsonWebKeyEncryptionAlgorithm.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/KafkaRestProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/KafkaRestProperties.java new file mode 100644 index 0000000000000..f062c4280c1aa --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/KafkaRestProperties.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The kafka rest proxy configuration which contains AAD security group information. */ +@Fluent +public final class KafkaRestProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KafkaRestProperties.class); + + /* + * The information of AAD security group. + */ + @JsonProperty(value = "clientGroupInfo") + private ClientGroupInfo clientGroupInfo; + + /** + * Get the clientGroupInfo property: The information of AAD security group. + * + * @return the clientGroupInfo value. + */ + public ClientGroupInfo clientGroupInfo() { + return this.clientGroupInfo; + } + + /** + * Set the clientGroupInfo property: The information of AAD security group. + * + * @param clientGroupInfo the clientGroupInfo value to set. + * @return the KafkaRestProperties object itself. + */ + public KafkaRestProperties withClientGroupInfo(ClientGroupInfo clientGroupInfo) { + this.clientGroupInfo = clientGroupInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clientGroupInfo() != null) { + clientGroupInfo().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/LinuxOperatingSystemProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/LinuxOperatingSystemProfile.java new file mode 100644 index 0000000000000..e5621be8aaf43 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/LinuxOperatingSystemProfile.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ssh username, password, and ssh public key. */ +@Fluent +public final class LinuxOperatingSystemProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinuxOperatingSystemProfile.class); + + /* + * The username. + */ + @JsonProperty(value = "username") + private String username; + + /* + * The password. + */ + @JsonProperty(value = "password") + private String password; + + /* + * The SSH profile. + */ + @JsonProperty(value = "sshProfile") + private SshProfile sshProfile; + + /** + * Get the username property: The username. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username. + * + * @param username the username value to set. + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password. + * + * @param password the password value to set. + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the sshProfile property: The SSH profile. + * + * @return the sshProfile value. + */ + public SshProfile sshProfile() { + return this.sshProfile; + } + + /** + * Set the sshProfile property: The SSH profile. + * + * @param sshProfile the sshProfile value to set. + * @return the LinuxOperatingSystemProfile object itself. + */ + public LinuxOperatingSystemProfile withSshProfile(SshProfile sshProfile) { + this.sshProfile = sshProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sshProfile() != null) { + sshProfile().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/LocalizedName.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/LocalizedName.java new file mode 100644 index 0000000000000..7eda7aae7644d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/LocalizedName.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The details about the localizable name of a type of usage. */ +@Fluent +public final class LocalizedName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LocalizedName.class); + + /* + * The name of the used resource. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The localized name of the used resource. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the value property: The name of the used resource. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The name of the used resource. + * + * @param value the value value to set. + * @return the LocalizedName object itself. + */ + public LocalizedName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: The localized name of the used resource. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: The localized name of the used resource. + * + * @param localizedValue the localizedValue value to set. + * @return the LocalizedName object itself. + */ + public LocalizedName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Locations.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Locations.java new file mode 100644 index 0000000000000..d87c482df4d49 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Locations.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Locations. */ +public interface Locations { + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the capabilities for the specified location. + */ + CapabilitiesResult getCapabilities(String location); + + /** + * Gets the capabilities for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the capabilities for the specified location. + */ + Response getCapabilitiesWithResponse(String location, Context context); + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional usages for a subscription. + */ + UsagesListResult listUsages(String location); + + /** + * Lists the usages for the specified location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional usages for a subscription. + */ + Response listUsagesWithResponse(String location, Context context); + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional billingSpecs for a subscription. + */ + BillingResponseListResult listBillingSpecs(String location); + + /** + * Lists the billingSpecs for the specified subscription and location. + * + * @param location The Azure location (region) for which to make the request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for the operation to get regional billingSpecs for a subscription. + */ + Response listBillingSpecsWithResponse(String location, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/NetworkProperties.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/NetworkProperties.java new file mode 100644 index 0000000000000..33f9b74ada294 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/NetworkProperties.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The network properties. */ +@Fluent +public final class NetworkProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProperties.class); + + /* + * The direction for the resource provider connection. + */ + @JsonProperty(value = "resourceProviderConnection") + private ResourceProviderConnection resourceProviderConnection; + + /* + * Indicates whether or not private link is enabled. + */ + @JsonProperty(value = "privateLink") + private PrivateLink privateLink; + + /** + * Get the resourceProviderConnection property: The direction for the resource provider connection. + * + * @return the resourceProviderConnection value. + */ + public ResourceProviderConnection resourceProviderConnection() { + return this.resourceProviderConnection; + } + + /** + * Set the resourceProviderConnection property: The direction for the resource provider connection. + * + * @param resourceProviderConnection the resourceProviderConnection value to set. + * @return the NetworkProperties object itself. + */ + public NetworkProperties withResourceProviderConnection(ResourceProviderConnection resourceProviderConnection) { + this.resourceProviderConnection = resourceProviderConnection; + return this; + } + + /** + * Get the privateLink property: Indicates whether or not private link is enabled. + * + * @return the privateLink value. + */ + public PrivateLink privateLink() { + return this.privateLink; + } + + /** + * Set the privateLink property: Indicates whether or not private link is enabled. + * + * @param privateLink the privateLink value to set. + * @return the NetworkProperties object itself. + */ + public NetworkProperties withPrivateLink(PrivateLink privateLink) { + this.privateLink = privateLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OSType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OSType.java new file mode 100644 index 0000000000000..6f7d48c56acbc --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OSType.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.hdinsight.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for OSType. */ +public enum OSType { + /** Enum value Windows. */ + WINDOWS("Windows"), + + /** Enum value Linux. */ + LINUX("Linux"); + + /** The actual serialized value for a OSType instance. */ + private final String value; + + OSType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OSType instance. + * + * @param value the serialized value to parse. + * @return the parsed OSType object, or null if unable to parse. + */ + @JsonCreator + public static OSType fromString(String value) { + OSType[] items = OSType.values(); + for (OSType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Operation.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Operation.java new file mode 100644 index 0000000000000..56a0ef155183a --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Operation.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.resourcemanager.hdinsight.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OperationDisplay.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OperationDisplay.java new file mode 100644 index 0000000000000..de2c63a9ddbfd --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OperationDisplay.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that represents the operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * The service provider: Microsoft.HDInsight + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * The resource on which the operation is performed: Cluster, Applications, + * etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The operation type: read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Get the provider property: The service provider: Microsoft.HDInsight. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: The service provider: Microsoft.HDInsight. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: The resource on which the operation is performed: Cluster, Applications, etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The resource on which the operation is performed: Cluster, Applications, etc. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The operation type: read, write, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The operation type: read, write, delete, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OperationListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OperationListResult.java new file mode 100644 index 0000000000000..fb17542597045 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OperationListResult.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list HDInsight operations. It contains a list of operations and a URL link to get the next + * set of results. + */ +@Fluent +public final class OperationListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); + + /* + * The list of HDInsight operations supported by the HDInsight resource + * provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of HDInsight operations supported by the HDInsight resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of HDInsight operations supported by the HDInsight resource provider. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Operations.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Operations.java new file mode 100644 index 0000000000000..8247e14268991 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available HDInsight REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + PagedIterable list(); + + /** + * Lists all of the available HDInsight REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list HDInsight operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OsProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OsProfile.java new file mode 100644 index 0000000000000..d3456a105047f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/OsProfile.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Linux operation systems profile. */ +@Fluent +public final class OsProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OsProfile.class); + + /* + * The Linux OS profile. + */ + @JsonProperty(value = "linuxOperatingSystemProfile") + private LinuxOperatingSystemProfile linuxOperatingSystemProfile; + + /** + * Get the linuxOperatingSystemProfile property: The Linux OS profile. + * + * @return the linuxOperatingSystemProfile value. + */ + public LinuxOperatingSystemProfile linuxOperatingSystemProfile() { + return this.linuxOperatingSystemProfile; + } + + /** + * Set the linuxOperatingSystemProfile property: The Linux OS profile. + * + * @param linuxOperatingSystemProfile the linuxOperatingSystemProfile value to set. + * @return the OsProfile object itself. + */ + public OsProfile withLinuxOperatingSystemProfile(LinuxOperatingSystemProfile linuxOperatingSystemProfile) { + this.linuxOperatingSystemProfile = linuxOperatingSystemProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (linuxOperatingSystemProfile() != null) { + linuxOperatingSystemProfile().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/PrivateLink.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/PrivateLink.java new file mode 100644 index 0000000000000..e8080d4cafb04 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/PrivateLink.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.hdinsight.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateLink. */ +public final class PrivateLink extends ExpandableStringEnum { + /** Static value Disabled for PrivateLink. */ + public static final PrivateLink DISABLED = fromString("Disabled"); + + /** Static value Enabled for PrivateLink. */ + public static final PrivateLink ENABLED = fromString("Enabled"); + + /** + * Creates or finds a PrivateLink from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateLink. + */ + @JsonCreator + public static PrivateLink fromString(String name) { + return fromString(name, PrivateLink.class); + } + + /** @return known PrivateLink values. */ + public static Collection values() { + return values(PrivateLink.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/QuotaCapability.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/QuotaCapability.java new file mode 100644 index 0000000000000..76ff4af477262 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/QuotaCapability.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The regional quota capability. */ +@Fluent +public final class QuotaCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaCapability.class); + + /* + * The number of cores used in the subscription. + */ + @JsonProperty(value = "cores_used") + private Long coresUsed; + + /* + * The number of cores that the subscription allowed. + */ + @JsonProperty(value = "max_cores_allowed") + private Long maxCoresAllowed; + + /* + * The list of region quota capabilities. + */ + @JsonProperty(value = "regionalQuotas") + private List regionalQuotas; + + /** + * Get the coresUsed property: The number of cores used in the subscription. + * + * @return the coresUsed value. + */ + public Long coresUsed() { + return this.coresUsed; + } + + /** + * Set the coresUsed property: The number of cores used in the subscription. + * + * @param coresUsed the coresUsed value to set. + * @return the QuotaCapability object itself. + */ + public QuotaCapability withCoresUsed(Long coresUsed) { + this.coresUsed = coresUsed; + return this; + } + + /** + * Get the maxCoresAllowed property: The number of cores that the subscription allowed. + * + * @return the maxCoresAllowed value. + */ + public Long maxCoresAllowed() { + return this.maxCoresAllowed; + } + + /** + * Set the maxCoresAllowed property: The number of cores that the subscription allowed. + * + * @param maxCoresAllowed the maxCoresAllowed value to set. + * @return the QuotaCapability object itself. + */ + public QuotaCapability withMaxCoresAllowed(Long maxCoresAllowed) { + this.maxCoresAllowed = maxCoresAllowed; + return this; + } + + /** + * Get the regionalQuotas property: The list of region quota capabilities. + * + * @return the regionalQuotas value. + */ + public List regionalQuotas() { + return this.regionalQuotas; + } + + /** + * Set the regionalQuotas property: The list of region quota capabilities. + * + * @param regionalQuotas the regionalQuotas value to set. + * @return the QuotaCapability object itself. + */ + public QuotaCapability withRegionalQuotas(List regionalQuotas) { + this.regionalQuotas = regionalQuotas; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (regionalQuotas() != null) { + regionalQuotas().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/QuotaInfo.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/QuotaInfo.java new file mode 100644 index 0000000000000..b98e41333aaa4 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/QuotaInfo.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The quota properties for the cluster. */ +@Fluent +public final class QuotaInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaInfo.class); + + /* + * The cores used by the cluster. + */ + @JsonProperty(value = "coresUsed") + private Integer coresUsed; + + /** + * Get the coresUsed property: The cores used by the cluster. + * + * @return the coresUsed value. + */ + public Integer coresUsed() { + return this.coresUsed; + } + + /** + * Set the coresUsed property: The cores used by the cluster. + * + * @param coresUsed the coresUsed value to set. + * @return the QuotaInfo object itself. + */ + public QuotaInfo withCoresUsed(Integer coresUsed) { + this.coresUsed = coresUsed; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RegionalQuotaCapability.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RegionalQuotaCapability.java new file mode 100644 index 0000000000000..ee1718443c0d8 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RegionalQuotaCapability.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The regional quota capacity. */ +@Fluent +public final class RegionalQuotaCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionalQuotaCapability.class); + + /* + * The region name. + */ + @JsonProperty(value = "region_name") + private String regionName; + + /* + * The number of cores used in the region. + */ + @JsonProperty(value = "cores_used") + private Long coresUsed; + + /* + * The number of cores available in the region. + */ + @JsonProperty(value = "cores_available") + private Long coresAvailable; + + /** + * Get the regionName property: The region name. + * + * @return the regionName value. + */ + public String regionName() { + return this.regionName; + } + + /** + * Set the regionName property: The region name. + * + * @param regionName the regionName value to set. + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withRegionName(String regionName) { + this.regionName = regionName; + return this; + } + + /** + * Get the coresUsed property: The number of cores used in the region. + * + * @return the coresUsed value. + */ + public Long coresUsed() { + return this.coresUsed; + } + + /** + * Set the coresUsed property: The number of cores used in the region. + * + * @param coresUsed the coresUsed value to set. + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withCoresUsed(Long coresUsed) { + this.coresUsed = coresUsed; + return this; + } + + /** + * Get the coresAvailable property: The number of cores available in the region. + * + * @return the coresAvailable value. + */ + public Long coresAvailable() { + return this.coresAvailable; + } + + /** + * Set the coresAvailable property: The number of cores available in the region. + * + * @param coresAvailable the coresAvailable value to set. + * @return the RegionalQuotaCapability object itself. + */ + public RegionalQuotaCapability withCoresAvailable(Long coresAvailable) { + this.coresAvailable = coresAvailable; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RegionsCapability.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RegionsCapability.java new file mode 100644 index 0000000000000..e73fc2d5eedf0 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RegionsCapability.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The regions capability. */ +@Fluent +public final class RegionsCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegionsCapability.class); + + /* + * The list of region capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the available property: The list of region capabilities. + * + * @return the available value. + */ + public List available() { + return this.available; + } + + /** + * Set the available property: The list of region capabilities. + * + * @param available the available value to set. + * @return the RegionsCapability object itself. + */ + public RegionsCapability withAvailable(List available) { + this.available = available; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ResourceIdentityType.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..a3f98e0527883 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ResourceIdentityType.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.hdinsight.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ResourceProviderConnection.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ResourceProviderConnection.java new file mode 100644 index 0000000000000..90cc76cb37ff8 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ResourceProviderConnection.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.hdinsight.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceProviderConnection. */ +public final class ResourceProviderConnection extends ExpandableStringEnum { + /** Static value Inbound for ResourceProviderConnection. */ + public static final ResourceProviderConnection INBOUND = fromString("Inbound"); + + /** Static value Outbound for ResourceProviderConnection. */ + public static final ResourceProviderConnection OUTBOUND = fromString("Outbound"); + + /** + * Creates or finds a ResourceProviderConnection from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProviderConnection. + */ + @JsonCreator + public static ResourceProviderConnection fromString(String name) { + return fromString(name, ResourceProviderConnection.class); + } + + /** @return known ResourceProviderConnection values. */ + public static Collection values() { + return values(ResourceProviderConnection.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Role.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Role.java new file mode 100644 index 0000000000000..4ff129ccf28bd --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Role.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a role on the cluster. */ +@Fluent +public final class Role { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Role.class); + + /* + * The name of the role. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The minimum instance count of the cluster. + */ + @JsonProperty(value = "minInstanceCount") + private Integer minInstanceCount; + + /* + * The instance count of the cluster. + */ + @JsonProperty(value = "targetInstanceCount") + private Integer targetInstanceCount; + + /* + * The autoscale configurations. + */ + @JsonProperty(value = "autoscale") + private Autoscale autoscaleConfiguration; + + /* + * The hardware profile. + */ + @JsonProperty(value = "hardwareProfile") + private HardwareProfile hardwareProfile; + + /* + * The operating system profile. + */ + @JsonProperty(value = "osProfile") + private OsProfile osProfile; + + /* + * The virtual network profile. + */ + @JsonProperty(value = "virtualNetworkProfile") + private VirtualNetworkProfile virtualNetworkProfile; + + /* + * The data disks groups for the role. + */ + @JsonProperty(value = "dataDisksGroups") + private List dataDisksGroups; + + /* + * The list of script actions on the role. + */ + @JsonProperty(value = "scriptActions") + private List scriptActions; + + /** + * Get the name property: The name of the role. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the role. + * + * @param name the name value to set. + * @return the Role object itself. + */ + public Role withName(String name) { + this.name = name; + return this; + } + + /** + * Get the minInstanceCount property: The minimum instance count of the cluster. + * + * @return the minInstanceCount value. + */ + public Integer minInstanceCount() { + return this.minInstanceCount; + } + + /** + * Set the minInstanceCount property: The minimum instance count of the cluster. + * + * @param minInstanceCount the minInstanceCount value to set. + * @return the Role object itself. + */ + public Role withMinInstanceCount(Integer minInstanceCount) { + this.minInstanceCount = minInstanceCount; + return this; + } + + /** + * Get the targetInstanceCount property: The instance count of the cluster. + * + * @return the targetInstanceCount value. + */ + public Integer targetInstanceCount() { + return this.targetInstanceCount; + } + + /** + * Set the targetInstanceCount property: The instance count of the cluster. + * + * @param targetInstanceCount the targetInstanceCount value to set. + * @return the Role object itself. + */ + public Role withTargetInstanceCount(Integer targetInstanceCount) { + this.targetInstanceCount = targetInstanceCount; + return this; + } + + /** + * Get the autoscaleConfiguration property: The autoscale configurations. + * + * @return the autoscaleConfiguration value. + */ + public Autoscale autoscaleConfiguration() { + return this.autoscaleConfiguration; + } + + /** + * Set the autoscaleConfiguration property: The autoscale configurations. + * + * @param autoscaleConfiguration the autoscaleConfiguration value to set. + * @return the Role object itself. + */ + public Role withAutoscaleConfiguration(Autoscale autoscaleConfiguration) { + this.autoscaleConfiguration = autoscaleConfiguration; + return this; + } + + /** + * Get the hardwareProfile property: The hardware profile. + * + * @return the hardwareProfile value. + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile property: The hardware profile. + * + * @param hardwareProfile the hardwareProfile value to set. + * @return the Role object itself. + */ + public Role withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the osProfile property: The operating system profile. + * + * @return the osProfile value. + */ + public OsProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: The operating system profile. + * + * @param osProfile the osProfile value to set. + * @return the Role object itself. + */ + public Role withOsProfile(OsProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the virtualNetworkProfile property: The virtual network profile. + * + * @return the virtualNetworkProfile value. + */ + public VirtualNetworkProfile virtualNetworkProfile() { + return this.virtualNetworkProfile; + } + + /** + * Set the virtualNetworkProfile property: The virtual network profile. + * + * @param virtualNetworkProfile the virtualNetworkProfile value to set. + * @return the Role object itself. + */ + public Role withVirtualNetworkProfile(VirtualNetworkProfile virtualNetworkProfile) { + this.virtualNetworkProfile = virtualNetworkProfile; + return this; + } + + /** + * Get the dataDisksGroups property: The data disks groups for the role. + * + * @return the dataDisksGroups value. + */ + public List dataDisksGroups() { + return this.dataDisksGroups; + } + + /** + * Set the dataDisksGroups property: The data disks groups for the role. + * + * @param dataDisksGroups the dataDisksGroups value to set. + * @return the Role object itself. + */ + public Role withDataDisksGroups(List dataDisksGroups) { + this.dataDisksGroups = dataDisksGroups; + return this; + } + + /** + * Get the scriptActions property: The list of script actions on the role. + * + * @return the scriptActions value. + */ + public List scriptActions() { + return this.scriptActions; + } + + /** + * Set the scriptActions property: The list of script actions on the role. + * + * @param scriptActions the scriptActions value to set. + * @return the Role object itself. + */ + public Role withScriptActions(List scriptActions) { + this.scriptActions = scriptActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoscaleConfiguration() != null) { + autoscaleConfiguration().validate(); + } + if (hardwareProfile() != null) { + hardwareProfile().validate(); + } + if (osProfile() != null) { + osProfile().validate(); + } + if (virtualNetworkProfile() != null) { + virtualNetworkProfile().validate(); + } + if (dataDisksGroups() != null) { + dataDisksGroups().forEach(e -> e.validate()); + } + if (scriptActions() != null) { + scriptActions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RoleName.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RoleName.java new file mode 100644 index 0000000000000..907030cbc1c13 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RoleName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RoleName. */ +public final class RoleName extends ExpandableStringEnum { + /** Static value workernode for RoleName. */ + public static final RoleName WORKERNODE = fromString("workernode"); + + /** + * Creates or finds a RoleName from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoleName. + */ + @JsonCreator + public static RoleName fromString(String name) { + return fromString(name, RoleName.class); + } + + /** @return known RoleName values. */ + public static Collection values() { + return values(RoleName.class); + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RuntimeScriptAction.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RuntimeScriptAction.java new file mode 100644 index 0000000000000..a4b241acc37b4 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RuntimeScriptAction.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a script action on a running cluster. */ +@Fluent +public class RuntimeScriptAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RuntimeScriptAction.class); + + /* + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * The parameters for the script + */ + @JsonProperty(value = "parameters") + private String parameters; + + /* + * The list of roles where script will be executed. + */ + @JsonProperty(value = "roles", required = true) + private List roles; + + /* + * The application name of the script action, if any. + */ + @JsonProperty(value = "applicationName", access = JsonProperty.Access.WRITE_ONLY) + private String applicationName; + + /** + * Get the name property: The name of the script action. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the script action. + * + * @param name the name value to set. + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withName(String name) { + this.name = name; + return this; + } + + /** + * Get the uri property: The URI to the script. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The URI to the script. + * + * @param uri the uri value to set. + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters property: The parameters for the script. + * + * @return the parameters value. + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The parameters for the script. + * + * @param parameters the parameters value to set. + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withParameters(String parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the roles property: The list of roles where script will be executed. + * + * @return the roles value. + */ + public List roles() { + return this.roles; + } + + /** + * Set the roles property: The list of roles where script will be executed. + * + * @param roles the roles value to set. + * @return the RuntimeScriptAction object itself. + */ + public RuntimeScriptAction withRoles(List roles) { + this.roles = roles; + return this; + } + + /** + * Get the applicationName property: The application name of the script action, if any. + * + * @return the applicationName value. + */ + public String applicationName() { + return this.applicationName; + } + + /** + * 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 RuntimeScriptAction")); + } + if (uri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model RuntimeScriptAction")); + } + if (roles() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property roles in model RuntimeScriptAction")); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RuntimeScriptActionDetail.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RuntimeScriptActionDetail.java new file mode 100644 index 0000000000000..24e6694290709 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/RuntimeScriptActionDetail.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.hdinsight.models; + +import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; +import java.util.List; + +/** An immutable client-side representation of RuntimeScriptActionDetail. */ +public interface RuntimeScriptActionDetail { + /** + * Gets the name property: The name of the script action. + * + * @return the name value. + */ + String name(); + + /** + * Gets the uri property: The URI to the script. + * + * @return the uri value. + */ + String uri(); + + /** + * Gets the parameters property: The parameters for the script. + * + * @return the parameters value. + */ + String parameters(); + + /** + * Gets the roles property: The list of roles where script will be executed. + * + * @return the roles value. + */ + List roles(); + + /** + * Gets the applicationName property: The application name of the script action, if any. + * + * @return the applicationName value. + */ + String applicationName(); + + /** + * Gets the scriptExecutionId property: The execution id of the script action. + * + * @return the scriptExecutionId value. + */ + Long scriptExecutionId(); + + /** + * Gets the startTime property: The start time of script action execution. + * + * @return the startTime value. + */ + String startTime(); + + /** + * Gets the endTime property: The end time of script action execution. + * + * @return the endTime value. + */ + String endTime(); + + /** + * Gets the status property: The current execution status of the script action. + * + * @return the status value. + */ + String status(); + + /** + * Gets the operation property: The reason why the script action was executed. + * + * @return the operation value. + */ + String operation(); + + /** + * Gets the executionSummary property: The summary of script action execution result. + * + * @return the executionSummary value. + */ + List executionSummary(); + + /** + * Gets the debugInformation property: The script action execution debug information. + * + * @return the debugInformation value. + */ + String debugInformation(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner object. + * + * @return the inner object. + */ + RuntimeScriptActionDetailInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptAction.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptAction.java new file mode 100644 index 0000000000000..d024aeb5b2dee --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptAction.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a script action on role on the cluster. */ +@Fluent +public final class ScriptAction { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptAction.class); + + /* + * The name of the script action. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The URI to the script. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * The parameters for the script provided. + */ + @JsonProperty(value = "parameters", required = true) + private String parameters; + + /** + * Get the name property: The name of the script action. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the script action. + * + * @param name the name value to set. + * @return the ScriptAction object itself. + */ + public ScriptAction withName(String name) { + this.name = name; + return this; + } + + /** + * Get the uri property: The URI to the script. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The URI to the script. + * + * @param uri the uri value to set. + * @return the ScriptAction object itself. + */ + public ScriptAction withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the parameters property: The parameters for the script provided. + * + * @return the parameters value. + */ + public String parameters() { + return this.parameters; + } + + /** + * Set the parameters property: The parameters for the script provided. + * + * @param parameters the parameters value to set. + * @return the ScriptAction object itself. + */ + public ScriptAction withParameters(String parameters) { + this.parameters = parameters; + 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 ScriptAction")); + } + if (uri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model ScriptAction")); + } + if (parameters() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property parameters in model ScriptAction")); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionExecutionHistoryList.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionExecutionHistoryList.java new file mode 100644 index 0000000000000..40b4220a6947a --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionExecutionHistoryList.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.hdinsight.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list script execution history response. */ +@Immutable +public final class ScriptActionExecutionHistoryList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptActionExecutionHistoryList.class); + + /* + * The list of persisted script action details for the cluster. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of persisted script action details for the cluster. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * 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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionExecutionSummary.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionExecutionSummary.java new file mode 100644 index 0000000000000..6a66e42657a1f --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionExecutionSummary.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.hdinsight.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The execution summary of a script action. */ +@Immutable +public final class ScriptActionExecutionSummary { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptActionExecutionSummary.class); + + /* + * The status of script action execution. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * The instance count for a given script action execution status. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** + * Get the status property: The status of script action execution. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the instanceCount property: The instance count for a given script action execution status. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActions.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActions.java new file mode 100644 index 0000000000000..a9df711b35bf2 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActions.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.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 ScriptActions. */ +public interface ScriptActions { + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String clusterName, String scriptName); + + /** + * Deletes a specified persisted script action of the cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptName The name of the script. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse(String resourceGroupName, String clusterName, String scriptName, Context context); + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Lists all the persisted script actions for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the persisted script action for the cluster. + */ + PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context); + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the script execution detail for the given script execution ID. + */ + RuntimeScriptActionDetail getExecutionDetail( + String resourceGroupName, String clusterName, String scriptExecutionId); + + /** + * Gets the script execution detail for the given script execution ID. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the script execution detail for the given script execution ID. + */ + Response getExecutionDetailWithResponse( + String resourceGroupName, String clusterName, String scriptExecutionId, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionsList.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionsList.java new file mode 100644 index 0000000000000..6faf8fbc53b91 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptActionsList.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hdinsight.fluent.models.RuntimeScriptActionDetailInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The persisted script action for the cluster. */ +@Fluent +public final class ScriptActionsList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScriptActionsList.class); + + /* + * The list of persisted script action details for the cluster. + */ + @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; + + /** + * Get the value property: The list of persisted script action details for the cluster. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of persisted script action details for the cluster. + * + * @param value the value value to set. + * @return the ScriptActionsList object itself. + */ + public ScriptActionsList 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/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptExecutionHistories.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptExecutionHistories.java new file mode 100644 index 0000000000000..3de8e87f435d4 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/ScriptExecutionHistories.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.hdinsight.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 ScriptExecutionHistories. */ +public interface ScriptExecutionHistories { + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + PagedIterable listByCluster(String resourceGroupName, String clusterName); + + /** + * Lists all scripts' execution history for the specified cluster. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list script execution history response. + */ + PagedIterable listByCluster( + String resourceGroupName, String clusterName, Context context); + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution 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 promote(String resourceGroupName, String clusterName, String scriptExecutionId); + + /** + * Promotes the specified ad-hoc script execution to a persisted script. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param scriptExecutionId The script execution Id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response promoteWithResponse( + String resourceGroupName, String clusterName, String scriptExecutionId, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SecurityProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SecurityProfile.java new file mode 100644 index 0000000000000..53ca6123a00ef --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SecurityProfile.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The security profile which contains Ssh public key for the HDInsight cluster. */ +@Fluent +public final class SecurityProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecurityProfile.class); + + /* + * The directory type. + */ + @JsonProperty(value = "directoryType") + private DirectoryType directoryType; + + /* + * The organization's active directory domain. + */ + @JsonProperty(value = "domain") + private String domain; + + /* + * The organizational unit within the Active Directory to place the cluster + * and service accounts. + */ + @JsonProperty(value = "organizationalUnitDN") + private String organizationalUnitDN; + + /* + * The LDAPS protocol URLs to communicate with the Active Directory. + */ + @JsonProperty(value = "ldapsUrls") + private List ldapsUrls; + + /* + * The domain user account that will have admin privileges on the cluster. + */ + @JsonProperty(value = "domainUsername") + private String domainUsername; + + /* + * The domain admin password. + */ + @JsonProperty(value = "domainUserPassword") + private String domainUserPassword; + + /* + * Optional. The Distinguished Names for cluster user groups + */ + @JsonProperty(value = "clusterUsersGroupDNs") + private List clusterUsersGroupDNs; + + /* + * The resource ID of the user's Azure Active Directory Domain Service. + */ + @JsonProperty(value = "aaddsResourceId") + private String aaddsResourceId; + + /* + * User assigned identity that has permissions to read and create + * cluster-related artifacts in the user's AADDS. + */ + @JsonProperty(value = "msiResourceId") + private String msiResourceId; + + /** + * Get the directoryType property: The directory type. + * + * @return the directoryType value. + */ + public DirectoryType directoryType() { + return this.directoryType; + } + + /** + * Set the directoryType property: The directory type. + * + * @param directoryType the directoryType value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDirectoryType(DirectoryType directoryType) { + this.directoryType = directoryType; + return this; + } + + /** + * Get the domain property: The organization's active directory domain. + * + * @return the domain value. + */ + public String domain() { + return this.domain; + } + + /** + * Set the domain property: The organization's active directory domain. + * + * @param domain the domain value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomain(String domain) { + this.domain = domain; + return this; + } + + /** + * Get the organizationalUnitDN property: The organizational unit within the Active Directory to place the cluster + * and service accounts. + * + * @return the organizationalUnitDN value. + */ + public String organizationalUnitDN() { + return this.organizationalUnitDN; + } + + /** + * Set the organizationalUnitDN property: The organizational unit within the Active Directory to place the cluster + * and service accounts. + * + * @param organizationalUnitDN the organizationalUnitDN value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withOrganizationalUnitDN(String organizationalUnitDN) { + this.organizationalUnitDN = organizationalUnitDN; + return this; + } + + /** + * Get the ldapsUrls property: The LDAPS protocol URLs to communicate with the Active Directory. + * + * @return the ldapsUrls value. + */ + public List ldapsUrls() { + return this.ldapsUrls; + } + + /** + * Set the ldapsUrls property: The LDAPS protocol URLs to communicate with the Active Directory. + * + * @param ldapsUrls the ldapsUrls value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withLdapsUrls(List ldapsUrls) { + this.ldapsUrls = ldapsUrls; + return this; + } + + /** + * Get the domainUsername property: The domain user account that will have admin privileges on the cluster. + * + * @return the domainUsername value. + */ + public String domainUsername() { + return this.domainUsername; + } + + /** + * Set the domainUsername property: The domain user account that will have admin privileges on the cluster. + * + * @param domainUsername the domainUsername value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUsername(String domainUsername) { + this.domainUsername = domainUsername; + return this; + } + + /** + * Get the domainUserPassword property: The domain admin password. + * + * @return the domainUserPassword value. + */ + public String domainUserPassword() { + return this.domainUserPassword; + } + + /** + * Set the domainUserPassword property: The domain admin password. + * + * @param domainUserPassword the domainUserPassword value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withDomainUserPassword(String domainUserPassword) { + this.domainUserPassword = domainUserPassword; + return this; + } + + /** + * Get the clusterUsersGroupDNs property: Optional. The Distinguished Names for cluster user groups. + * + * @return the clusterUsersGroupDNs value. + */ + public List clusterUsersGroupDNs() { + return this.clusterUsersGroupDNs; + } + + /** + * Set the clusterUsersGroupDNs property: Optional. The Distinguished Names for cluster user groups. + * + * @param clusterUsersGroupDNs the clusterUsersGroupDNs value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withClusterUsersGroupDNs(List clusterUsersGroupDNs) { + this.clusterUsersGroupDNs = clusterUsersGroupDNs; + return this; + } + + /** + * Get the aaddsResourceId property: The resource ID of the user's Azure Active Directory Domain Service. + * + * @return the aaddsResourceId value. + */ + public String aaddsResourceId() { + return this.aaddsResourceId; + } + + /** + * Set the aaddsResourceId property: The resource ID of the user's Azure Active Directory Domain Service. + * + * @param aaddsResourceId the aaddsResourceId value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withAaddsResourceId(String aaddsResourceId) { + this.aaddsResourceId = aaddsResourceId; + return this; + } + + /** + * Get the msiResourceId property: User assigned identity that has permissions to read and create cluster-related + * artifacts in the user's AADDS. + * + * @return the msiResourceId value. + */ + public String msiResourceId() { + return this.msiResourceId; + } + + /** + * Set the msiResourceId property: User assigned identity that has permissions to read and create cluster-related + * artifacts in the user's AADDS. + * + * @param msiResourceId the msiResourceId value to set. + * @return the SecurityProfile object itself. + */ + public SecurityProfile withMsiResourceId(String msiResourceId) { + this.msiResourceId = msiResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SshProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SshProfile.java new file mode 100644 index 0000000000000..6557f3b565060 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SshProfile.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of SSH public keys. */ +@Fluent +public final class SshProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshProfile.class); + + /* + * The list of SSH public keys. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** + * Get the publicKeys property: The list of SSH public keys. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: The list of SSH public keys. + * + * @param publicKeys the publicKeys value to set. + * @return the SshProfile object itself. + */ + public SshProfile withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() != null) { + publicKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SshPublicKey.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SshPublicKey.java new file mode 100644 index 0000000000000..c154cfb2bfc79 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/SshPublicKey.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SSH public key for the cluster nodes. */ +@Fluent +public final class SshPublicKey { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SshPublicKey.class); + + /* + * The certificate for SSH. + */ + @JsonProperty(value = "certificateData") + private String certificateData; + + /** + * Get the certificateData property: The certificate for SSH. + * + * @return the certificateData value. + */ + public String certificateData() { + return this.certificateData; + } + + /** + * Set the certificateData property: The certificate for SSH. + * + * @param certificateData the certificateData value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withCertificateData(String certificateData) { + this.certificateData = certificateData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/StorageAccount.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/StorageAccount.java new file mode 100644 index 0000000000000..d1bc8e859bbcd --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/StorageAccount.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The storage Account. */ +@Fluent +public final class StorageAccount { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccount.class); + + /* + * The name of the storage account. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Whether or not the storage account is the default storage account. + */ + @JsonProperty(value = "isDefault") + private Boolean isDefault; + + /* + * The container in the storage account, only to be specified for WASB + * storage accounts. + */ + @JsonProperty(value = "container") + private String container; + + /* + * The filesystem, only to be specified for Azure Data Lake Storage Gen 2. + */ + @JsonProperty(value = "fileSystem") + private String fileSystem; + + /* + * The storage account access key. + */ + @JsonProperty(value = "key") + private String key; + + /* + * The resource ID of storage account, only to be specified for Azure Data + * Lake Storage Gen 2. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The managed identity (MSI) that is allowed to access the storage + * account, only to be specified for Azure Data Lake Storage Gen 2. + */ + @JsonProperty(value = "msiResourceId") + private String msiResourceId; + + /** + * Get the name property: The name of the storage account. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the storage account. + * + * @param name the name value to set. + * @return the StorageAccount object itself. + */ + public StorageAccount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDefault property: Whether or not the storage account is the default storage account. + * + * @return the isDefault value. + */ + public Boolean isDefault() { + return this.isDefault; + } + + /** + * Set the isDefault property: Whether or not the storage account is the default storage account. + * + * @param isDefault the isDefault value to set. + * @return the StorageAccount object itself. + */ + public StorageAccount withIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the container property: The container in the storage account, only to be specified for WASB storage accounts. + * + * @return the container value. + */ + public String container() { + return this.container; + } + + /** + * Set the container property: The container in the storage account, only to be specified for WASB storage accounts. + * + * @param container the container value to set. + * @return the StorageAccount object itself. + */ + public StorageAccount withContainer(String container) { + this.container = container; + return this; + } + + /** + * Get the fileSystem property: The filesystem, only to be specified for Azure Data Lake Storage Gen 2. + * + * @return the fileSystem value. + */ + public String fileSystem() { + return this.fileSystem; + } + + /** + * Set the fileSystem property: The filesystem, only to be specified for Azure Data Lake Storage Gen 2. + * + * @param fileSystem the fileSystem value to set. + * @return the StorageAccount object itself. + */ + public StorageAccount withFileSystem(String fileSystem) { + this.fileSystem = fileSystem; + return this; + } + + /** + * Get the key property: The storage account access key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The storage account access key. + * + * @param key the key value to set. + * @return the StorageAccount object itself. + */ + public StorageAccount withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the resourceId property: The resource ID of storage account, only to be specified for Azure Data Lake Storage + * Gen 2. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource ID of storage account, only to be specified for Azure Data Lake Storage + * Gen 2. + * + * @param resourceId the resourceId value to set. + * @return the StorageAccount object itself. + */ + public StorageAccount withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the msiResourceId property: The managed identity (MSI) that is allowed to access the storage account, only to + * be specified for Azure Data Lake Storage Gen 2. + * + * @return the msiResourceId value. + */ + public String msiResourceId() { + return this.msiResourceId; + } + + /** + * Set the msiResourceId property: The managed identity (MSI) that is allowed to access the storage account, only to + * be specified for Azure Data Lake Storage Gen 2. + * + * @param msiResourceId the msiResourceId value to set. + * @return the StorageAccount object itself. + */ + public StorageAccount withMsiResourceId(String msiResourceId) { + this.msiResourceId = msiResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/StorageProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/StorageProfile.java new file mode 100644 index 0000000000000..48c44e9897d8d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/StorageProfile.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The storage profile. */ +@Fluent +public final class StorageProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageProfile.class); + + /* + * The list of storage accounts in the cluster. + */ + @JsonProperty(value = "storageaccounts") + private List storageaccounts; + + /** + * Get the storageaccounts property: The list of storage accounts in the cluster. + * + * @return the storageaccounts value. + */ + public List storageaccounts() { + return this.storageaccounts; + } + + /** + * Set the storageaccounts property: The list of storage accounts in the cluster. + * + * @param storageaccounts the storageaccounts value to set. + * @return the StorageProfile object itself. + */ + public StorageProfile withStorageaccounts(List storageaccounts) { + this.storageaccounts = storageaccounts; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageaccounts() != null) { + storageaccounts().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Tier.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Tier.java new file mode 100644 index 0000000000000..5f411fae1efe4 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Tier.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.hdinsight.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Tier. */ +public enum Tier { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a Tier instance. */ + private final String value; + + Tier(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Tier instance. + * + * @param value the serialized value to parse. + * @return the parsed Tier object, or null if unable to parse. + */ + @JsonCreator + public static Tier fromString(String value) { + Tier[] items = Tier.values(); + for (Tier item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UpdateGatewaySettingsParameters.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UpdateGatewaySettingsParameters.java new file mode 100644 index 0000000000000..bf0f152a11d2c --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UpdateGatewaySettingsParameters.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The update gateway settings request parameters. */ +@Fluent +public final class UpdateGatewaySettingsParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateGatewaySettingsParameters.class); + + /* + * Indicates whether or not the gateway settings based authorization is + * enabled. + */ + @JsonProperty(value = "restAuthCredential.isEnabled") + private Boolean isCredentialEnabled; + + /* + * The gateway settings user name. + */ + @JsonProperty(value = "restAuthCredential.username") + private String username; + + /* + * The gateway settings user password. + */ + @JsonProperty(value = "restAuthCredential.password") + private String password; + + /** + * Get the isCredentialEnabled property: Indicates whether or not the gateway settings based authorization is + * enabled. + * + * @return the isCredentialEnabled value. + */ + public Boolean isCredentialEnabled() { + return this.isCredentialEnabled; + } + + /** + * Set the isCredentialEnabled property: Indicates whether or not the gateway settings based authorization is + * enabled. + * + * @param isCredentialEnabled the isCredentialEnabled value to set. + * @return the UpdateGatewaySettingsParameters object itself. + */ + public UpdateGatewaySettingsParameters withIsCredentialEnabled(Boolean isCredentialEnabled) { + this.isCredentialEnabled = isCredentialEnabled; + return this; + } + + /** + * Get the username property: The gateway settings user name. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The gateway settings user name. + * + * @param username the username value to set. + * @return the UpdateGatewaySettingsParameters object itself. + */ + public UpdateGatewaySettingsParameters withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The gateway settings user password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The gateway settings user password. + * + * @param password the password value to set. + * @return the UpdateGatewaySettingsParameters object itself. + */ + public UpdateGatewaySettingsParameters withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Usage.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Usage.java new file mode 100644 index 0000000000000..8154ad19c3cd3 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/Usage.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The details about the usage of a particular limited resource. */ +@Fluent +public final class Usage { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Usage.class); + + /* + * The type of measurement for usage. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * The current usage. + */ + @JsonProperty(value = "currentValue") + private Integer currentValue; + + /* + * The maximum allowed usage. + */ + @JsonProperty(value = "limit") + private Integer limit; + + /* + * The details about the localizable name of the used resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private LocalizedName name; + + /** + * Get the unit property: The type of measurement for usage. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The type of measurement for usage. + * + * @param unit the unit value to set. + * @return the Usage object itself. + */ + public Usage withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the currentValue property: The current usage. + * + * @return the currentValue value. + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: The current usage. + * + * @param currentValue the currentValue value to set. + * @return the Usage object itself. + */ + public Usage withCurrentValue(Integer currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit property: The maximum allowed usage. + * + * @return the limit value. + */ + public Integer limit() { + return this.limit; + } + + /** + * Set the limit property: The maximum allowed usage. + * + * @param limit the limit value to set. + * @return the Usage object itself. + */ + public Usage withLimit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Get the name property: The details about the localizable name of the used resource. + * + * @return the name value. + */ + public LocalizedName name() { + return this.name; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UsagesListResult.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UsagesListResult.java new file mode 100644 index 0000000000000..0bc8ea53b4115 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/UsagesListResult.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.resourcemanager.hdinsight.fluent.models.UsagesListResultInner; +import java.util.List; + +/** An immutable client-side representation of UsagesListResult. */ +public interface UsagesListResult { + /** + * Gets the value property: The list of usages. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.hdinsight.fluent.models.UsagesListResultInner object. + * + * @return the inner object. + */ + UsagesListResultInner innerModel(); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VersionSpec.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VersionSpec.java new file mode 100644 index 0000000000000..11fcc01cc293d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VersionSpec.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The version properties. */ +@Fluent +public final class VersionSpec { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VersionSpec.class); + + /* + * The friendly name + */ + @JsonProperty(value = "friendlyName") + private String friendlyName; + + /* + * The display name + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Whether or not the version is the default version. + */ + @JsonProperty(value = "isDefault") + private String isDefault; + + /* + * The component version property. + */ + @JsonProperty(value = "componentVersions") + private Map componentVersions; + + /** + * Get the friendlyName property: The friendly name. + * + * @return the friendlyName value. + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The friendly name. + * + * @param friendlyName the friendlyName value to set. + * @return the VersionSpec object itself. + */ + public VersionSpec withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the displayName property: The display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name. + * + * @param displayName the displayName value to set. + * @return the VersionSpec object itself. + */ + public VersionSpec withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the isDefault property: Whether or not the version is the default version. + * + * @return the isDefault value. + */ + public String isDefault() { + return this.isDefault; + } + + /** + * Set the isDefault property: Whether or not the version is the default version. + * + * @param isDefault the isDefault value to set. + * @return the VersionSpec object itself. + */ + public VersionSpec withIsDefault(String isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Get the componentVersions property: The component version property. + * + * @return the componentVersions value. + */ + public Map componentVersions() { + return this.componentVersions; + } + + /** + * Set the componentVersions property: The component version property. + * + * @param componentVersions the componentVersions value to set. + * @return the VersionSpec object itself. + */ + public VersionSpec withComponentVersions(Map componentVersions) { + this.componentVersions = componentVersions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VersionsCapability.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VersionsCapability.java new file mode 100644 index 0000000000000..f381cd40d525d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VersionsCapability.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The version capability. */ +@Fluent +public final class VersionsCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VersionsCapability.class); + + /* + * The list of version capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the available property: The list of version capabilities. + * + * @return the available value. + */ + public List available() { + return this.available; + } + + /** + * Set the available property: The list of version capabilities. + * + * @param available the available value to set. + * @return the VersionsCapability object itself. + */ + public VersionsCapability withAvailable(List available) { + this.available = available; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (available() != null) { + available().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VirtualMachines.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VirtualMachines.java new file mode 100644 index 0000000000000..43cab04a93877 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VirtualMachines.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.hdinsight.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of VirtualMachines. */ +public interface VirtualMachines { + /** + * Lists the HDInsight clusters hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster hosts. + */ + List listHosts(String resourceGroupName, String clusterName); + + /** + * Lists the HDInsight clusters hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list cluster hosts. + */ + Response> listHostsWithResponse(String resourceGroupName, String clusterName, Context context); + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restartHosts(String resourceGroupName, String clusterName, List hosts); + + /** + * Restarts the specified HDInsight cluster hosts. + * + * @param resourceGroupName The name of the resource group. + * @param clusterName The name of the cluster. + * @param hosts The list of hosts which need to be restarted. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restartHosts(String resourceGroupName, String clusterName, List hosts, Context context); +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VirtualNetworkProfile.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VirtualNetworkProfile.java new file mode 100644 index 0000000000000..25ad5db396428 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VirtualNetworkProfile.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The virtual network properties. */ +@Fluent +public final class VirtualNetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkProfile.class); + + /* + * The ID of the virtual network. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the subnet. + */ + @JsonProperty(value = "subnet") + private String subnet; + + /** + * Get the id property: The ID of the virtual network. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the virtual network. + * + * @param id the id value to set. + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withId(String id) { + this.id = id; + return this; + } + + /** + * Get the subnet property: The name of the subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The name of the subnet. + * + * @param subnet the subnet value to set. + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizeCompatibilityFilter.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizeCompatibilityFilter.java new file mode 100644 index 0000000000000..fbcc9c8a34e5d --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizeCompatibilityFilter.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The virtual machine type compatibility filter. */ +@Fluent +public final class VmSizeCompatibilityFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmSizeCompatibilityFilter.class); + + /* + * The mode for the filter. + */ + @JsonProperty(value = "FilterMode") + private String filterMode; + + /* + * The list of regions. + */ + @JsonProperty(value = "Regions") + private List regions; + + /* + * The list of cluster types available. + */ + @JsonProperty(value = "ClusterFlavors") + private List clusterFlavors; + + /* + * The list of node types. + */ + @JsonProperty(value = "NodeTypes") + private List nodeTypes; + + /* + * The list of cluster versions. + */ + @JsonProperty(value = "ClusterVersions") + private List clusterVersions; + + /* + * The list of virtual machine sizes. + */ + @JsonProperty(value = "vmsizes") + private List vmsizes; + + /** + * Get the filterMode property: The mode for the filter. + * + * @return the filterMode value. + */ + public String filterMode() { + return this.filterMode; + } + + /** + * Set the filterMode property: The mode for the filter. + * + * @param filterMode the filterMode value to set. + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withFilterMode(String filterMode) { + this.filterMode = filterMode; + return this; + } + + /** + * Get the regions property: The list of regions. + * + * @return the regions value. + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions property: The list of regions. + * + * @param regions the regions value to set. + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Get the clusterFlavors property: The list of cluster types available. + * + * @return the clusterFlavors value. + */ + public List clusterFlavors() { + return this.clusterFlavors; + } + + /** + * Set the clusterFlavors property: The list of cluster types available. + * + * @param clusterFlavors the clusterFlavors value to set. + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withClusterFlavors(List clusterFlavors) { + this.clusterFlavors = clusterFlavors; + return this; + } + + /** + * Get the nodeTypes property: The list of node types. + * + * @return the nodeTypes value. + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the nodeTypes property: The list of node types. + * + * @param nodeTypes the nodeTypes value to set. + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the clusterVersions property: The list of cluster versions. + * + * @return the clusterVersions value. + */ + public List clusterVersions() { + return this.clusterVersions; + } + + /** + * Set the clusterVersions property: The list of cluster versions. + * + * @param clusterVersions the clusterVersions value to set. + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withClusterVersions(List clusterVersions) { + this.clusterVersions = clusterVersions; + return this; + } + + /** + * Get the vmsizes property: The list of virtual machine sizes. + * + * @return the vmsizes value. + */ + public List vmsizes() { + return this.vmsizes; + } + + /** + * Set the vmsizes property: The list of virtual machine sizes. + * + * @param vmsizes the vmsizes value to set. + * @return the VmSizeCompatibilityFilter object itself. + */ + public VmSizeCompatibilityFilter withVmsizes(List vmsizes) { + this.vmsizes = vmsizes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizeCompatibilityFilterV2.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizeCompatibilityFilterV2.java new file mode 100644 index 0000000000000..24310c0abf342 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizeCompatibilityFilterV2.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * This class represent a single filter object that defines a multidimensional set. The dimensions of this set are + * Regions, ClusterFlavors, NodeTypes and ClusterVersions. The constraint should be defined based on the following: + * FilterMode (Exclude vs Include), VMSizes (the vm sizes in affect of exclusion/inclusion) and the ordering of the + * Filters. Later filters override previous settings if conflicted. + */ +@Fluent +public final class VmSizeCompatibilityFilterV2 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmSizeCompatibilityFilterV2.class); + + /* + * The filtering mode. Effectively this can enabling or disabling the VM + * sizes in a particular set. + */ + @JsonProperty(value = "filterMode") + private FilterMode filterMode; + + /* + * The list of regions under the effect of the filter. + */ + @JsonProperty(value = "regions") + private List regions; + + /* + * The list of cluster flavors under the effect of the filter. + */ + @JsonProperty(value = "clusterFlavors") + private List clusterFlavors; + + /* + * The list of node types affected by the filter. + */ + @JsonProperty(value = "nodeTypes") + private List nodeTypes; + + /* + * The list of cluster versions affected in Major.Minor format. + */ + @JsonProperty(value = "clusterVersions") + private List clusterVersions; + + /* + * The OSType affected, Windows or Linux. + */ + @JsonProperty(value = "osType") + private List osType; + + /* + * The list of virtual machine sizes to include or exclude. + */ + @JsonProperty(value = "vmSizes") + private List vmSizes; + + /** + * Get the filterMode property: The filtering mode. Effectively this can enabling or disabling the VM sizes in a + * particular set. + * + * @return the filterMode value. + */ + public FilterMode filterMode() { + return this.filterMode; + } + + /** + * Set the filterMode property: The filtering mode. Effectively this can enabling or disabling the VM sizes in a + * particular set. + * + * @param filterMode the filterMode value to set. + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withFilterMode(FilterMode filterMode) { + this.filterMode = filterMode; + return this; + } + + /** + * Get the regions property: The list of regions under the effect of the filter. + * + * @return the regions value. + */ + public List regions() { + return this.regions; + } + + /** + * Set the regions property: The list of regions under the effect of the filter. + * + * @param regions the regions value to set. + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withRegions(List regions) { + this.regions = regions; + return this; + } + + /** + * Get the clusterFlavors property: The list of cluster flavors under the effect of the filter. + * + * @return the clusterFlavors value. + */ + public List clusterFlavors() { + return this.clusterFlavors; + } + + /** + * Set the clusterFlavors property: The list of cluster flavors under the effect of the filter. + * + * @param clusterFlavors the clusterFlavors value to set. + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withClusterFlavors(List clusterFlavors) { + this.clusterFlavors = clusterFlavors; + return this; + } + + /** + * Get the nodeTypes property: The list of node types affected by the filter. + * + * @return the nodeTypes value. + */ + public List nodeTypes() { + return this.nodeTypes; + } + + /** + * Set the nodeTypes property: The list of node types affected by the filter. + * + * @param nodeTypes the nodeTypes value to set. + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withNodeTypes(List nodeTypes) { + this.nodeTypes = nodeTypes; + return this; + } + + /** + * Get the clusterVersions property: The list of cluster versions affected in Major.Minor format. + * + * @return the clusterVersions value. + */ + public List clusterVersions() { + return this.clusterVersions; + } + + /** + * Set the clusterVersions property: The list of cluster versions affected in Major.Minor format. + * + * @param clusterVersions the clusterVersions value to set. + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withClusterVersions(List clusterVersions) { + this.clusterVersions = clusterVersions; + return this; + } + + /** + * Get the osType property: The OSType affected, Windows or Linux. + * + * @return the osType value. + */ + public List osType() { + return this.osType; + } + + /** + * Set the osType property: The OSType affected, Windows or Linux. + * + * @param osType the osType value to set. + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withOsType(List osType) { + this.osType = osType; + return this; + } + + /** + * Get the vmSizes property: The list of virtual machine sizes to include or exclude. + * + * @return the vmSizes value. + */ + public List vmSizes() { + return this.vmSizes; + } + + /** + * Set the vmSizes property: The list of virtual machine sizes to include or exclude. + * + * @param vmSizes the vmSizes value to set. + * @return the VmSizeCompatibilityFilterV2 object itself. + */ + public VmSizeCompatibilityFilterV2 withVmSizes(List vmSizes) { + this.vmSizes = vmSizes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizesCapability.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizesCapability.java new file mode 100644 index 0000000000000..32b6599420769 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/VmSizesCapability.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.hdinsight.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The virtual machine sizes capability. */ +@Fluent +public final class VmSizesCapability { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VmSizesCapability.class); + + /* + * The list of virtual machine size capabilities. + */ + @JsonProperty(value = "available") + private List available; + + /** + * Get the available property: The list of virtual machine size capabilities. + * + * @return the available value. + */ + public List available() { + return this.available; + } + + /** + * Set the available property: The list of virtual machine size capabilities. + * + * @param available the available value to set. + * @return the VmSizesCapability object itself. + */ + public VmSizesCapability withAvailable(List available) { + this.available = available; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/package-info.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/package-info.java new file mode 100644 index 0000000000000..6926e8560b28e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/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 HDInsightManagementClient. HDInsight Management Client. */ +package com.azure.resourcemanager.hdinsight.models; diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/package-info.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/package-info.java new file mode 100644 index 0000000000000..d31295195960e --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/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 HDInsightManagementClient. HDInsight Management Client. */ +package com.azure.resourcemanager.hdinsight; diff --git a/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/module-info.java b/sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/module-info.java new file mode 100644 index 0000000000000..0ecdc6c90d139 --- /dev/null +++ b/sdk/hdinsight/azure-resourcemanager-hdinsight/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.hdinsight { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.hdinsight; + exports com.azure.resourcemanager.hdinsight.fluent; + exports com.azure.resourcemanager.hdinsight.fluent.models; + exports com.azure.resourcemanager.hdinsight.models; + + opens com.azure.resourcemanager.hdinsight.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.hdinsight.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/hdinsight/ci.yml b/sdk/hdinsight/ci.yml new file mode 100644 index 0000000000000..fd6f84f54d100 --- /dev/null +++ b/sdk/hdinsight/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: hdinsight + Artifacts: + - name: azure-resourcemanager-hdinsight + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerhdinsight diff --git a/sdk/hdinsight/pom.xml b/sdk/hdinsight/pom.xml new file mode 100644 index 0000000000000..81a209c55738f --- /dev/null +++ b/sdk/hdinsight/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-hdinsight-service + pom + 1.0.0 + + azure-resourcemanager-hdinsight + +