From ada9002b657f520b7e9eb8e440480e8b43be9f6b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 1 Jun 2021 02:31:24 +0000 Subject: [PATCH] CodeGen from PR 14604 in Azure/azure-rest-api-specs Hdinsight t2 config (#14604) * sql t2 readme config * readme config * Update readme.python.md * conflient resolve * readme t2 config * modelerfour config * Update readme.python.md Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- .../azure-mgmt-hdinsight/MANIFEST.in | 1 + sdk/hdinsight/azure-mgmt-hdinsight/_meta.json | 8 + .../azure/mgmt/hdinsight/models/__init__.py | 39 +- .../azure/mgmt/hdinsight/models/_models.py | 476 ++++++++++++++--- .../mgmt/hdinsight/models/_models_py3.py | 488 +++++++++++++++--- .../operations/_applications_operations.py | 66 +++ .../operations/_clusters_operations.py | 161 +++++- .../operations/_configurations_operations.py | 2 +- .../operations/_extensions_operations.py | 301 ++++++++++- .../operations/_locations_operations.py | 195 +++++++ .../operations/_script_actions_operations.py | 63 +++ .../_virtual_machines_operations.py | 65 ++- 12 files changed, 1725 insertions(+), 140 deletions(-) create mode 100644 sdk/hdinsight/azure-mgmt-hdinsight/_meta.json diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/MANIFEST.in b/sdk/hdinsight/azure-mgmt-hdinsight/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/MANIFEST.in +++ b/sdk/hdinsight/azure-mgmt-hdinsight/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/_meta.json b/sdk/hdinsight/azure-mgmt-hdinsight/_meta.json new file mode 100644 index 000000000000..607ccd956216 --- /dev/null +++ b/sdk/hdinsight/azure-mgmt-hdinsight/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "6a38cb16662cd02a3659665f9242d5ce011e032e", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/hdinsight/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/hdinsight/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py index f289861d8795..7ae816712c61 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py @@ -10,16 +10,22 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AaddsResourceDetails from ._models_py3 import Application from ._models_py3 import ApplicationGetEndpoint from ._models_py3 import ApplicationGetHttpsEndpoint from ._models_py3 import ApplicationProperties + from ._models_py3 import AsyncOperationResult from ._models_py3 import Autoscale from ._models_py3 import AutoscaleCapacity from ._models_py3 import AutoscaleConfigurationUpdateParameter from ._models_py3 import AutoscaleRecurrence from ._models_py3 import AutoscaleSchedule from ._models_py3 import AutoscaleTimeAndCapacity + from ._models_py3 import AzureMonitorRequest + from ._models_py3 import AzureMonitorResponse + from ._models_py3 import AzureMonitorSelectedConfigurations + from ._models_py3 import AzureMonitorTableConfiguration from ._models_py3 import BillingMeters from ._models_py3 import BillingResources from ._models_py3 import BillingResponseListResult @@ -29,6 +35,8 @@ from ._models_py3 import ClusterConfigurations from ._models_py3 import ClusterCreateParametersExtended from ._models_py3 import ClusterCreateProperties + from ._models_py3 import ClusterCreateRequestValidationParameters + from ._models_py3 import ClusterCreateValidationResult from ._models_py3 import ClusterDefinition from ._models_py3 import ClusterDiskEncryptionParameters from ._models_py3 import ClusterGetProperties @@ -60,11 +68,12 @@ from ._models_py3 import LinuxOperatingSystemProfile from ._models_py3 import LocalizedName from ._models_py3 import MetricSpecifications + from ._models_py3 import NameAvailabilityCheckRequestParameters + from ._models_py3 import NameAvailabilityCheckResult from ._models_py3 import NetworkProperties from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationProperties - from ._models_py3 import OperationResource from ._models_py3 import OsProfile from ._models_py3 import ProxyResource from ._models_py3 import QuotaCapability @@ -85,9 +94,11 @@ from ._models_py3 import StorageAccount from ._models_py3 import StorageProfile from ._models_py3 import TrackedResource + from ._models_py3 import UpdateClusterIdentityCertificateParameters from ._models_py3 import UpdateGatewaySettingsParameters from ._models_py3 import Usage from ._models_py3 import UsagesListResult + from ._models_py3 import ValidationErrorInfo from ._models_py3 import VersionsCapability from ._models_py3 import VersionSpec from ._models_py3 import VirtualNetworkProfile @@ -96,16 +107,22 @@ from ._models_py3 import VmSizeProperty from ._models_py3 import VmSizesCapability except (SyntaxError, ImportError): + from ._models import AaddsResourceDetails from ._models import Application from ._models import ApplicationGetEndpoint from ._models import ApplicationGetHttpsEndpoint from ._models import ApplicationProperties + from ._models import AsyncOperationResult from ._models import Autoscale from ._models import AutoscaleCapacity from ._models import AutoscaleConfigurationUpdateParameter from ._models import AutoscaleRecurrence from ._models import AutoscaleSchedule from ._models import AutoscaleTimeAndCapacity + from ._models import AzureMonitorRequest + from ._models import AzureMonitorResponse + from ._models import AzureMonitorSelectedConfigurations + from ._models import AzureMonitorTableConfiguration from ._models import BillingMeters from ._models import BillingResources from ._models import BillingResponseListResult @@ -115,6 +132,8 @@ from ._models import ClusterConfigurations from ._models import ClusterCreateParametersExtended from ._models import ClusterCreateProperties + from ._models import ClusterCreateRequestValidationParameters + from ._models import ClusterCreateValidationResult from ._models import ClusterDefinition from ._models import ClusterDiskEncryptionParameters from ._models import ClusterGetProperties @@ -146,11 +165,12 @@ from ._models import LinuxOperatingSystemProfile from ._models import LocalizedName from ._models import MetricSpecifications + from ._models import NameAvailabilityCheckRequestParameters + from ._models import NameAvailabilityCheckResult from ._models import NetworkProperties from ._models import Operation from ._models import OperationDisplay from ._models import OperationProperties - from ._models import OperationResource from ._models import OsProfile from ._models import ProxyResource from ._models import QuotaCapability @@ -171,9 +191,11 @@ from ._models import StorageAccount from ._models import StorageProfile from ._models import TrackedResource + from ._models import UpdateClusterIdentityCertificateParameters from ._models import UpdateGatewaySettingsParameters from ._models import Usage from ._models import UsagesListResult + from ._models import ValidationErrorInfo from ._models import VersionsCapability from ._models import VersionSpec from ._models import VirtualNetworkProfile @@ -200,16 +222,22 @@ ) __all__ = [ + 'AaddsResourceDetails', 'Application', 'ApplicationGetEndpoint', 'ApplicationGetHttpsEndpoint', 'ApplicationProperties', + 'AsyncOperationResult', 'Autoscale', 'AutoscaleCapacity', 'AutoscaleConfigurationUpdateParameter', 'AutoscaleRecurrence', 'AutoscaleSchedule', 'AutoscaleTimeAndCapacity', + 'AzureMonitorRequest', + 'AzureMonitorResponse', + 'AzureMonitorSelectedConfigurations', + 'AzureMonitorTableConfiguration', 'BillingMeters', 'BillingResources', 'BillingResponseListResult', @@ -219,6 +247,8 @@ 'ClusterConfigurations', 'ClusterCreateParametersExtended', 'ClusterCreateProperties', + 'ClusterCreateRequestValidationParameters', + 'ClusterCreateValidationResult', 'ClusterDefinition', 'ClusterDiskEncryptionParameters', 'ClusterGetProperties', @@ -250,11 +280,12 @@ 'LinuxOperatingSystemProfile', 'LocalizedName', 'MetricSpecifications', + 'NameAvailabilityCheckRequestParameters', + 'NameAvailabilityCheckResult', 'NetworkProperties', 'Operation', 'OperationDisplay', 'OperationProperties', - 'OperationResource', 'OsProfile', 'ProxyResource', 'QuotaCapability', @@ -275,9 +306,11 @@ 'StorageAccount', 'StorageProfile', 'TrackedResource', + 'UpdateClusterIdentityCertificateParameters', 'UpdateGatewaySettingsParameters', 'Usage', 'UsagesListResult', + 'ValidationErrorInfo', 'VersionsCapability', 'VersionSpec', 'VirtualNetworkProfile', diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py index 092d178c2557..00d7cec32a67 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models.py @@ -13,6 +13,49 @@ from msrest.exceptions import HttpOperationError +class AaddsResourceDetails(Model): + """The Azure active directory domain service resource details. + + :param domain_name: The Azure active directory domain service name. + :type domain_name: str + :param initial_sync_complete: This indicates whether initial sync complete + or not. + :type initial_sync_complete: bool + :param ldaps_enabled: This indicates whether enable ldaps or not. + :type ldaps_enabled: bool + :param ldaps_public_certificate_in_base64: The base 64 format string of + public ldap certificate. + :type ldaps_public_certificate_in_base64: str + :param resource_id: The resource id of azure active directory domain + service. + :type resource_id: str + :param subnet_id: The subnet resource id. + :type subnet_id: str + :param tenant_id: The tenant id of azure active directory domain service . + :type tenant_id: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'initial_sync_complete': {'key': 'initialSyncComplete', 'type': 'bool'}, + 'ldaps_enabled': {'key': 'ldapsEnabled', 'type': 'bool'}, + 'ldaps_public_certificate_in_base64': {'key': 'ldapsPublicCertificateInBase64', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AaddsResourceDetails, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.initial_sync_complete = kwargs.get('initial_sync_complete', None) + self.ldaps_enabled = kwargs.get('ldaps_enabled', None) + self.ldaps_public_certificate_in_base64 = kwargs.get('ldaps_public_certificate_in_base64', None) + self.resource_id = kwargs.get('resource_id', None) + self.subnet_id = kwargs.get('subnet_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + + class Resource(Model): """The core properties of ARM resources. @@ -150,14 +193,19 @@ def __init__(self, **kwargs): class ApplicationGetHttpsEndpoint(Model): """Gets the application HTTP endpoints. + Variables are only populated by the server, and will be ignored when + sending a request. + :param access_modes: The list of access modes for the application. :type access_modes: list[str] - :param location: The location of the endpoint. - :type location: str + :ivar location: The location of the endpoint. + :vartype location: str :param destination_port: The destination port to connect to. :type destination_port: int - :param public_port: The public port to connect to. - :type public_port: int + :ivar public_port: The public port to connect to. + :vartype public_port: int + :param private_ip_address: The private ip address of the endpoint. + :type private_ip_address: str :param sub_domain_suffix: The subdomain suffix of the application. :type sub_domain_suffix: str :param disable_gateway_auth: The value indicates whether to disable @@ -165,11 +213,17 @@ class ApplicationGetHttpsEndpoint(Model): :type disable_gateway_auth: bool """ + _validation = { + 'location': {'readonly': True}, + 'public_port': {'readonly': True}, + } + _attribute_map = { 'access_modes': {'key': 'accessModes', 'type': '[str]'}, 'location': {'key': 'location', 'type': 'str'}, 'destination_port': {'key': 'destinationPort', 'type': 'int'}, 'public_port': {'key': 'publicPort', 'type': 'int'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, 'sub_domain_suffix': {'key': 'subDomainSuffix', 'type': 'str'}, 'disable_gateway_auth': {'key': 'disableGatewayAuth', 'type': 'bool'}, } @@ -177,9 +231,10 @@ class ApplicationGetHttpsEndpoint(Model): def __init__(self, **kwargs): super(ApplicationGetHttpsEndpoint, self).__init__(**kwargs) self.access_modes = kwargs.get('access_modes', None) - self.location = kwargs.get('location', None) + self.location = None self.destination_port = kwargs.get('destination_port', None) - self.public_port = kwargs.get('public_port', None) + self.public_port = None + self.private_ip_address = kwargs.get('private_ip_address', None) self.sub_domain_suffix = kwargs.get('sub_domain_suffix', None) self.disable_gateway_auth = kwargs.get('disable_gateway_auth', None) @@ -254,6 +309,27 @@ def __init__(self, **kwargs): self.marketplace_identifier = None +class AsyncOperationResult(Model): + """The azure async operation response. + + :param status: The async operation state. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or ~azure.mgmt.hdinsight.models.AsyncOperationState + :param error: The operation error information. + :type error: ~azure.mgmt.hdinsight.models.Errors + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'AsyncOperationState'}, + 'error': {'key': 'error', 'type': 'Errors'}, + } + + def __init__(self, **kwargs): + super(AsyncOperationResult, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.error = kwargs.get('error', None) + + class Autoscale(Model): """The autoscale request parameters. @@ -377,6 +453,100 @@ def __init__(self, **kwargs): self.max_instance_count = kwargs.get('max_instance_count', None) +class AzureMonitorRequest(Model): + """The azure monitor parameters. + + :param workspace_id: The Log Analytics workspace ID. + :type workspace_id: str + :param primary_key: The Log Analytics workspace key. + :type primary_key: str + :param selected_configurations: The selected configurations. + :type selected_configurations: + ~azure.mgmt.hdinsight.models.AzureMonitorSelectedConfigurations + """ + + _attribute_map = { + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'selected_configurations': {'key': 'selectedConfigurations', 'type': 'AzureMonitorSelectedConfigurations'}, + } + + def __init__(self, **kwargs): + super(AzureMonitorRequest, self).__init__(**kwargs) + self.workspace_id = kwargs.get('workspace_id', None) + self.primary_key = kwargs.get('primary_key', None) + self.selected_configurations = kwargs.get('selected_configurations', None) + + +class AzureMonitorResponse(Model): + """The azure monitor status response. + + :param cluster_monitoring_enabled: The status of the monitor on the + HDInsight cluster. + :type cluster_monitoring_enabled: bool + :param workspace_id: The workspace ID of the monitor on the HDInsight + cluster. + :type workspace_id: str + :param selected_configurations: The selected configurations. + :type selected_configurations: + ~azure.mgmt.hdinsight.models.AzureMonitorSelectedConfigurations + """ + + _attribute_map = { + 'cluster_monitoring_enabled': {'key': 'clusterMonitoringEnabled', 'type': 'bool'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'selected_configurations': {'key': 'selectedConfigurations', 'type': 'AzureMonitorSelectedConfigurations'}, + } + + def __init__(self, **kwargs): + super(AzureMonitorResponse, self).__init__(**kwargs) + self.cluster_monitoring_enabled = kwargs.get('cluster_monitoring_enabled', None) + self.workspace_id = kwargs.get('workspace_id', None) + self.selected_configurations = kwargs.get('selected_configurations', None) + + +class AzureMonitorSelectedConfigurations(Model): + """The selected configurations for azure monitor. + + :param configuration_version: The configuration version. + :type configuration_version: str + :param global_configurations: The global configurations of selected + configurations. + :type global_configurations: dict[str, str] + :param table_list: The table list. + :type table_list: + list[~azure.mgmt.hdinsight.models.AzureMonitorTableConfiguration] + """ + + _attribute_map = { + 'configuration_version': {'key': 'configurationVersion', 'type': 'str'}, + 'global_configurations': {'key': 'globalConfigurations', 'type': '{str}'}, + 'table_list': {'key': 'tableList', 'type': '[AzureMonitorTableConfiguration]'}, + } + + def __init__(self, **kwargs): + super(AzureMonitorSelectedConfigurations, self).__init__(**kwargs) + self.configuration_version = kwargs.get('configuration_version', None) + self.global_configurations = kwargs.get('global_configurations', None) + self.table_list = kwargs.get('table_list', None) + + +class AzureMonitorTableConfiguration(Model): + """The table configuration for the Log Analytics integration. + + :param name: The name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureMonitorTableConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + class BillingMeters(Model): """The billing meters. @@ -480,10 +650,10 @@ class CapabilitiesResult(Model): :type versions: dict[str, ~azure.mgmt.hdinsight.models.VersionsCapability] :param regions: The virtual machine size compatibility features. :type regions: dict[str, ~azure.mgmt.hdinsight.models.RegionsCapability] - :param vm_sizes: The virtual machine sizes. - :type vm_sizes: dict[str, ~azure.mgmt.hdinsight.models.VmSizesCapability] - :param vm_size_filters: The virtual machine size compatibility filters. - :type vm_size_filters: + :param vmsizes: The virtual machine sizes. + :type vmsizes: dict[str, ~azure.mgmt.hdinsight.models.VmSizesCapability] + :param vmsize_filters: The virtual machine size compatibility filters. + :type vmsize_filters: list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilter] :param features: The capability features. :type features: list[str] @@ -494,8 +664,8 @@ class CapabilitiesResult(Model): _attribute_map = { 'versions': {'key': 'versions', 'type': '{VersionsCapability}'}, 'regions': {'key': 'regions', 'type': '{RegionsCapability}'}, - 'vm_sizes': {'key': 'vmSizes', 'type': '{VmSizesCapability}'}, - 'vm_size_filters': {'key': 'vmSize_filters', 'type': '[VmSizeCompatibilityFilter]'}, + 'vmsizes': {'key': 'vmsizes', 'type': '{VmSizesCapability}'}, + 'vmsize_filters': {'key': 'vmsize_filters', 'type': '[VmSizeCompatibilityFilter]'}, 'features': {'key': 'features', 'type': '[str]'}, 'quota': {'key': 'quota', 'type': 'QuotaCapability'}, } @@ -504,8 +674,8 @@ def __init__(self, **kwargs): super(CapabilitiesResult, self).__init__(**kwargs) self.versions = kwargs.get('versions', None) self.regions = kwargs.get('regions', None) - self.vm_sizes = kwargs.get('vm_sizes', None) - self.vm_size_filters = kwargs.get('vm_size_filters', None) + self.vmsizes = kwargs.get('vmsizes', None) + self.vmsize_filters = kwargs.get('vmsize_filters', None) self.features = kwargs.get('features', None) self.quota = kwargs.get('quota', None) @@ -678,7 +848,7 @@ class ClusterCreateProperties(Model): 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.hdinsight.models.OSType :param tier: The cluster tier. Possible values include: 'Standard', - 'Premium' + 'Premium'. Default value: "Standard" . :type tier: str or ~azure.mgmt.hdinsight.models.Tier :param cluster_definition: The cluster definition. :type cluster_definition: ~azure.mgmt.hdinsight.models.ClusterDefinition @@ -727,7 +897,7 @@ def __init__(self, **kwargs): super(ClusterCreateProperties, self).__init__(**kwargs) self.cluster_version = kwargs.get('cluster_version', None) self.os_type = kwargs.get('os_type', None) - self.tier = kwargs.get('tier', None) + self.tier = kwargs.get('tier', "Standard") self.cluster_definition = kwargs.get('cluster_definition', None) self.kafka_rest_properties = kwargs.get('kafka_rest_properties', None) self.security_profile = kwargs.get('security_profile', None) @@ -740,6 +910,79 @@ def __init__(self, **kwargs): self.compute_isolation_properties = kwargs.get('compute_isolation_properties', None) +class ClusterCreateRequestValidationParameters(ClusterCreateParametersExtended): + """The cluster create request specification. + + :param location: The location of the cluster. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param properties: The cluster create parameters. + :type properties: ~azure.mgmt.hdinsight.models.ClusterCreateProperties + :param identity: The identity of the cluster, if configured. + :type identity: ~azure.mgmt.hdinsight.models.ClusterIdentity + :param name: The cluster name. + :type name: str + :param type: The resource type. + :type type: str + :param tenant_id: The tenant id. + :type tenant_id: str + :param fetch_aadds_resource: This indicates whether fetch Aadds resource + or not. + :type fetch_aadds_resource: bool + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ClusterCreateProperties'}, + 'identity': {'key': 'identity', 'type': 'ClusterIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'fetch_aadds_resource': {'key': 'fetchAaddsResource', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ClusterCreateRequestValidationParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.fetch_aadds_resource = kwargs.get('fetch_aadds_resource', None) + + +class ClusterCreateValidationResult(Model): + """The response of cluster create request validation. + + :param validation_errors: The validation errors. + :type validation_errors: + list[~azure.mgmt.hdinsight.models.ValidationErrorInfo] + :param validation_warnings: The validation warnings. + :type validation_warnings: + list[~azure.mgmt.hdinsight.models.ValidationErrorInfo] + :param estimated_creation_duration: The estimated creation duration. + :type estimated_creation_duration: timedelta + :param aadds_resources_details: The Azure active directory domain service + resource details. + :type aadds_resources_details: + list[~azure.mgmt.hdinsight.models.AaddsResourceDetails] + """ + + _attribute_map = { + 'validation_errors': {'key': 'validationErrors', 'type': '[ValidationErrorInfo]'}, + 'validation_warnings': {'key': 'validationWarnings', 'type': '[ValidationErrorInfo]'}, + 'estimated_creation_duration': {'key': 'estimatedCreationDuration', 'type': 'duration'}, + 'aadds_resources_details': {'key': 'aaddsResourcesDetails', 'type': '[AaddsResourceDetails]'}, + } + + def __init__(self, **kwargs): + super(ClusterCreateValidationResult, self).__init__(**kwargs) + self.validation_errors = kwargs.get('validation_errors', None) + self.validation_warnings = kwargs.get('validation_warnings', None) + self.estimated_creation_duration = kwargs.get('estimated_creation_duration', None) + self.aadds_resources_details = kwargs.get('aadds_resources_details', None) + + class ClusterDefinition(Model): """The cluster definition. @@ -1047,11 +1290,11 @@ def __init__(self, **kwargs): class ClusterMonitoringRequest(Model): - """The Operations Management Suite (OMS) parameters. + """The cluster monitor parameters. - :param workspace_id: The Operations Management Suite (OMS) workspace ID. + :param workspace_id: The cluster monitor workspace ID. :type workspace_id: str - :param primary_key: The Operations Management Suite (OMS) workspace key. + :param primary_key: The cluster monitor workspace key. :type primary_key: str """ @@ -1067,13 +1310,13 @@ def __init__(self, **kwargs): class ClusterMonitoringResponse(Model): - """The Operations Management Suite (OMS) status response. + """The cluster monitoring status response. - :param cluster_monitoring_enabled: The status of the Operations Management - Suite (OMS) on the HDInsight cluster. + :param cluster_monitoring_enabled: The status of the monitor on the + HDInsight cluster. :type cluster_monitoring_enabled: bool - :param workspace_id: The workspace ID of the Operations Management Suite - (OMS) on the HDInsight cluster. + :param workspace_id: The workspace ID of the monitor on the HDInsight + cluster. :type workspace_id: str """ @@ -1124,7 +1367,7 @@ class ComputeIsolationProperties(Model): """The compute isolation properties. :param enable_compute_isolation: The flag indicates whether enable compute - isolation or not. + isolation or not. Default value: False . :type enable_compute_isolation: bool :param host_sku: The host sku. :type host_sku: str @@ -1137,7 +1380,7 @@ class ComputeIsolationProperties(Model): def __init__(self, **kwargs): super(ComputeIsolationProperties, self).__init__(**kwargs) - self.enable_compute_isolation = kwargs.get('enable_compute_isolation', None) + self.enable_compute_isolation = kwargs.get('enable_compute_isolation', False) self.host_sku = kwargs.get('host_sku', None) @@ -1537,15 +1780,20 @@ class KafkaRestProperties(Model): :param client_group_info: The information of AAD security group. :type client_group_info: ~azure.mgmt.hdinsight.models.ClientGroupInfo + :param configuration_override: The configurations that need to be + overriden. + :type configuration_override: dict[str, str] """ _attribute_map = { 'client_group_info': {'key': 'clientGroupInfo', 'type': 'ClientGroupInfo'}, + 'configuration_override': {'key': 'configurationOverride', 'type': '{str}'}, } def __init__(self, **kwargs): super(KafkaRestProperties, self).__init__(**kwargs) self.client_group_info = kwargs.get('client_group_info', None) + self.configuration_override = kwargs.get('configuration_override', None) class LinuxOperatingSystemProfile(Model): @@ -1680,6 +1928,58 @@ def __init__(self, **kwargs): self.dimensions = kwargs.get('dimensions', None) +class NameAvailabilityCheckRequestParameters(Model): + """The request spec of checking name availability. + + :param name: The resource name. + :type name: str + :param type: The resource type + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailabilityCheckRequestParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class NameAvailabilityCheckResult(Model): + """The response spec of checking name availability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name_available: This indicates whether the name is available. + :type name_available: bool + :ivar reason: The reason of the result. + :vartype reason: str + :ivar message: The related message. + :vartype message: str + """ + + _validation = { + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailabilityCheckResult, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = None + self.message = None + + class NetworkProperties(Model): """The network properties. @@ -1773,27 +2073,6 @@ def __init__(self, **kwargs): self.service_specification = kwargs.get('service_specification', None) -class OperationResource(Model): - """The azure async operation response. - - :param status: The async operation state. Possible values include: - 'InProgress', 'Succeeded', 'Failed' - :type status: str or ~azure.mgmt.hdinsight.models.AsyncOperationState - :param error: The operation error information. - :type error: ~azure.mgmt.hdinsight.models.Errors - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'AsyncOperationState'}, - 'error': {'key': 'error', 'type': 'Errors'}, - } - - def __init__(self, **kwargs): - super(OperationResource, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.error = kwargs.get('error', None) - - class OsProfile(Model): """The Linux operation systems profile. @@ -1902,6 +2181,8 @@ class Role(Model): :type min_instance_count: int :param target_instance_count: The instance count of the cluster. :type target_instance_count: int + :param vm_group_name: The name of the virtual machine group. + :type vm_group_name: str :param autoscale_configuration: The autoscale configurations. :type autoscale_configuration: ~azure.mgmt.hdinsight.models.Autoscale :param hardware_profile: The hardware profile. @@ -1917,6 +2198,7 @@ class Role(Model): :param script_actions: The list of script actions on the role. :type script_actions: list[~azure.mgmt.hdinsight.models.ScriptAction] :param encrypt_data_disks: Indicates whether encrypt the data disks. + Default value: False . :type encrypt_data_disks: bool """ @@ -1924,6 +2206,7 @@ class Role(Model): 'name': {'key': 'name', 'type': 'str'}, 'min_instance_count': {'key': 'minInstanceCount', 'type': 'int'}, 'target_instance_count': {'key': 'targetInstanceCount', 'type': 'int'}, + 'vm_group_name': {'key': 'VMGroupName', 'type': 'str'}, 'autoscale_configuration': {'key': 'autoscale', 'type': 'Autoscale'}, 'hardware_profile': {'key': 'hardwareProfile', 'type': 'HardwareProfile'}, 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, @@ -1938,13 +2221,14 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) self.min_instance_count = kwargs.get('min_instance_count', None) self.target_instance_count = kwargs.get('target_instance_count', None) + self.vm_group_name = kwargs.get('vm_group_name', None) self.autoscale_configuration = kwargs.get('autoscale_configuration', None) self.hardware_profile = kwargs.get('hardware_profile', None) self.os_profile = kwargs.get('os_profile', None) self.virtual_network_profile = kwargs.get('virtual_network_profile', None) self.data_disks_groups = kwargs.get('data_disks_groups', None) self.script_actions = kwargs.get('script_actions', None) - self.encrypt_data_disks = kwargs.get('encrypt_data_disks', None) + self.encrypt_data_disks = kwargs.get('encrypt_data_disks', False) class RuntimeScriptAction(Model): @@ -2287,6 +2571,10 @@ class StorageAccount(Model): access the storage account, only to be specified for Azure Data Lake Storage Gen 2. :type msi_resource_id: str + :param saskey: The shared access signature key. + :type saskey: str + :param fileshare: The file share name. + :type fileshare: str """ _attribute_map = { @@ -2297,6 +2585,8 @@ class StorageAccount(Model): 'key': {'key': 'key', 'type': 'str'}, 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'msi_resource_id': {'key': 'msiResourceId', 'type': 'str'}, + 'saskey': {'key': 'saskey', 'type': 'str'}, + 'fileshare': {'key': 'fileshare', 'type': 'str'}, } def __init__(self, **kwargs): @@ -2308,6 +2598,8 @@ def __init__(self, **kwargs): self.key = kwargs.get('key', None) self.resource_id = kwargs.get('resource_id', None) self.msi_resource_id = kwargs.get('msi_resource_id', None) + self.saskey = kwargs.get('saskey', None) + self.fileshare = kwargs.get('fileshare', None) class StorageProfile(Model): @@ -2326,6 +2618,30 @@ def __init__(self, **kwargs): self.storageaccounts = kwargs.get('storageaccounts', None) +class UpdateClusterIdentityCertificateParameters(Model): + """The update cluster identity certificate request parameters. + + :param application_id: The application id. + :type application_id: str + :param certificate: The certificate in base64 encoded format. + :type certificate: str + :param certificate_password: The password of the certificate. + :type certificate_password: str + """ + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, + 'certificate_password': {'key': 'certificatePassword', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateClusterIdentityCertificateParameters, self).__init__(**kwargs) + self.application_id = kwargs.get('application_id', None) + self.certificate = kwargs.get('certificate', None) + self.certificate_password = kwargs.get('certificate_password', None) + + class UpdateGatewaySettingsParameters(Model): """The update gateway settings request parameters. @@ -2357,17 +2673,17 @@ class Usage(Model): :param unit: The type of measurement for usage. :type unit: str :param current_value: The current usage. - :type current_value: int + :type current_value: long :param limit: The maximum allowed usage. - :type limit: int + :type limit: long :param name: The details about the localizable name of the used resource. :type name: ~azure.mgmt.hdinsight.models.LocalizedName """ _attribute_map = { 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, 'name': {'key': 'name', 'type': 'LocalizedName'}, } @@ -2395,6 +2711,34 @@ def __init__(self, **kwargs): self.value = kwargs.get('value', None) +class ValidationErrorInfo(Model): + """The validation error information. + + :param code: The error code. + :type code: str + :param message: The error message. + :type message: str + :param error_resource: The error resource. + :type error_resource: str + :param message_arguments: The message arguments + :type message_arguments: list[str] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'error_resource': {'key': 'errorResource', 'type': 'str'}, + 'message_arguments': {'key': 'messageArguments', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ValidationErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.error_resource = kwargs.get('error_resource', None) + self.message_arguments = kwargs.get('message_arguments', None) + + class VersionsCapability(Model): """The version capability. @@ -2419,7 +2763,7 @@ class VersionSpec(Model): :param display_name: The display name :type display_name: str :param is_default: Whether or not the version is the default version. - :type is_default: str + :type is_default: bool :param component_versions: The component version property. :type component_versions: dict[str, str] """ @@ -2427,7 +2771,7 @@ class VersionSpec(Model): _attribute_map = { 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'component_versions': {'key': 'componentVersions', 'type': '{str}'}, } @@ -2472,8 +2816,18 @@ class VmSizeCompatibilityFilter(Model): :type node_types: list[str] :param cluster_versions: The list of cluster versions. :type cluster_versions: list[str] - :param vmsizes: The list of virtual machine sizes. - :type vmsizes: list[str] + :param os_type: The list of OS types. + :type os_type: list[str] + :param vm_sizes: The list of virtual machine sizes. + :type vm_sizes: list[str] + :param esp_applied: Whether apply for ESP cluster. 'true' means only for + ESP, 'false' means only for non-ESP, null or empty string or others mean + for both. + :type esp_applied: str + :param compute_isolation_supported: Whether support compute isolation. + 'true' means only for ComputeIsolationEnabled, 'false' means only for + regular cluster. + :type compute_isolation_supported: str """ _attribute_map = { @@ -2482,7 +2836,10 @@ class VmSizeCompatibilityFilter(Model): 'cluster_flavors': {'key': 'ClusterFlavors', 'type': '[str]'}, 'node_types': {'key': 'NodeTypes', 'type': '[str]'}, 'cluster_versions': {'key': 'ClusterVersions', 'type': '[str]'}, - 'vmsizes': {'key': 'vmsizes', 'type': '[str]'}, + 'os_type': {'key': 'OsType', 'type': '[str]'}, + 'vm_sizes': {'key': 'VMSizes', 'type': '[str]'}, + 'esp_applied': {'key': 'ESPApplied', 'type': 'str'}, + 'compute_isolation_supported': {'key': 'ComputeIsolationSupported', 'type': 'str'}, } def __init__(self, **kwargs): @@ -2492,7 +2849,10 @@ def __init__(self, **kwargs): self.cluster_flavors = kwargs.get('cluster_flavors', None) self.node_types = kwargs.get('node_types', None) self.cluster_versions = kwargs.get('cluster_versions', None) - self.vmsizes = kwargs.get('vmsizes', None) + self.os_type = kwargs.get('os_type', None) + self.vm_sizes = kwargs.get('vm_sizes', None) + self.esp_applied = kwargs.get('esp_applied', None) + self.compute_isolation_supported = kwargs.get('compute_isolation_supported', None) class VmSizeCompatibilityFilterV2(Model): diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py index 8f3c2c723aab..3153a3fc4711 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/_models_py3.py @@ -13,6 +13,49 @@ from msrest.exceptions import HttpOperationError +class AaddsResourceDetails(Model): + """The Azure active directory domain service resource details. + + :param domain_name: The Azure active directory domain service name. + :type domain_name: str + :param initial_sync_complete: This indicates whether initial sync complete + or not. + :type initial_sync_complete: bool + :param ldaps_enabled: This indicates whether enable ldaps or not. + :type ldaps_enabled: bool + :param ldaps_public_certificate_in_base64: The base 64 format string of + public ldap certificate. + :type ldaps_public_certificate_in_base64: str + :param resource_id: The resource id of azure active directory domain + service. + :type resource_id: str + :param subnet_id: The subnet resource id. + :type subnet_id: str + :param tenant_id: The tenant id of azure active directory domain service . + :type tenant_id: str + """ + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'initial_sync_complete': {'key': 'initialSyncComplete', 'type': 'bool'}, + 'ldaps_enabled': {'key': 'ldapsEnabled', 'type': 'bool'}, + 'ldaps_public_certificate_in_base64': {'key': 'ldapsPublicCertificateInBase64', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'subnet_id': {'key': 'subnetId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, domain_name: str=None, initial_sync_complete: bool=None, ldaps_enabled: bool=None, ldaps_public_certificate_in_base64: str=None, resource_id: str=None, subnet_id: str=None, tenant_id: str=None, **kwargs) -> None: + super(AaddsResourceDetails, self).__init__(**kwargs) + self.domain_name = domain_name + self.initial_sync_complete = initial_sync_complete + self.ldaps_enabled = ldaps_enabled + self.ldaps_public_certificate_in_base64 = ldaps_public_certificate_in_base64 + self.resource_id = resource_id + self.subnet_id = subnet_id + self.tenant_id = tenant_id + + class Resource(Model): """The core properties of ARM resources. @@ -150,14 +193,19 @@ def __init__(self, *, location: str=None, destination_port: int=None, public_por class ApplicationGetHttpsEndpoint(Model): """Gets the application HTTP endpoints. + Variables are only populated by the server, and will be ignored when + sending a request. + :param access_modes: The list of access modes for the application. :type access_modes: list[str] - :param location: The location of the endpoint. - :type location: str + :ivar location: The location of the endpoint. + :vartype location: str :param destination_port: The destination port to connect to. :type destination_port: int - :param public_port: The public port to connect to. - :type public_port: int + :ivar public_port: The public port to connect to. + :vartype public_port: int + :param private_ip_address: The private ip address of the endpoint. + :type private_ip_address: str :param sub_domain_suffix: The subdomain suffix of the application. :type sub_domain_suffix: str :param disable_gateway_auth: The value indicates whether to disable @@ -165,21 +213,28 @@ class ApplicationGetHttpsEndpoint(Model): :type disable_gateway_auth: bool """ + _validation = { + 'location': {'readonly': True}, + 'public_port': {'readonly': True}, + } + _attribute_map = { 'access_modes': {'key': 'accessModes', 'type': '[str]'}, 'location': {'key': 'location', 'type': 'str'}, 'destination_port': {'key': 'destinationPort', 'type': 'int'}, 'public_port': {'key': 'publicPort', 'type': 'int'}, + 'private_ip_address': {'key': 'privateIPAddress', 'type': 'str'}, 'sub_domain_suffix': {'key': 'subDomainSuffix', 'type': 'str'}, 'disable_gateway_auth': {'key': 'disableGatewayAuth', 'type': 'bool'}, } - def __init__(self, *, access_modes=None, location: str=None, destination_port: int=None, public_port: int=None, sub_domain_suffix: str=None, disable_gateway_auth: bool=None, **kwargs) -> None: + def __init__(self, *, access_modes=None, destination_port: int=None, private_ip_address: str=None, sub_domain_suffix: str=None, disable_gateway_auth: bool=None, **kwargs) -> None: super(ApplicationGetHttpsEndpoint, self).__init__(**kwargs) self.access_modes = access_modes - self.location = location + self.location = None self.destination_port = destination_port - self.public_port = public_port + self.public_port = None + self.private_ip_address = private_ip_address self.sub_domain_suffix = sub_domain_suffix self.disable_gateway_auth = disable_gateway_auth @@ -254,6 +309,27 @@ def __init__(self, *, compute_profile=None, install_script_actions=None, uninsta self.marketplace_identifier = None +class AsyncOperationResult(Model): + """The azure async operation response. + + :param status: The async operation state. Possible values include: + 'InProgress', 'Succeeded', 'Failed' + :type status: str or ~azure.mgmt.hdinsight.models.AsyncOperationState + :param error: The operation error information. + :type error: ~azure.mgmt.hdinsight.models.Errors + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'AsyncOperationState'}, + 'error': {'key': 'error', 'type': 'Errors'}, + } + + def __init__(self, *, status=None, error=None, **kwargs) -> None: + super(AsyncOperationResult, self).__init__(**kwargs) + self.status = status + self.error = error + + class Autoscale(Model): """The autoscale request parameters. @@ -377,6 +453,100 @@ def __init__(self, *, time: str=None, min_instance_count: int=None, max_instance self.max_instance_count = max_instance_count +class AzureMonitorRequest(Model): + """The azure monitor parameters. + + :param workspace_id: The Log Analytics workspace ID. + :type workspace_id: str + :param primary_key: The Log Analytics workspace key. + :type primary_key: str + :param selected_configurations: The selected configurations. + :type selected_configurations: + ~azure.mgmt.hdinsight.models.AzureMonitorSelectedConfigurations + """ + + _attribute_map = { + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'selected_configurations': {'key': 'selectedConfigurations', 'type': 'AzureMonitorSelectedConfigurations'}, + } + + def __init__(self, *, workspace_id: str=None, primary_key: str=None, selected_configurations=None, **kwargs) -> None: + super(AzureMonitorRequest, self).__init__(**kwargs) + self.workspace_id = workspace_id + self.primary_key = primary_key + self.selected_configurations = selected_configurations + + +class AzureMonitorResponse(Model): + """The azure monitor status response. + + :param cluster_monitoring_enabled: The status of the monitor on the + HDInsight cluster. + :type cluster_monitoring_enabled: bool + :param workspace_id: The workspace ID of the monitor on the HDInsight + cluster. + :type workspace_id: str + :param selected_configurations: The selected configurations. + :type selected_configurations: + ~azure.mgmt.hdinsight.models.AzureMonitorSelectedConfigurations + """ + + _attribute_map = { + 'cluster_monitoring_enabled': {'key': 'clusterMonitoringEnabled', 'type': 'bool'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, + 'selected_configurations': {'key': 'selectedConfigurations', 'type': 'AzureMonitorSelectedConfigurations'}, + } + + def __init__(self, *, cluster_monitoring_enabled: bool=None, workspace_id: str=None, selected_configurations=None, **kwargs) -> None: + super(AzureMonitorResponse, self).__init__(**kwargs) + self.cluster_monitoring_enabled = cluster_monitoring_enabled + self.workspace_id = workspace_id + self.selected_configurations = selected_configurations + + +class AzureMonitorSelectedConfigurations(Model): + """The selected configurations for azure monitor. + + :param configuration_version: The configuration version. + :type configuration_version: str + :param global_configurations: The global configurations of selected + configurations. + :type global_configurations: dict[str, str] + :param table_list: The table list. + :type table_list: + list[~azure.mgmt.hdinsight.models.AzureMonitorTableConfiguration] + """ + + _attribute_map = { + 'configuration_version': {'key': 'configurationVersion', 'type': 'str'}, + 'global_configurations': {'key': 'globalConfigurations', 'type': '{str}'}, + 'table_list': {'key': 'tableList', 'type': '[AzureMonitorTableConfiguration]'}, + } + + def __init__(self, *, configuration_version: str=None, global_configurations=None, table_list=None, **kwargs) -> None: + super(AzureMonitorSelectedConfigurations, self).__init__(**kwargs) + self.configuration_version = configuration_version + self.global_configurations = global_configurations + self.table_list = table_list + + +class AzureMonitorTableConfiguration(Model): + """The table configuration for the Log Analytics integration. + + :param name: The name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(AzureMonitorTableConfiguration, self).__init__(**kwargs) + self.name = name + + class BillingMeters(Model): """The billing meters. @@ -480,10 +650,10 @@ class CapabilitiesResult(Model): :type versions: dict[str, ~azure.mgmt.hdinsight.models.VersionsCapability] :param regions: The virtual machine size compatibility features. :type regions: dict[str, ~azure.mgmt.hdinsight.models.RegionsCapability] - :param vm_sizes: The virtual machine sizes. - :type vm_sizes: dict[str, ~azure.mgmt.hdinsight.models.VmSizesCapability] - :param vm_size_filters: The virtual machine size compatibility filters. - :type vm_size_filters: + :param vmsizes: The virtual machine sizes. + :type vmsizes: dict[str, ~azure.mgmt.hdinsight.models.VmSizesCapability] + :param vmsize_filters: The virtual machine size compatibility filters. + :type vmsize_filters: list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilter] :param features: The capability features. :type features: list[str] @@ -494,18 +664,18 @@ class CapabilitiesResult(Model): _attribute_map = { 'versions': {'key': 'versions', 'type': '{VersionsCapability}'}, 'regions': {'key': 'regions', 'type': '{RegionsCapability}'}, - 'vm_sizes': {'key': 'vmSizes', 'type': '{VmSizesCapability}'}, - 'vm_size_filters': {'key': 'vmSize_filters', 'type': '[VmSizeCompatibilityFilter]'}, + 'vmsizes': {'key': 'vmsizes', 'type': '{VmSizesCapability}'}, + 'vmsize_filters': {'key': 'vmsize_filters', 'type': '[VmSizeCompatibilityFilter]'}, 'features': {'key': 'features', 'type': '[str]'}, 'quota': {'key': 'quota', 'type': 'QuotaCapability'}, } - def __init__(self, *, versions=None, regions=None, vm_sizes=None, vm_size_filters=None, features=None, quota=None, **kwargs) -> None: + def __init__(self, *, versions=None, regions=None, vmsizes=None, vmsize_filters=None, features=None, quota=None, **kwargs) -> None: super(CapabilitiesResult, self).__init__(**kwargs) self.versions = versions self.regions = regions - self.vm_sizes = vm_sizes - self.vm_size_filters = vm_size_filters + self.vmsizes = vmsizes + self.vmsize_filters = vmsize_filters self.features = features self.quota = quota @@ -678,7 +848,7 @@ class ClusterCreateProperties(Model): 'Windows', 'Linux' :type os_type: str or ~azure.mgmt.hdinsight.models.OSType :param tier: The cluster tier. Possible values include: 'Standard', - 'Premium' + 'Premium'. Default value: "Standard" . :type tier: str or ~azure.mgmt.hdinsight.models.Tier :param cluster_definition: The cluster definition. :type cluster_definition: ~azure.mgmt.hdinsight.models.ClusterDefinition @@ -723,7 +893,7 @@ class ClusterCreateProperties(Model): 'compute_isolation_properties': {'key': 'computeIsolationProperties', 'type': 'ComputeIsolationProperties'}, } - def __init__(self, *, cluster_version: str=None, os_type=None, tier=None, cluster_definition=None, kafka_rest_properties=None, security_profile=None, compute_profile=None, storage_profile=None, disk_encryption_properties=None, encryption_in_transit_properties=None, min_supported_tls_version: str=None, network_properties=None, compute_isolation_properties=None, **kwargs) -> None: + def __init__(self, *, cluster_version: str=None, os_type=None, tier="Standard", cluster_definition=None, kafka_rest_properties=None, security_profile=None, compute_profile=None, storage_profile=None, disk_encryption_properties=None, encryption_in_transit_properties=None, min_supported_tls_version: str=None, network_properties=None, compute_isolation_properties=None, **kwargs) -> None: super(ClusterCreateProperties, self).__init__(**kwargs) self.cluster_version = cluster_version self.os_type = os_type @@ -740,6 +910,79 @@ def __init__(self, *, cluster_version: str=None, os_type=None, tier=None, cluste self.compute_isolation_properties = compute_isolation_properties +class ClusterCreateRequestValidationParameters(ClusterCreateParametersExtended): + """The cluster create request specification. + + :param location: The location of the cluster. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + :param properties: The cluster create parameters. + :type properties: ~azure.mgmt.hdinsight.models.ClusterCreateProperties + :param identity: The identity of the cluster, if configured. + :type identity: ~azure.mgmt.hdinsight.models.ClusterIdentity + :param name: The cluster name. + :type name: str + :param type: The resource type. + :type type: str + :param tenant_id: The tenant id. + :type tenant_id: str + :param fetch_aadds_resource: This indicates whether fetch Aadds resource + or not. + :type fetch_aadds_resource: bool + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ClusterCreateProperties'}, + 'identity': {'key': 'identity', 'type': 'ClusterIdentity'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'fetch_aadds_resource': {'key': 'fetchAaddsResource', 'type': 'bool'}, + } + + def __init__(self, *, location: str=None, tags=None, properties=None, identity=None, name: str=None, type: str=None, tenant_id: str=None, fetch_aadds_resource: bool=None, **kwargs) -> None: + super(ClusterCreateRequestValidationParameters, self).__init__(location=location, tags=tags, properties=properties, identity=identity, **kwargs) + self.name = name + self.type = type + self.tenant_id = tenant_id + self.fetch_aadds_resource = fetch_aadds_resource + + +class ClusterCreateValidationResult(Model): + """The response of cluster create request validation. + + :param validation_errors: The validation errors. + :type validation_errors: + list[~azure.mgmt.hdinsight.models.ValidationErrorInfo] + :param validation_warnings: The validation warnings. + :type validation_warnings: + list[~azure.mgmt.hdinsight.models.ValidationErrorInfo] + :param estimated_creation_duration: The estimated creation duration. + :type estimated_creation_duration: timedelta + :param aadds_resources_details: The Azure active directory domain service + resource details. + :type aadds_resources_details: + list[~azure.mgmt.hdinsight.models.AaddsResourceDetails] + """ + + _attribute_map = { + 'validation_errors': {'key': 'validationErrors', 'type': '[ValidationErrorInfo]'}, + 'validation_warnings': {'key': 'validationWarnings', 'type': '[ValidationErrorInfo]'}, + 'estimated_creation_duration': {'key': 'estimatedCreationDuration', 'type': 'duration'}, + 'aadds_resources_details': {'key': 'aaddsResourcesDetails', 'type': '[AaddsResourceDetails]'}, + } + + def __init__(self, *, validation_errors=None, validation_warnings=None, estimated_creation_duration=None, aadds_resources_details=None, **kwargs) -> None: + super(ClusterCreateValidationResult, self).__init__(**kwargs) + self.validation_errors = validation_errors + self.validation_warnings = validation_warnings + self.estimated_creation_duration = estimated_creation_duration + self.aadds_resources_details = aadds_resources_details + + class ClusterDefinition(Model): """The cluster definition. @@ -1047,11 +1290,11 @@ def __init__(self, **kwargs) -> None: class ClusterMonitoringRequest(Model): - """The Operations Management Suite (OMS) parameters. + """The cluster monitor parameters. - :param workspace_id: The Operations Management Suite (OMS) workspace ID. + :param workspace_id: The cluster monitor workspace ID. :type workspace_id: str - :param primary_key: The Operations Management Suite (OMS) workspace key. + :param primary_key: The cluster monitor workspace key. :type primary_key: str """ @@ -1067,13 +1310,13 @@ def __init__(self, *, workspace_id: str=None, primary_key: str=None, **kwargs) - class ClusterMonitoringResponse(Model): - """The Operations Management Suite (OMS) status response. + """The cluster monitoring status response. - :param cluster_monitoring_enabled: The status of the Operations Management - Suite (OMS) on the HDInsight cluster. + :param cluster_monitoring_enabled: The status of the monitor on the + HDInsight cluster. :type cluster_monitoring_enabled: bool - :param workspace_id: The workspace ID of the Operations Management Suite - (OMS) on the HDInsight cluster. + :param workspace_id: The workspace ID of the monitor on the HDInsight + cluster. :type workspace_id: str """ @@ -1124,7 +1367,7 @@ class ComputeIsolationProperties(Model): """The compute isolation properties. :param enable_compute_isolation: The flag indicates whether enable compute - isolation or not. + isolation or not. Default value: False . :type enable_compute_isolation: bool :param host_sku: The host sku. :type host_sku: str @@ -1135,7 +1378,7 @@ class ComputeIsolationProperties(Model): 'host_sku': {'key': 'hostSku', 'type': 'str'}, } - def __init__(self, *, enable_compute_isolation: bool=None, host_sku: str=None, **kwargs) -> None: + def __init__(self, *, enable_compute_isolation: bool=False, host_sku: str=None, **kwargs) -> None: super(ComputeIsolationProperties, self).__init__(**kwargs) self.enable_compute_isolation = enable_compute_isolation self.host_sku = host_sku @@ -1537,15 +1780,20 @@ class KafkaRestProperties(Model): :param client_group_info: The information of AAD security group. :type client_group_info: ~azure.mgmt.hdinsight.models.ClientGroupInfo + :param configuration_override: The configurations that need to be + overriden. + :type configuration_override: dict[str, str] """ _attribute_map = { 'client_group_info': {'key': 'clientGroupInfo', 'type': 'ClientGroupInfo'}, + 'configuration_override': {'key': 'configurationOverride', 'type': '{str}'}, } - def __init__(self, *, client_group_info=None, **kwargs) -> None: + def __init__(self, *, client_group_info=None, configuration_override=None, **kwargs) -> None: super(KafkaRestProperties, self).__init__(**kwargs) self.client_group_info = client_group_info + self.configuration_override = configuration_override class LinuxOperatingSystemProfile(Model): @@ -1680,6 +1928,58 @@ def __init__(self, *, name: str=None, display_name: str=None, display_descriptio self.dimensions = dimensions +class NameAvailabilityCheckRequestParameters(Model): + """The request spec of checking name availability. + + :param name: The resource name. + :type name: str + :param type: The resource type + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(NameAvailabilityCheckRequestParameters, self).__init__(**kwargs) + self.name = name + self.type = type + + +class NameAvailabilityCheckResult(Model): + """The response spec of checking name availability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param name_available: This indicates whether the name is available. + :type name_available: bool + :ivar reason: The reason of the result. + :vartype reason: str + :ivar message: The related message. + :vartype message: str + """ + + _validation = { + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, **kwargs) -> None: + super(NameAvailabilityCheckResult, self).__init__(**kwargs) + self.name_available = name_available + self.reason = None + self.message = None + + class NetworkProperties(Model): """The network properties. @@ -1773,27 +2073,6 @@ def __init__(self, *, service_specification=None, **kwargs) -> None: self.service_specification = service_specification -class OperationResource(Model): - """The azure async operation response. - - :param status: The async operation state. Possible values include: - 'InProgress', 'Succeeded', 'Failed' - :type status: str or ~azure.mgmt.hdinsight.models.AsyncOperationState - :param error: The operation error information. - :type error: ~azure.mgmt.hdinsight.models.Errors - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'AsyncOperationState'}, - 'error': {'key': 'error', 'type': 'Errors'}, - } - - def __init__(self, *, status=None, error=None, **kwargs) -> None: - super(OperationResource, self).__init__(**kwargs) - self.status = status - self.error = error - - class OsProfile(Model): """The Linux operation systems profile. @@ -1902,6 +2181,8 @@ class Role(Model): :type min_instance_count: int :param target_instance_count: The instance count of the cluster. :type target_instance_count: int + :param vm_group_name: The name of the virtual machine group. + :type vm_group_name: str :param autoscale_configuration: The autoscale configurations. :type autoscale_configuration: ~azure.mgmt.hdinsight.models.Autoscale :param hardware_profile: The hardware profile. @@ -1917,6 +2198,7 @@ class Role(Model): :param script_actions: The list of script actions on the role. :type script_actions: list[~azure.mgmt.hdinsight.models.ScriptAction] :param encrypt_data_disks: Indicates whether encrypt the data disks. + Default value: False . :type encrypt_data_disks: bool """ @@ -1924,6 +2206,7 @@ class Role(Model): 'name': {'key': 'name', 'type': 'str'}, 'min_instance_count': {'key': 'minInstanceCount', 'type': 'int'}, 'target_instance_count': {'key': 'targetInstanceCount', 'type': 'int'}, + 'vm_group_name': {'key': 'VMGroupName', 'type': 'str'}, 'autoscale_configuration': {'key': 'autoscale', 'type': 'Autoscale'}, 'hardware_profile': {'key': 'hardwareProfile', 'type': 'HardwareProfile'}, 'os_profile': {'key': 'osProfile', 'type': 'OsProfile'}, @@ -1933,11 +2216,12 @@ class Role(Model): 'encrypt_data_disks': {'key': 'encryptDataDisks', 'type': 'bool'}, } - def __init__(self, *, name: str=None, min_instance_count: int=None, target_instance_count: int=None, autoscale_configuration=None, hardware_profile=None, os_profile=None, virtual_network_profile=None, data_disks_groups=None, script_actions=None, encrypt_data_disks: bool=None, **kwargs) -> None: + def __init__(self, *, name: str=None, min_instance_count: int=None, target_instance_count: int=None, vm_group_name: str=None, autoscale_configuration=None, hardware_profile=None, os_profile=None, virtual_network_profile=None, data_disks_groups=None, script_actions=None, encrypt_data_disks: bool=False, **kwargs) -> None: super(Role, self).__init__(**kwargs) self.name = name self.min_instance_count = min_instance_count self.target_instance_count = target_instance_count + self.vm_group_name = vm_group_name self.autoscale_configuration = autoscale_configuration self.hardware_profile = hardware_profile self.os_profile = os_profile @@ -2287,6 +2571,10 @@ class StorageAccount(Model): access the storage account, only to be specified for Azure Data Lake Storage Gen 2. :type msi_resource_id: str + :param saskey: The shared access signature key. + :type saskey: str + :param fileshare: The file share name. + :type fileshare: str """ _attribute_map = { @@ -2297,9 +2585,11 @@ class StorageAccount(Model): 'key': {'key': 'key', 'type': 'str'}, 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'msi_resource_id': {'key': 'msiResourceId', 'type': 'str'}, + 'saskey': {'key': 'saskey', 'type': 'str'}, + 'fileshare': {'key': 'fileshare', 'type': 'str'}, } - def __init__(self, *, name: str=None, is_default: bool=None, container: str=None, file_system: str=None, key: str=None, resource_id: str=None, msi_resource_id: str=None, **kwargs) -> None: + def __init__(self, *, name: str=None, is_default: bool=None, container: str=None, file_system: str=None, key: str=None, resource_id: str=None, msi_resource_id: str=None, saskey: str=None, fileshare: str=None, **kwargs) -> None: super(StorageAccount, self).__init__(**kwargs) self.name = name self.is_default = is_default @@ -2308,6 +2598,8 @@ def __init__(self, *, name: str=None, is_default: bool=None, container: str=None self.key = key self.resource_id = resource_id self.msi_resource_id = msi_resource_id + self.saskey = saskey + self.fileshare = fileshare class StorageProfile(Model): @@ -2326,6 +2618,30 @@ def __init__(self, *, storageaccounts=None, **kwargs) -> None: self.storageaccounts = storageaccounts +class UpdateClusterIdentityCertificateParameters(Model): + """The update cluster identity certificate request parameters. + + :param application_id: The application id. + :type application_id: str + :param certificate: The certificate in base64 encoded format. + :type certificate: str + :param certificate_password: The password of the certificate. + :type certificate_password: str + """ + + _attribute_map = { + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'certificate': {'key': 'certificate', 'type': 'str'}, + 'certificate_password': {'key': 'certificatePassword', 'type': 'str'}, + } + + def __init__(self, *, application_id: str=None, certificate: str=None, certificate_password: str=None, **kwargs) -> None: + super(UpdateClusterIdentityCertificateParameters, self).__init__(**kwargs) + self.application_id = application_id + self.certificate = certificate + self.certificate_password = certificate_password + + class UpdateGatewaySettingsParameters(Model): """The update gateway settings request parameters. @@ -2357,17 +2673,17 @@ class Usage(Model): :param unit: The type of measurement for usage. :type unit: str :param current_value: The current usage. - :type current_value: int + :type current_value: long :param limit: The maximum allowed usage. - :type limit: int + :type limit: long :param name: The details about the localizable name of the used resource. :type name: ~azure.mgmt.hdinsight.models.LocalizedName """ _attribute_map = { 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'int'}, - 'limit': {'key': 'limit', 'type': 'int'}, + 'current_value': {'key': 'currentValue', 'type': 'long'}, + 'limit': {'key': 'limit', 'type': 'long'}, 'name': {'key': 'name', 'type': 'LocalizedName'}, } @@ -2395,6 +2711,34 @@ def __init__(self, *, value=None, **kwargs) -> None: self.value = value +class ValidationErrorInfo(Model): + """The validation error information. + + :param code: The error code. + :type code: str + :param message: The error message. + :type message: str + :param error_resource: The error resource. + :type error_resource: str + :param message_arguments: The message arguments + :type message_arguments: list[str] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'error_resource': {'key': 'errorResource', 'type': 'str'}, + 'message_arguments': {'key': 'messageArguments', 'type': '[str]'}, + } + + def __init__(self, *, code: str=None, message: str=None, error_resource: str=None, message_arguments=None, **kwargs) -> None: + super(ValidationErrorInfo, self).__init__(**kwargs) + self.code = code + self.message = message + self.error_resource = error_resource + self.message_arguments = message_arguments + + class VersionsCapability(Model): """The version capability. @@ -2419,7 +2763,7 @@ class VersionSpec(Model): :param display_name: The display name :type display_name: str :param is_default: Whether or not the version is the default version. - :type is_default: str + :type is_default: bool :param component_versions: The component version property. :type component_versions: dict[str, str] """ @@ -2427,11 +2771,11 @@ class VersionSpec(Model): _attribute_map = { 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'str'}, + 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'component_versions': {'key': 'componentVersions', 'type': '{str}'}, } - def __init__(self, *, friendly_name: str=None, display_name: str=None, is_default: str=None, component_versions=None, **kwargs) -> None: + def __init__(self, *, friendly_name: str=None, display_name: str=None, is_default: bool=None, component_versions=None, **kwargs) -> None: super(VersionSpec, self).__init__(**kwargs) self.friendly_name = friendly_name self.display_name = display_name @@ -2472,8 +2816,18 @@ class VmSizeCompatibilityFilter(Model): :type node_types: list[str] :param cluster_versions: The list of cluster versions. :type cluster_versions: list[str] - :param vmsizes: The list of virtual machine sizes. - :type vmsizes: list[str] + :param os_type: The list of OS types. + :type os_type: list[str] + :param vm_sizes: The list of virtual machine sizes. + :type vm_sizes: list[str] + :param esp_applied: Whether apply for ESP cluster. 'true' means only for + ESP, 'false' means only for non-ESP, null or empty string or others mean + for both. + :type esp_applied: str + :param compute_isolation_supported: Whether support compute isolation. + 'true' means only for ComputeIsolationEnabled, 'false' means only for + regular cluster. + :type compute_isolation_supported: str """ _attribute_map = { @@ -2482,17 +2836,23 @@ class VmSizeCompatibilityFilter(Model): 'cluster_flavors': {'key': 'ClusterFlavors', 'type': '[str]'}, 'node_types': {'key': 'NodeTypes', 'type': '[str]'}, 'cluster_versions': {'key': 'ClusterVersions', 'type': '[str]'}, - 'vmsizes': {'key': 'vmsizes', 'type': '[str]'}, + 'os_type': {'key': 'OsType', 'type': '[str]'}, + 'vm_sizes': {'key': 'VMSizes', 'type': '[str]'}, + 'esp_applied': {'key': 'ESPApplied', 'type': 'str'}, + 'compute_isolation_supported': {'key': 'ComputeIsolationSupported', 'type': 'str'}, } - def __init__(self, *, filter_mode: str=None, regions=None, cluster_flavors=None, node_types=None, cluster_versions=None, vmsizes=None, **kwargs) -> None: + def __init__(self, *, filter_mode: str=None, regions=None, cluster_flavors=None, node_types=None, cluster_versions=None, os_type=None, vm_sizes=None, esp_applied: str=None, compute_isolation_supported: str=None, **kwargs) -> None: super(VmSizeCompatibilityFilter, self).__init__(**kwargs) self.filter_mode = filter_mode self.regions = regions self.cluster_flavors = cluster_flavors self.node_types = node_types self.cluster_versions = cluster_versions - self.vmsizes = vmsizes + self.os_type = os_type + self.vm_sizes = vm_sizes + self.esp_applied = esp_applied + self.compute_isolation_supported = compute_isolation_supported class VmSizeCompatibilityFilterV2(Model): diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_applications_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_applications_operations.py index a05a94056341..054c0ee300c6 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_applications_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_applications_operations.py @@ -358,3 +358,69 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}'} + + def get_azure_async_operation_status( + self, resource_group_name, cluster_name, application_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param application_name: The constant value for the application name. + :type application_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AsyncOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_azure_async_operation_status.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'applicationName': self._serialize.url("application_name", application_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AsyncOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}/azureasyncoperations/{operationId}'} diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_clusters_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_clusters_operations.py index 554bffda464d..a405e9b038cf 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_clusters_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_clusters_operations.py @@ -499,7 +499,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -587,7 +587,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -738,7 +738,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -884,12 +884,161 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_gateway_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateGatewaySettings'} + def get_azure_async_operation_status( + self, resource_group_name, cluster_name, operation_id, custom_headers=None, raw=False, **operation_config): + """The the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AsyncOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_azure_async_operation_status.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AsyncOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/azureasyncoperations/{operationId}'} + + + def _update_identity_certificate_initial( + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update_identity_certificate.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'UpdateClusterIdentityCertificateParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def update_identity_certificate( + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the cluster identity certificate. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param parameters: The cluster configurations. + :type parameters: + ~azure.mgmt.hdinsight.models.UpdateClusterIdentityCertificateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_identity_certificate_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_identity_certificate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/updateClusterIdentityCertificate'} + def _execute_script_actions_initial( self, resource_group_name, cluster_name, persist_on_success, script_actions=None, custom_headers=None, raw=False, **operation_config): @@ -925,7 +1074,7 @@ def _execute_script_actions_initial( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202]: + if response.status_code not in [200, 202, 404]: raise models.ErrorResponseException(self._deserialize, response) if raw: @@ -976,7 +1125,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_configurations_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_configurations_operations.py index 77faf1d55206..e6a752276a6f 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_configurations_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_configurations_operations.py @@ -185,7 +185,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_extensions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_extensions_operations.py index 8a208fbb4140..8671ce64e3b3 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_extensions_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_extensions_operations.py @@ -90,11 +90,9 @@ def enable_monitoring( :type resource_group_name: str :param cluster_name: The name of the cluster. :type cluster_name: str - :param workspace_id: The Operations Management Suite (OMS) workspace - ID. + :param workspace_id: The cluster monitor workspace ID. :type workspace_id: str - :param primary_key: The Operations Management Suite (OMS) workspace - key. + :param primary_key: The cluster monitor workspace key. :type primary_key: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -273,6 +271,229 @@ def get_long_running_output(response): disable_monitoring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring'} + def _enable_azure_monitor_initial( + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.enable_azure_monitor.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AzureMonitorRequest') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def enable_azure_monitor( + self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Enables the Azure Monitor on the HDInsight cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param parameters: The Log Analytics workspace parameters. + :type parameters: ~azure.mgmt.hdinsight.models.AzureMonitorRequest + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._enable_azure_monitor_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + enable_azure_monitor.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} + + def get_azure_monitor_status( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + """Gets the status of Azure Monitor on the HDInsight cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AzureMonitorResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.AzureMonitorResponse or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_azure_monitor_status.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AzureMonitorResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_azure_monitor_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} + + + def _disable_azure_monitor_initial( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.disable_azure_monitor.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def disable_azure_monitor( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Disables the Azure Monitor on the HDInsight cluster. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._disable_azure_monitor_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + disable_azure_monitor.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/azureMonitor'} + + def _create_initial( self, resource_group_name, cluster_name, extension_name, workspace_id=None, primary_key=None, custom_headers=None, raw=False, **operation_config): parameters = models.Extension(workspace_id=workspace_id, primary_key=primary_key) @@ -384,8 +605,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: Extension or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.hdinsight.models.Extension or + :return: ClusterMonitoringResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.ClusterMonitoringResponse or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -423,7 +644,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('Extension', response) + deserialized = self._deserialize('ClusterMonitoringResponse', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -513,3 +734,69 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}'} + + def get_azure_async_operation_status( + self, resource_group_name, cluster_name, extension_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param extension_name: The name of the cluster extension. + :type extension_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AsyncOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_azure_async_operation_status.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AsyncOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}/azureAsyncOperations/{operationId}'} diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py index 3c9b45ec033d..c38337ea28db 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_locations_operations.py @@ -211,3 +211,198 @@ def list_billing_specs( return deserialized list_billing_specs.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/billingSpecs'} + + def get_azure_async_operation_status( + self, location, operation_id, custom_headers=None, raw=False, **operation_config): + """Get the async operation status. + + :param location: The Azure location (region) for which to make the + request. + :type location: str + :param operation_id: The long running operation id. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AsyncOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_azure_async_operation_status.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AsyncOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_azure_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/azureasyncoperations/{operationId}'} + + def check_name_availability( + self, location, name=None, type=None, custom_headers=None, raw=False, **operation_config): + """Check the cluster name is available or not. + + :param location: The Azure location (region) for which to make the + request. + :type location: str + :param name: The resource name. + :type name: str + :param type: The resource type + :type type: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NameAvailabilityCheckResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.NameAvailabilityCheckResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.NameAvailabilityCheckRequestParameters(name=name, type=type) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'NameAvailabilityCheckRequestParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NameAvailabilityCheckResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/checkNameAvailability'} + + def validate_cluster_create_request( + self, location, parameters, custom_headers=None, raw=False, **operation_config): + """Validate the cluster create request spec is valid or not. + + :param location: The Azure location (region) for which to make the + request. + :type location: str + :param parameters: + :type parameters: + ~azure.mgmt.hdinsight.models.ClusterCreateRequestValidationParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ClusterCreateValidationResult or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.hdinsight.models.ClusterCreateValidationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.validate_cluster_create_request.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ClusterCreateRequestValidationParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClusterCreateValidationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate_cluster_create_request.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/validateCreateRequest'} diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_actions_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_actions_operations.py index 7f585d9ab403..469cc878e9b1 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_actions_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_script_actions_operations.py @@ -226,3 +226,66 @@ def get_execution_detail( return deserialized get_execution_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}'} + + def get_execution_async_operation_status( + self, resource_group_name, cluster_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets the async operation status of execution operation. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AsyncOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_execution_async_operation_status.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AsyncOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_execution_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions/azureasyncoperations/{operationId}'} diff --git a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_virtual_machines_operations.py b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_virtual_machines_operations.py index 962b2170b0a3..cd97f926b24d 100644 --- a/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_virtual_machines_operations.py +++ b/sdk/hdinsight/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/_virtual_machines_operations.py @@ -179,8 +179,71 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) restart_hosts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts'} + + def get_async_operation_status( + self, resource_group_name, cluster_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Gets the async operation status. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param cluster_name: The name of the cluster. + :type cluster_name: str + :param operation_id: The long running operation id. + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AsyncOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.AsyncOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_async_operation_status.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AsyncOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_async_operation_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/restartHosts/azureasyncoperations/{operationId}'}