From 8662875b913f75663ab6cfdc34fa3d1a3d3a16cf Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 19 May 2020 01:59:31 +0000 Subject: [PATCH] Generated from 09ebd9f479b54ba0243cfe4e758f68ae7589455d Update SavedSearches.json --- .../_log_analytics_management_client.py | 10 + .../azure/mgmt/loganalytics/models/_models.py | 12 ++ .../mgmt/loganalytics/models/_models_py3.py | 14 +- .../mgmt/loganalytics/operations/__init__.py | 4 + .../_available_service_tiers_operations.py | 102 ++++++++++ .../_deleted_workspaces_operations.py | 178 ++++++++++++++++++ .../operations/_workspaces_operations.py | 78 ++------ .../azure-mgmt-loganalytics/setup.py | 4 +- 8 files changed, 335 insertions(+), 67 deletions(-) create mode 100644 sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_available_service_tiers_operations.py create mode 100644 sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_deleted_workspaces_operations.py diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_log_analytics_management_client.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_log_analytics_management_client.py index 362afbc9ad03..3a458a7f8494 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_log_analytics_management_client.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_log_analytics_management_client.py @@ -24,9 +24,11 @@ from .operations import SharedKeysOperations from .operations import UsagesOperations from .operations import WorkspacesOperations +from .operations import DeletedWorkspacesOperations from .operations import ClustersOperations from .operations import StorageInsightConfigsOperations from .operations import SavedSearchesOperations +from .operations import AvailableServiceTiersOperations from .operations import GatewaysOperations from .operations import SchemaOperations from .operations import WorkspacePurgeOperations @@ -61,12 +63,16 @@ class LogAnalyticsManagementClient(SDKClient): :vartype usages: azure.mgmt.loganalytics.operations.UsagesOperations :ivar workspaces: Workspaces operations :vartype workspaces: azure.mgmt.loganalytics.operations.WorkspacesOperations + :ivar deleted_workspaces: DeletedWorkspaces operations + :vartype deleted_workspaces: azure.mgmt.loganalytics.operations.DeletedWorkspacesOperations :ivar clusters: Clusters operations :vartype clusters: azure.mgmt.loganalytics.operations.ClustersOperations :ivar storage_insight_configs: StorageInsightConfigs operations :vartype storage_insight_configs: azure.mgmt.loganalytics.operations.StorageInsightConfigsOperations :ivar saved_searches: SavedSearches operations :vartype saved_searches: azure.mgmt.loganalytics.operations.SavedSearchesOperations + :ivar available_service_tiers: AvailableServiceTiers operations + :vartype available_service_tiers: azure.mgmt.loganalytics.operations.AvailableServiceTiersOperations :ivar gateways: Gateways operations :vartype gateways: azure.mgmt.loganalytics.operations.GatewaysOperations :ivar schema: Schema operations @@ -115,12 +121,16 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.workspaces = WorkspacesOperations( self._client, self.config, self._serialize, self._deserialize) + self.deleted_workspaces = DeletedWorkspacesOperations( + self._client, self.config, self._serialize, self._deserialize) self.clusters = ClustersOperations( self._client, self.config, self._serialize, self._deserialize) self.storage_insight_configs = StorageInsightConfigsOperations( self._client, self.config, self._serialize, self._deserialize) self.saved_searches = SavedSearchesOperations( self._client, self.config, self._serialize, self._deserialize) + self.available_service_tiers = AvailableServiceTiersOperations( + self._client, self.config, self._serialize, self._deserialize) self.gateways = GatewaysOperations( self._client, self.config, self._serialize, self._deserialize) self.schema = SchemaOperations( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py index bb1bd8a415b8..06b5041ef05e 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py @@ -1068,6 +1068,14 @@ class SavedSearch(ProxyResource): https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference for reference. :type query: str + :param function_alias: The function alias if query serves as a function. + :type function_alias: str + :param function_parameters: The optional function parameters if query + serves as a function. Value should be in the following format: + 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. + For more examples and proper syntax please refer to + https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + :type function_parameters: str :param version: The version number of the query language. The current version is 2 and is the default. :type version: long @@ -1092,6 +1100,8 @@ class SavedSearch(ProxyResource): 'category': {'key': 'properties.category', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'query': {'key': 'properties.query', 'type': 'str'}, + 'function_alias': {'key': 'properties.functionAlias', 'type': 'str'}, + 'function_parameters': {'key': 'properties.functionParameters', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'long'}, 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, } @@ -1102,6 +1112,8 @@ def __init__(self, **kwargs): self.category = kwargs.get('category', None) self.display_name = kwargs.get('display_name', None) self.query = kwargs.get('query', None) + self.function_alias = kwargs.get('function_alias', None) + self.function_parameters = kwargs.get('function_parameters', None) self.version = kwargs.get('version', None) self.tags = kwargs.get('tags', None) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models_py3.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models_py3.py index 15cd80e08782..243e3f985f4a 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models_py3.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models_py3.py @@ -1068,6 +1068,14 @@ class SavedSearch(ProxyResource): https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference for reference. :type query: str + :param function_alias: The function alias if query serves as a function. + :type function_alias: str + :param function_parameters: The optional function parameters if query + serves as a function. Value should be in the following format: + 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. + For more examples and proper syntax please refer to + https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + :type function_parameters: str :param version: The version number of the query language. The current version is 2 and is the default. :type version: long @@ -1092,16 +1100,20 @@ class SavedSearch(ProxyResource): 'category': {'key': 'properties.category', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'query': {'key': 'properties.query', 'type': 'str'}, + 'function_alias': {'key': 'properties.functionAlias', 'type': 'str'}, + 'function_parameters': {'key': 'properties.functionParameters', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'long'}, 'tags': {'key': 'properties.tags', 'type': '[Tag]'}, } - def __init__(self, *, category: str, display_name: str, query: str, e_tag: str=None, version: int=None, tags=None, **kwargs) -> None: + def __init__(self, *, category: str, display_name: str, query: str, e_tag: str=None, function_alias: str=None, function_parameters: str=None, version: int=None, tags=None, **kwargs) -> None: super(SavedSearch, self).__init__(**kwargs) self.e_tag = e_tag self.category = category self.display_name = display_name self.query = query + self.function_alias = function_alias + self.function_parameters = function_parameters self.version = version self.tags = tags diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py index 074a8cd5a0a9..c04e6b6a4baa 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py @@ -20,9 +20,11 @@ from ._shared_keys_operations import SharedKeysOperations from ._usages_operations import UsagesOperations from ._workspaces_operations import WorkspacesOperations +from ._deleted_workspaces_operations import DeletedWorkspacesOperations from ._clusters_operations import ClustersOperations from ._storage_insight_configs_operations import StorageInsightConfigsOperations from ._saved_searches_operations import SavedSearchesOperations +from ._available_service_tiers_operations import AvailableServiceTiersOperations from ._gateways_operations import GatewaysOperations from ._schema_operations import SchemaOperations from ._workspace_purge_operations import WorkspacePurgeOperations @@ -39,9 +41,11 @@ 'SharedKeysOperations', 'UsagesOperations', 'WorkspacesOperations', + 'DeletedWorkspacesOperations', 'ClustersOperations', 'StorageInsightConfigsOperations', 'SavedSearchesOperations', + 'AvailableServiceTiersOperations', 'GatewaysOperations', 'SchemaOperations', 'WorkspacePurgeOperations', diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_available_service_tiers_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_available_service_tiers_operations.py new file mode 100644 index 000000000000..74ec0b2876c4 --- /dev/null +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_available_service_tiers_operations.py @@ -0,0 +1,102 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class AvailableServiceTiersOperations(object): + """AvailableServiceTiersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2020-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + + self.config = config + + def list_by_workspace( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets the available service tiers for the workspace. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_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: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.loganalytics.models.AvailableServiceTier] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_workspace.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[AvailableServiceTier]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers'} diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_deleted_workspaces_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_deleted_workspaces_operations.py new file mode 100644 index 000000000000..bd07e4bd7510 --- /dev/null +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_deleted_workspaces_operations.py @@ -0,0 +1,178 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DeletedWorkspacesOperations(object): + """DeletedWorkspacesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API version to use for this operation. Constant value: "2020-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets recently deleted workspaces in a subscription, available for + recovery. + + :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: An iterator like instance of Workspace + :rtype: + ~azure.mgmt.loganalytics.models.WorkspacePaged[~azure.mgmt.loganalytics.models.Workspace] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets recently deleted workspaces in a resource group, available for + recovery. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_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: An iterator like instance of Workspace + :rtype: + ~azure.mgmt.loganalytics.models.WorkspacePaged[~azure.mgmt.loganalytics.models.Workspace] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, 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 + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces'} diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspaces_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspaces_operations.py index 2c850d57d69e..b61fe9744927 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspaces_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspaces_operations.py @@ -283,7 +283,7 @@ def get_long_running_output(response): def _delete_initial( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, workspace_name, force=None, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -296,6 +296,8 @@ def _delete_initial( # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') # Construct headers header_parameters = {} @@ -320,14 +322,21 @@ def _delete_initial( return client_raw_response def delete( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a workspace instance. + self, resource_group_name, workspace_name, force=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a workspace resource. To recover the workspace, create it again + with the same name, in the same subscription, resource group and + location. The name is kept for 14 days and cannot be used for another + workspace. To remove the workspace completely and release the name, use + the force flag. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param workspace_name: The name of the workspace. :type workspace_name: str + :param force: Deletes the workspace without the recovery option. A + workspace that was deleted with this flag cannot be recovered. + :type force: bool :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -342,6 +351,7 @@ def delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, workspace_name=workspace_name, + force=force, custom_headers=custom_headers, raw=True, **operation_config @@ -490,65 +500,3 @@ def update( return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}'} - - def available_service_tiers( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """Gets the available service tiers for the workspace. - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace. - :type workspace_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: list or ClientRawResponse if raw=true - :rtype: list[~azure.mgmt.loganalytics.models.AvailableServiceTier] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.available_service_tiers.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[AvailableServiceTier]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - available_service_tiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers'} diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/setup.py b/sdk/loganalytics/azure-mgmt-loganalytics/setup.py index eea54942f3e7..ce8f42ec38f5 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/setup.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)