diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/hd_insight_management_client.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/hd_insight_management_client.py index 9d7680ceef1d..b41d65b2f627 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/hd_insight_management_client.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/hd_insight_management_client.py @@ -15,9 +15,9 @@ from .version import VERSION from .operations.clusters_operations import ClustersOperations from .operations.applications_operations import ApplicationsOperations -from .operations.location_operations import LocationOperations +from .operations.locations_operations import LocationsOperations from .operations.configurations_operations import ConfigurationsOperations -from .operations.extension_operations import ExtensionOperations +from .operations.extensions_operations import ExtensionsOperations from .operations.script_actions_operations import ScriptActionsOperations from .operations.script_execution_history_operations import ScriptExecutionHistoryOperations from .operations.operations import Operations @@ -68,12 +68,12 @@ class HDInsightManagementClient(object): :vartype clusters: azure.mgmt.hdinsight.operations.ClustersOperations :ivar applications: Applications operations :vartype applications: azure.mgmt.hdinsight.operations.ApplicationsOperations - :ivar location: Location operations - :vartype location: azure.mgmt.hdinsight.operations.LocationOperations + :ivar locations: Locations operations + :vartype locations: azure.mgmt.hdinsight.operations.LocationsOperations :ivar configurations: Configurations operations :vartype configurations: azure.mgmt.hdinsight.operations.ConfigurationsOperations - :ivar extension: Extension operations - :vartype extension: azure.mgmt.hdinsight.operations.ExtensionOperations + :ivar extensions: Extensions operations + :vartype extensions: azure.mgmt.hdinsight.operations.ExtensionsOperations :ivar script_actions: ScriptActions operations :vartype script_actions: azure.mgmt.hdinsight.operations.ScriptActionsOperations :ivar script_execution_history: ScriptExecutionHistory operations @@ -98,7 +98,7 @@ def __init__( self._client = ServiceClient(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2015-03-01-preview' + self.api_version = '2018-06-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -106,11 +106,11 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.applications = ApplicationsOperations( self._client, self.config, self._serialize, self._deserialize) - self.location = LocationOperations( + self.locations = LocationsOperations( self._client, self.config, self._serialize, self._deserialize) self.configurations = ConfigurationsOperations( self._client, self.config, self._serialize, self._deserialize) - self.extension = ExtensionOperations( + self.extensions = ExtensionsOperations( self._client, self.config, self._serialize, self._deserialize) self.script_actions = ScriptActionsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py index ac8915a6c74a..f8f7aa9e3fae 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py @@ -42,25 +42,20 @@ from .resource import Resource from .tracked_resource import TrackedResource from .proxy_resource import ProxyResource -from .operation_display import OperationDisplay -from .operation import Operation +from .error_response import ErrorResponse, ErrorResponseException from .application_get_https_endpoint import ApplicationGetHttpsEndpoint from .application_get_endpoint import ApplicationGetEndpoint -from .application_get_properties import ApplicationGetProperties +from .application_properties import ApplicationProperties from .application import Application -from .version_spec import VersionSpec -from .versions_capability import VersionsCapability -from .regions_capability import RegionsCapability -from .vm_sizes_capability import VmSizesCapability -from .vm_size_compatibility_filter import VmSizeCompatibilityFilter -from .regional_quota_capability import RegionalQuotaCapability -from .quota_capability import QuotaCapability -from .capabilities_result import CapabilitiesResult -from .http_connectivity_settings import HttpConnectivitySettings +from .localized_name import LocalizedName +from .usage import Usage +from .usages_list_result import UsagesListResult from .extension import Extension from .cluster_monitoring_response import ClusterMonitoringResponse from .cluster_monitoring_request import ClusterMonitoringRequest from .script_action_persisted_get_response_spec import ScriptActionPersistedGetResponseSpec +from .operation_display import OperationDisplay +from .operation import Operation from .cluster_paged import ClusterPaged from .application_paged import ApplicationPaged from .runtime_script_action_detail_paged import RuntimeScriptActionDetailPaged @@ -107,25 +102,20 @@ 'Resource', 'TrackedResource', 'ProxyResource', - 'OperationDisplay', - 'Operation', + 'ErrorResponse', 'ErrorResponseException', 'ApplicationGetHttpsEndpoint', 'ApplicationGetEndpoint', - 'ApplicationGetProperties', + 'ApplicationProperties', 'Application', - 'VersionSpec', - 'VersionsCapability', - 'RegionsCapability', - 'VmSizesCapability', - 'VmSizeCompatibilityFilter', - 'RegionalQuotaCapability', - 'QuotaCapability', - 'CapabilitiesResult', - 'HttpConnectivitySettings', + 'LocalizedName', + 'Usage', + 'UsagesListResult', 'Extension', 'ClusterMonitoringResponse', 'ClusterMonitoringRequest', 'ScriptActionPersistedGetResponseSpec', + 'OperationDisplay', + 'Operation', 'ClusterPaged', 'ApplicationPaged', 'RuntimeScriptActionDetailPaged', diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application.py index 8d081d88723e..8e445be59571 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application.py @@ -29,7 +29,7 @@ class Application(ProxyResource): :param tags: The tags for the application. :type tags: dict[str, str] :param properties: The properties of the application. - :type properties: ~azure.mgmt.hdinsight.models.ApplicationGetProperties + :type properties: ~azure.mgmt.hdinsight.models.ApplicationProperties """ _validation = { @@ -44,7 +44,7 @@ class Application(ProxyResource): 'type': {'key': 'type', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'ApplicationGetProperties'}, + 'properties': {'key': 'properties', 'type': 'ApplicationProperties'}, } def __init__(self, etag=None, tags=None, properties=None): diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application_get_properties.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application_properties.py similarity index 97% rename from azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application_get_properties.py rename to azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application_properties.py index 4ba56aeeb2db..9fc8d04a0eb7 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application_get_properties.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/application_properties.py @@ -12,7 +12,7 @@ from msrest.serialization import Model -class ApplicationGetProperties(Model): +class ApplicationProperties(Model): """The HDInsight cluster application GET response. Variables are only populated by the server, and will be ignored when @@ -71,7 +71,7 @@ class ApplicationGetProperties(Model): } def __init__(self, compute_profile=None, install_script_actions=None, uninstall_script_actions=None, https_endpoints=None, ssh_endpoints=None, application_type=None, errors=None, additional_properties=None): - super(ApplicationGetProperties, self).__init__() + super(ApplicationProperties, self).__init__() self.compute_profile = compute_profile self.install_script_actions = install_script_actions self.uninstall_script_actions = uninstall_script_actions diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/capabilities_result.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/capabilities_result.py deleted file mode 100644 index 8a7a29cad272..000000000000 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/capabilities_result.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CapabilitiesResult(Model): - """The Get Capabilities operation response. - - :param versions: The version capability. - :type versions: dict[str, ~azure.mgmt.hdinsight.models.VersionsCapability] - :param regions: The virtual machine size compatibilty 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 compatibilty filters. - :type vm_size_filters: - list[~azure.mgmt.hdinsight.models.VmSizeCompatibilityFilter] - :param features: The capabilty features. - :type features: list[str] - :param quota: The quota capability. - :type quota: ~azure.mgmt.hdinsight.models.QuotaCapability - """ - - _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]'}, - '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): - super(CapabilitiesResult, self).__init__() - self.versions = versions - self.regions = regions - self.vm_sizes = vm_sizes - self.vm_size_filters = vm_size_filters - self.features = features - self.quota = quota diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/cluster_monitoring_response.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/cluster_monitoring_response.py index bbb45491a96b..3fec421448dd 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/cluster_monitoring_response.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/cluster_monitoring_response.py @@ -24,8 +24,8 @@ class ClusterMonitoringResponse(Model): """ _attribute_map = { - 'cluster_monitoring_enabled': {'key': 'ClusterMonitoringEnabled', 'type': 'bool'}, - 'workspace_id': {'key': 'WorkspaceId', 'type': 'str'}, + 'cluster_monitoring_enabled': {'key': 'clusterMonitoringEnabled', 'type': 'bool'}, + 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, } def __init__(self, cluster_monitoring_enabled=None, workspace_id=None): diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/error_response.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/error_response.py new file mode 100644 index 000000000000..1a399569811b --- /dev/null +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/error_response.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(Model): + """Describes the format of Error response. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, code=None, message=None): + super(ErrorResponse, self).__init__() + self.code = code + self.message = message + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/http_connectivity_settings.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/http_connectivity_settings.py deleted file mode 100644 index 46bb11c0ff41..000000000000 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/http_connectivity_settings.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class HttpConnectivitySettings(Model): - """The payload for a Configure HTTP settings request. - - :param enabled_credential: Whether or not the HTTP based authorization is - enabled. Possible values include: 'true', 'false' - :type enabled_credential: str or ~azure.mgmt.hdinsight.models.enum - :param username: The HTTP username. - :type username: str - :param password: The HTTP user password. - :type password: str - """ - - _attribute_map = { - 'enabled_credential': {'key': 'restAuthCredential\\.isEnabled', 'type': 'str'}, - 'username': {'key': 'restAuthCredential\\.username', 'type': 'str'}, - 'password': {'key': 'restAuthCredential\\.password', 'type': 'str'}, - } - - def __init__(self, enabled_credential=None, username=None, password=None): - super(HttpConnectivitySettings, self).__init__() - self.enabled_credential = enabled_credential - self.username = username - self.password = password diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/localized_name.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/localized_name.py new file mode 100644 index 000000000000..756a77dd3fb2 --- /dev/null +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/localized_name.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LocalizedName(Model): + """The details about the localizable name of a type of usage. + + :param value: The name of the used resource. + :type value: str + :param localized_value: The localized name of the used resource. + :type localized_value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, value=None, localized_value=None): + super(LocalizedName, self).__init__() + self.value = value + self.localized_value = localized_value diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/operation_display.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/operation_display.py index c87511b9dbca..e11cfe5819a0 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/operation_display.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/operation_display.py @@ -18,7 +18,7 @@ class OperationDisplay(Model): :param provider: The service provider: Microsoft.HDInsight :type provider: str :param resource: The resource on which the operation is performed: - Cluster, Capabilities, etc. + Cluster, Applications, etc. :type resource: str :param operation: The operation type: read, write, delete, etc. :type operation: str diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/quota_capability.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/quota_capability.py deleted file mode 100644 index ed841269770b..000000000000 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/quota_capability.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class QuotaCapability(Model): - """The regional quota capability. - - :param regional_quotas: The list of region quota capabilities. - :type regional_quotas: - list[~azure.mgmt.hdinsight.models.RegionalQuotaCapability] - """ - - _attribute_map = { - 'regional_quotas': {'key': 'regionalQuotas', 'type': '[RegionalQuotaCapability]'}, - } - - def __init__(self, regional_quotas=None): - super(QuotaCapability, self).__init__() - self.regional_quotas = regional_quotas diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/regional_quota_capability.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/regional_quota_capability.py deleted file mode 100644 index 613390293da9..000000000000 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/regional_quota_capability.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class RegionalQuotaCapability(Model): - """The regional quota capacity. - - :param region_name: The region name. - :type region_name: str - :param cores_used: The number of cores used in the region. - :type cores_used: long - :param cores_available: The number of courses available in the region. - :type cores_available: long - """ - - _attribute_map = { - 'region_name': {'key': 'region_name', 'type': 'str'}, - 'cores_used': {'key': 'cores_used', 'type': 'long'}, - 'cores_available': {'key': 'cores_available', 'type': 'long'}, - } - - def __init__(self, region_name=None, cores_used=None, cores_available=None): - super(RegionalQuotaCapability, self).__init__() - self.region_name = region_name - self.cores_used = cores_used - self.cores_available = cores_available diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/regions_capability.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/regions_capability.py deleted file mode 100644 index 8ab571bf6e2c..000000000000 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/regions_capability.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class RegionsCapability(Model): - """The regions capability. - - :param available: The list of region capabilities. - :type available: list[str] - """ - - _attribute_map = { - 'available': {'key': 'available', 'type': '[str]'}, - } - - def __init__(self, available=None): - super(RegionsCapability, self).__init__() - self.available = available diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/usage.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/usage.py new file mode 100644 index 000000000000..aa0afff447b0 --- /dev/null +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/usage.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Usage(Model): + """The details about the usage of a particular limited resource. + + :param unit: The type of measurement for usage. + :type unit: str + :param current_value: The current usage. + :type current_value: int + :param limit: The maximum allowed usage. + :type limit: int + :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'}, + 'name': {'key': 'name', 'type': 'LocalizedName'}, + } + + def __init__(self, unit=None, current_value=None, limit=None, name=None): + super(Usage, self).__init__() + self.unit = unit + self.current_value = current_value + self.limit = limit + self.name = name diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/vm_sizes_capability.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/usages_list_result.py similarity index 59% rename from azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/vm_sizes_capability.py rename to azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/usages_list_result.py index 59b19c7d76b0..dd11b03d4dd3 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/vm_sizes_capability.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/usages_list_result.py @@ -12,17 +12,17 @@ from msrest.serialization import Model -class VmSizesCapability(Model): - """The virtual machine sizes capability. +class UsagesListResult(Model): + """The response for the operation to get regional usages for a subscription. - :param available: The list of virtual machine size capabilities. - :type available: list[str] + :param value: The list of usages. + :type value: list[~azure.mgmt.hdinsight.models.Usage] """ _attribute_map = { - 'available': {'key': 'available', 'type': '[str]'}, + 'value': {'key': 'value', 'type': '[Usage]'}, } - def __init__(self, available=None): - super(VmSizesCapability, self).__init__() - self.available = available + def __init__(self, value=None): + super(UsagesListResult, self).__init__() + self.value = value diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/version_spec.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/version_spec.py deleted file mode 100644 index dcb001e8af4d..000000000000 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/version_spec.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class VersionSpec(Model): - """The version properties. - - :param friendly_name: The friendly name - :type friendly_name: str - :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 - :param component_versions: The component version property. - :type component_versions: dict[str, str] - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'is_default': {'key': 'isDefault', 'type': 'str'}, - 'component_versions': {'key': 'componentVersions', 'type': '{str}'}, - } - - def __init__(self, friendly_name=None, display_name=None, is_default=None, component_versions=None): - super(VersionSpec, self).__init__() - self.friendly_name = friendly_name - self.display_name = display_name - self.is_default = is_default - self.component_versions = component_versions diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/versions_capability.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/versions_capability.py deleted file mode 100644 index 1045c9985223..000000000000 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/versions_capability.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class VersionsCapability(Model): - """The version capability. - - :param available: The list of version capabilities. - :type available: list[~azure.mgmt.hdinsight.models.VersionSpec] - """ - - _attribute_map = { - 'available': {'key': 'available', 'type': '[VersionSpec]'}, - } - - def __init__(self, available=None): - super(VersionsCapability, self).__init__() - self.available = available diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/vm_size_compatibility_filter.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/vm_size_compatibility_filter.py deleted file mode 100644 index c45a95fb69a9..000000000000 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/vm_size_compatibility_filter.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class VmSizeCompatibilityFilter(Model): - """The virtual machine type compatibility filter. - - :param filter_mode: The mode for the filter. - :type filter_mode: str - :param regions: The list of regions. - :type regions: list[str] - :param cluster_flavors: The list of cluster types available. - :type cluster_flavors: list[str] - :param node_types: The list of node types. - :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] - """ - - _attribute_map = { - 'filter_mode': {'key': 'FilterMode', 'type': 'str'}, - 'regions': {'key': 'Regions', 'type': '[str]'}, - 'cluster_flavors': {'key': 'ClusterFlavors', 'type': '[str]'}, - 'node_types': {'key': 'NodeTypes', 'type': '[str]'}, - 'cluster_versions': {'key': 'ClusterVersions', 'type': '[str]'}, - 'vmsizes': {'key': 'vmsizes', 'type': '[str]'}, - } - - def __init__(self, filter_mode=None, regions=None, cluster_flavors=None, node_types=None, cluster_versions=None, vmsizes=None): - super(VmSizeCompatibilityFilter, self).__init__() - 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 diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/__init__.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/__init__.py index 0d4ba3e61d5a..bb15f585c444 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/__init__.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/__init__.py @@ -11,9 +11,9 @@ from .clusters_operations import ClustersOperations from .applications_operations import ApplicationsOperations -from .location_operations import LocationOperations +from .locations_operations import LocationsOperations from .configurations_operations import ConfigurationsOperations -from .extension_operations import ExtensionOperations +from .extensions_operations import ExtensionsOperations from .script_actions_operations import ScriptActionsOperations from .script_execution_history_operations import ScriptExecutionHistoryOperations from .operations import Operations @@ -21,9 +21,9 @@ __all__ = [ 'ClustersOperations', 'ApplicationsOperations', - 'LocationOperations', + 'LocationsOperations', 'ConfigurationsOperations', - 'ExtensionOperations', + 'ExtensionsOperations', 'ScriptActionsOperations', 'ScriptExecutionHistoryOperations', 'Operations', diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/applications_operations.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/applications_operations.py index 098140876bb9..53217c1c641a 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/applications_operations.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/applications_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller @@ -25,8 +24,7 @@ class ApplicationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The HDInsight client API Version. Constant value: "2015-03-01-preview". - :ivar application_name: The constant value for the application name. Constant value: "hue". + :ivar api_version: The HDInsight client API Version. Constant value: "2018-06-01-preview". """ models = models @@ -36,14 +34,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-03-01-preview" - self.application_name = "hue" + self.api_version = "2018-06-01-preview" self.config = config - def list( + def list_by_cluster( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): - """Lists all of the applications HDInsight cluster. + """Lists all of the applications for the HDInsight cluster. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -57,17 +54,18 @@ def list( :return: An iterator like instance of Application :rtype: ~azure.mgmt.hdinsight.models.ApplicationPaged[~azure.mgmt.hdinsight.models.Application] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications' + url = self.list_by_cluster.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -95,9 +93,7 @@ def internal_paging(next_link=None, raw=False): request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -110,10 +106,11 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications'} def get( self, resource_group_name, cluster_name, application_name, custom_headers=None, raw=False, **operation_config): - """Lists properties of the specified application. + """Gets properties of the specified application. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -129,14 +126,15 @@ def get( :return: Application or ClientRawResponse if raw=true :rtype: ~azure.mgmt.hdinsight.models.Application or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}' + url = self.get.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'applicationName': self._serialize.url("application_name", application_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -160,9 +158,7 @@ def get( response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -174,35 +170,18 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}'} - def create( - self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates applications for 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 application create request. - :type parameters: - ~azure.mgmt.hdinsight.models.ApplicationGetProperties - :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: Application or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.hdinsight.models.Application or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_initial( + self, resource_group_name, cluster_name, application_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}' + url = self.create.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("self.application_name", self.application_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'applicationName': self._serialize.url("application_name", application_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -221,7 +200,7 @@ def create( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'ApplicationGetProperties') + body_content = self._serialize.body(parameters, 'ApplicationProperties') # Construct and send request request = self._client.put(url, query_parameters) @@ -229,9 +208,7 @@ def create( request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -244,16 +221,86 @@ def create( return deserialized + def create( + self, resource_group_name, cluster_name, application_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates applications for 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 application_name: The constant value for the application name. + :type application_name: str + :param parameters: The application create request. + :type parameters: ~azure.mgmt.hdinsight.models.ApplicationProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns Application + or ClientRawResponse if raw=true + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hdinsight.models.Application] + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + application_name=application_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = self._deserialize('Application', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}'} + def _delete_initial( - self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_name, application_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}' + url = self.delete.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("self.application_name", self.application_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'applicationName': self._serialize.url("application_name", application_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -275,23 +322,23 @@ def _delete_initial( request = self._client.delete(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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 delete( - self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_name, application_name, custom_headers=None, raw=False, **operation_config): """Deletes the specified application 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 application_name: The constant value for the application name. + :type application_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 @@ -299,11 +346,13 @@ def delete( ClientRawResponse if raw=true :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + application_name=application_name, custom_headers=custom_headers, raw=True, **operation_config @@ -327,10 +376,8 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -342,3 +389,4 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/applications/{applicationName}'} diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/clusters_operations.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/clusters_operations.py index a00caca4f10b..b5e258fd6ca3 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/clusters_operations.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/clusters_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller @@ -25,7 +24,7 @@ class ClustersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The HDInsight client API Version. Constant value: "2015-03-01-preview". + :ivar api_version: The HDInsight client API Version. Constant value: "2018-06-01-preview". :ivar role_name: The constant value for the roleName. Constant value: "workernode". """ @@ -36,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-03-01-preview" + self.api_version = "2018-06-01-preview" self.role_name = "workernode" self.config = config @@ -45,11 +44,11 @@ def __init__(self, client, config, serializer, deserializer): def _create_initial( self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}' + url = self.create.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -76,9 +75,7 @@ def _create_initial( request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -110,7 +107,8 @@ def create( :rtype: ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hdinsight.models.Cluster] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._create_initial( resource_group_name=resource_group_name, @@ -140,9 +138,7 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = self._deserialize('Cluster', response) @@ -158,6 +154,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}'} def update( self, resource_group_name, cluster_name, tags=None, custom_headers=None, raw=False, **operation_config): @@ -177,16 +174,17 @@ def update( :return: Cluster or ClientRawResponse if raw=true :rtype: ~azure.mgmt.hdinsight.models.Cluster or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ parameters = models.ClusterPatchParameters(tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}' + url = self.update.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -213,9 +211,7 @@ def update( request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -227,16 +223,17 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}'} def _delete_initial( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}' + url = self.delete.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -259,9 +256,7 @@ def _delete_initial( response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -282,7 +277,8 @@ def delete( ClientRawResponse if raw=true :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -311,9 +307,7 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -325,6 +319,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}'} def get( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): @@ -342,14 +337,15 @@ def get( :return: Cluster or ClientRawResponse if raw=true :rtype: ~azure.mgmt.hdinsight.models.Cluster or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}' + url = self.get.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -372,9 +368,7 @@ def get( response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -386,6 +380,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -401,16 +396,17 @@ def list_by_resource_group( :return: An iterator like instance of Cluster :rtype: ~azure.mgmt.hdinsight.models.ClusterPaged[~azure.mgmt.hdinsight.models.Cluster] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -438,9 +434,7 @@ def internal_paging(next_link=None, raw=False): request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -453,6 +447,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters'} def _resize_initial( @@ -460,12 +455,12 @@ def _resize_initial( parameters = models.ClusterResizeParameters(target_instance_count=target_instance_count) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize' + url = self.resize.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'), - 'roleName': self._serialize.url("self.role_name", self.role_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'roleName': self._serialize.url("self.role_name", self.role_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -492,9 +487,7 @@ def _resize_initial( request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -518,7 +511,8 @@ def resize( ClientRawResponse if raw=true :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._resize_initial( resource_group_name=resource_group_name, @@ -548,9 +542,7 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -562,6 +554,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + resize.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/roles/{roleName}/resize'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -575,13 +568,14 @@ def list( :return: An iterator like instance of Cluster :rtype: ~azure.mgmt.hdinsight.models.ClusterPaged[~azure.mgmt.hdinsight.models.Cluster] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -611,9 +605,7 @@ def internal_paging(next_link=None, raw=False): request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -626,6 +618,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/clusters'} def _execute_script_actions_initial( @@ -633,11 +626,11 @@ def _execute_script_actions_initial( parameters = models.ExecuteScriptActionParameters(script_actions=script_actions, persist_on_success=persist_on_success) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions' + url = self.execute_script_actions.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -664,9 +657,7 @@ def _execute_script_actions_initial( request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -693,7 +684,8 @@ def execute_script_actions( ClientRawResponse if raw=true :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._execute_script_actions_initial( resource_group_name=resource_group_name, @@ -724,9 +716,7 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -738,3 +728,4 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + execute_script_actions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/executeScriptActions'} diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/configurations_operations.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/configurations_operations.py index 871826b124a2..bd5de35cf42a 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/configurations_operations.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/configurations_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller @@ -25,8 +24,7 @@ class ConfigurationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar configuration_name: The constant for configuration type of gateway. Constant value: "gateway". - :ivar api_version: The HDInsight client API Version. Constant value: "2015-03-01-preview". + :ivar api_version: The HDInsight client API Version. Constant value: "2018-06-01-preview". """ models = models @@ -36,21 +34,20 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.configuration_name = "gateway" - self.api_version = "2015-03-01-preview" + self.api_version = "2018-06-01-preview" self.config = config def _update_http_settings_initial( - self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_name, configuration_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}' + url = self.update_http_settings.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'), - 'configurationName': self._serialize.url("self.configuration_name", self.configuration_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -69,7 +66,7 @@ def _update_http_settings_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'HttpConnectivitySettings') + body_content = self._serialize.body(parameters, '{str}') # Construct and send request request = self._client.post(url, query_parameters) @@ -77,25 +74,24 @@ def _update_http_settings_initial( request, header_parameters, body_content, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response def update_http_settings( - self, resource_group_name, cluster_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_name, configuration_name, parameters, custom_headers=None, raw=False, **operation_config): """Configures the HTTP settings on the specified 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 name of the resource group. - :type parameters: - ~azure.mgmt.hdinsight.models.HttpConnectivitySettings + :param configuration_name: The name of the cluster configuration. + :type configuration_name: str + :param parameters: The cluster configurations. + :type parameters: dict[str, str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -103,11 +99,13 @@ def update_http_settings( ClientRawResponse if raw=true :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._update_http_settings_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, + configuration_name=configuration_name, parameters=parameters, custom_headers=custom_headers, raw=True, @@ -133,9 +131,7 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -147,6 +143,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + update_http_settings.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}'} def get( self, resource_group_name, cluster_name, configuration_name, custom_headers=None, raw=False, **operation_config): @@ -156,8 +153,7 @@ def get( :type resource_group_name: str :param cluster_name: The name of the cluster. :type cluster_name: str - :param configuration_name: The constant for configuration type of - gateway. + :param configuration_name: The name of the cluster configuration. :type configuration_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -166,15 +162,16 @@ def get( overrides`. :return: dict or ClientRawResponse if raw=true :rtype: dict[str, str] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}' + url = self.get.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'), - 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -197,9 +194,7 @@ def get( response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -211,3 +206,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/configurations/{configurationName}'} diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/extension_operations.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/extensions_operations.py similarity index 68% rename from azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/extension_operations.py rename to azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/extensions_operations.py index cae633fcb1db..c93dfa0b5b17 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/extension_operations.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/extensions_operations.py @@ -11,22 +11,20 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.exceptions import DeserializationError from msrestazure.azure_operation import AzureOperationPoller from .. import models -class ExtensionOperations(object): - """ExtensionOperations operations. +class ExtensionsOperations(object): + """ExtensionsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The HDInsight client API Version. Constant value: "2015-03-01-preview". - :ivar extension_name: The name of the cluster extension. Constant value: "clustermonitoring". + :ivar api_version: The HDInsight client API Version. Constant value: "2018-06-01-preview". """ models = models @@ -36,8 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-03-01-preview" - self.extension_name = "clustermonitoring" + self.api_version = "2018-06-01-preview" self.config = config @@ -47,11 +44,11 @@ def _enable_monitoring_initial( parameters = models.ClusterMonitoringRequest(workspace_id=workspace_id, primary_key=primary_key) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring' + url = self.enable_monitoring.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -77,10 +74,8 @@ def _enable_monitoring_initial( response = self._client.send( request, header_parameters, body_content, stream=False, **operation_config) - if response.status_code not in [202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -107,7 +102,8 @@ def enable_monitoring( ClientRawResponse if raw=true :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._enable_monitoring_initial( resource_group_name=resource_group_name, @@ -137,10 +133,8 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): - if response.status_code not in [202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -152,6 +146,7 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + enable_monitoring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring'} def get_monitoring_status( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): @@ -170,14 +165,15 @@ def get_monitoring_status( :return: ClusterMonitoringResponse or ClientRawResponse if raw=true :rtype: ~azure.mgmt.hdinsight.models.ClusterMonitoringResponse or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring' + url = self.get_monitoring_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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -200,9 +196,7 @@ def get_monitoring_status( response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -214,16 +208,17 @@ def get_monitoring_status( return client_raw_response return deserialized + get_monitoring_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring'} def _disable_monitoring_initial( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring' + url = self.disable_monitoring.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -245,10 +240,8 @@ def _disable_monitoring_initial( request = self._client.delete(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) - if response.status_code not in [202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -270,7 +263,8 @@ def disable_monitoring( ClientRawResponse if raw=true :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ raw_result = self._disable_monitoring_initial( resource_group_name=resource_group_name, @@ -298,10 +292,8 @@ def get_long_running_status(status_link, headers=None): def get_long_running_output(response): - if response.status_code not in [202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) @@ -313,39 +305,20 @@ def get_long_running_output(response): return AzureOperationPoller( long_running_send, get_long_running_output, get_long_running_status, long_running_operation_timeout) + disable_monitoring.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring'} - def create( - self, resource_group_name, cluster_name, workspace_id=None, primary_key=None, custom_headers=None, raw=False, **operation_config): - """Creates an HDInsight cluster extension. - :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 workspace_id: The workspace ID for the cluster monitoring - extension. - :type workspace_id: str - :param primary_key: The certificate for the cluster monitoring - extensions. - :type primary_key: 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + 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) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}' + url = self.create.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("self.extension_name", self.extension_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'extensionName': self._serialize.url("extension_name", extension_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -371,17 +344,85 @@ def create( response = self._client.send( request, header_parameters, body_content, stream=False, **operation_config) - if response.status_code not in [202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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 create( + self, resource_group_name, cluster_name, extension_name, workspace_id=None, primary_key=None, custom_headers=None, raw=False, **operation_config): + """Creates an HDInsight cluster extension. + + :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 workspace_id: The workspace ID for the cluster monitoring + extension. + :type workspace_id: str + :param primary_key: The certificate for the cluster monitoring + extensions. + :type primary_key: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + extension_name=extension_name, + workspace_id=workspace_id, + primary_key=primary_key, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + 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 + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}'} + def get( - self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_name, extension_name, custom_headers=None, raw=False, **operation_config): """Gets the extension properties for the specified HDInsight cluster extension. @@ -389,6 +430,8 @@ def get( :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 dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -397,15 +440,16 @@ def get( :return: Extension or ClientRawResponse if raw=true :rtype: ~azure.mgmt.hdinsight.models.Extension or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}' + url = self.get.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("self.extension_name", self.extension_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'extensionName': self._serialize.url("extension_name", extension_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -428,9 +472,7 @@ def get( response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -442,31 +484,18 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}'} - def delete( - self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): - """Deletes the specified extension for 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _delete_initial( + self, resource_group_name, cluster_name, extension_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}' + url = self.delete.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("self.extension_name", self.extension_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'extensionName': self._serialize.url("extension_name", extension_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -488,11 +517,71 @@ def delete( request = self._client.delete(url, query_parameters) response = self._client.send(request, header_parameters, stream=False, **operation_config) - if response.status_code not in [202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + 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 delete( + self, resource_group_name, cluster_name, extension_name, custom_headers=None, raw=False, **operation_config): + """Deletes the specified extension for 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 extension_name: The name of the cluster extension. + :type extension_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 + :return: An instance of AzureOperationPoller that returns None or + ClientRawResponse if raw=true + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + extension_name=extension_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + if raw: + return raw_result + + # Construct and send request + def long_running_send(): + return raw_result.response + + def get_long_running_status(status_link, headers=None): + + request = self._client.get(status_link) + if headers: + request.headers.update(headers) + header_parameters = {} + header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] + return self._client.send( + request, header_parameters, stream=False, **operation_config) + + def get_long_running_output(response): + + 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 + + long_running_operation_timeout = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + return AzureOperationPoller( + long_running_send, get_long_running_output, + get_long_running_status, long_running_operation_timeout) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}'} diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/location_operations.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/locations_operations.py similarity index 77% rename from azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/location_operations.py rename to azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/locations_operations.py index 80d95f6241d6..43e770d3b6ad 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/location_operations.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/locations_operations.py @@ -11,19 +11,18 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models -class LocationOperations(object): - """LocationOperations operations. +class LocationsOperations(object): + """LocationsOperations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The HDInsight client API Version. Constant value: "2015-03-01-preview". + :ivar api_version: The HDInsight client API Version. Constant value: "2018-06-01-preview". """ models = models @@ -33,13 +32,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-03-01-preview" + self.api_version = "2018-06-01-preview" self.config = config - def get_capabilities( + def list_usages( self, location, custom_headers=None, raw=False, **operation_config): - """Gets the capabilities for the specified location. + """Lists the usages for the specified location. :param location: The location to get capabilities for. :type location: str @@ -48,16 +47,17 @@ def get_capabilities( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: CapabilitiesResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.hdinsight.models.CapabilitiesResult or + :return: UsagesListResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hdinsight.models.UsagesListResult or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/capabilities' + url = self.list_usages.metadata['url'] path_format_arguments = { - 'location': self._serialize.url("location", location, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + '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) @@ -80,17 +80,16 @@ def get_capabilities( response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('CapabilitiesResult', response) + deserialized = self._deserialize('UsagesListResult', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HDInsight/locations/{location}/usages'} diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/operations.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/operations.py index f6859bcb063d..4e12a18a460d 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/operations.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -23,7 +22,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The HDInsight client API Version. Constant value: "2015-03-01-preview". + :ivar api_version: The HDInsight client API Version. Constant value: "2018-06-01-preview". """ models = models @@ -33,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-03-01-preview" + self.api_version = "2018-06-01-preview" self.config = config @@ -49,13 +48,14 @@ def list( :return: An iterator like instance of Operation :rtype: ~azure.mgmt.hdinsight.models.OperationPaged[~azure.mgmt.hdinsight.models.Operation] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.HDInsight/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -81,9 +81,7 @@ def internal_paging(next_link=None, raw=False): request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -96,3 +94,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.HDInsight/operations'} diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/script_actions_operations.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/script_actions_operations.py index 213cae13f5f1..9ca1f0895e73 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/script_actions_operations.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/script_actions_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -23,7 +22,7 @@ class ScriptActionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The HDInsight client API Version. Constant value: "2015-03-01-preview". + :ivar api_version: The HDInsight client API Version. Constant value: "2018-06-01-preview". """ models = models @@ -33,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-03-01-preview" + self.api_version = "2018-06-01-preview" self.config = config @@ -54,15 +53,16 @@ def delete( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions/{scriptName}' + url = self.delete.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'), - 'scriptName': self._serialize.url("script_name", script_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'scriptName': self._serialize.url("script_name", script_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -85,15 +85,14 @@ def delete( response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions/{scriptName}'} - def list_persisted_scripts( + def list_by_cluster( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): """Lists all the persisted script actions for the specified cluster. @@ -109,17 +108,18 @@ def list_persisted_scripts( :return: An iterator like instance of RuntimeScriptActionDetail :rtype: ~azure.mgmt.hdinsight.models.RuntimeScriptActionDetailPaged[~azure.mgmt.hdinsight.models.RuntimeScriptActionDetail] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions' + url = self.list_by_cluster.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -147,9 +147,7 @@ def internal_paging(next_link=None, raw=False): request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -162,6 +160,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptActions'} def get_execution_detail( self, resource_group_name, cluster_name, script_execution_id, custom_headers=None, raw=False, **operation_config): @@ -181,15 +180,16 @@ def get_execution_detail( :return: RuntimeScriptActionDetail or ClientRawResponse if raw=true :rtype: ~azure.mgmt.hdinsight.models.RuntimeScriptActionDetail or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}' + url = self.get_execution_detail.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'), - 'scriptExecutionId': self._serialize.url("script_execution_id", script_execution_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'scriptExecutionId': self._serialize.url("script_execution_id", script_execution_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -212,9 +212,7 @@ def get_execution_detail( response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -226,3 +224,4 @@ def get_execution_detail( return client_raw_response return deserialized + get_execution_detail.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}'} diff --git a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/script_execution_history_operations.py b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/script_execution_history_operations.py index a88ebf7e2ac3..19c06f608fd6 100644 --- a/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/script_execution_history_operations.py +++ b/azure-mgmt-hdinsight/azure/mgmt/hdinsight/operations/script_execution_history_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -23,7 +22,7 @@ class ScriptExecutionHistoryOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The HDInsight client API Version. Constant value: "2015-03-01-preview". + :ivar api_version: The HDInsight client API Version. Constant value: "2018-06-01-preview". """ models = models @@ -33,11 +32,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-03-01-preview" + self.api_version = "2018-06-01-preview" self.config = config - def list( + def list_by_cluster( self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): """Lists all scripts' execution history for the specified cluster. @@ -53,17 +52,18 @@ def list( :return: An iterator like instance of RuntimeScriptActionDetail :rtype: ~azure.mgmt.hdinsight.models.RuntimeScriptActionDetailPaged[~azure.mgmt.hdinsight.models.RuntimeScriptActionDetail] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory' + url = self.list_by_cluster.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'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -91,9 +91,7 @@ def internal_paging(next_link=None, raw=False): request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -106,6 +104,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory'} def promote( self, resource_group_name, cluster_name, script_execution_id, custom_headers=None, raw=False, **operation_config): @@ -115,8 +114,8 @@ def promote( :type resource_group_name: str :param cluster_name: The name of the cluster. :type cluster_name: str - :param script_execution_id: The script execution ID. - :type script_execution_id: long + :param script_execution_id: The script execution Id + :type script_execution_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 @@ -124,15 +123,16 @@ def promote( overrides`. :return: None or ClientRawResponse if raw=true :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote' + url = self.promote.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'), - 'scriptExecutionId': self._serialize.url("script_execution_id", script_execution_id, 'long'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + 'scriptExecutionId': self._serialize.url("script_execution_id", script_execution_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -155,10 +155,9 @@ def promote( response = self._client.send(request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + promote.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/scriptExecutionHistory/{scriptExecutionId}/promote'}