diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/_meta.json b/sdk/loganalytics/azure-mgmt-loganalytics/_meta.json index 8c13adfd1daa..9adede901794 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/_meta.json +++ b/sdk/loganalytics/azure-mgmt-loganalytics/_meta.json @@ -4,8 +4,8 @@ "@autorest/python@5.12.0", "@autorest/modelerfour@4.19.3" ], - "commit": "24b1f9ed9a0768a55b14cced1761a40f7c12b6d2", + "commit": "9743c24031f2c6f7de48e9f9068a988a4477f5ea", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/operationalinsights/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "autorest_command": "autorest specification/operationalinsights/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/operationalinsights/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_configuration.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_configuration.py index 085bd8a4b4f5..caef93c22897 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_configuration.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_configuration.py @@ -45,6 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2022-02-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-loganalytics/{}'.format(VERSION)) self._configure(**kwargs) 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 5717dd1dc590..3ac1c51525c6 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 @@ -15,7 +15,7 @@ from . import models from ._configuration import LogAnalyticsManagementClientConfiguration -from .operations import AvailableServiceTiersOperations, ClustersOperations, DataExportsOperations, DataSourcesOperations, DeletedWorkspacesOperations, GatewaysOperations, IntelligencePacksOperations, LinkedServicesOperations, LinkedStorageAccountsOperations, ManagementGroupsOperations, OperationStatusesOperations, Operations, SavedSearchesOperations, SchemaOperations, SharedKeysOperations, StorageInsightConfigsOperations, TablesOperations, UsagesOperations, WorkspacePurgeOperations, WorkspacesOperations +from .operations import DeletedWorkspacesOperations, Operations, TablesOperations, WorkspacesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -26,47 +26,12 @@ class LogAnalyticsManagementClient: :ivar operations: Operations operations :vartype operations: azure.mgmt.loganalytics.operations.Operations + :ivar tables: TablesOperations operations + :vartype tables: azure.mgmt.loganalytics.operations.TablesOperations :ivar workspaces: WorkspacesOperations operations :vartype workspaces: azure.mgmt.loganalytics.operations.WorkspacesOperations :ivar deleted_workspaces: DeletedWorkspacesOperations operations :vartype deleted_workspaces: azure.mgmt.loganalytics.operations.DeletedWorkspacesOperations - :ivar tables: TablesOperations operations - :vartype tables: azure.mgmt.loganalytics.operations.TablesOperations - :ivar data_exports: DataExportsOperations operations - :vartype data_exports: azure.mgmt.loganalytics.operations.DataExportsOperations - :ivar data_sources: DataSourcesOperations operations - :vartype data_sources: azure.mgmt.loganalytics.operations.DataSourcesOperations - :ivar intelligence_packs: IntelligencePacksOperations operations - :vartype intelligence_packs: azure.mgmt.loganalytics.operations.IntelligencePacksOperations - :ivar linked_services: LinkedServicesOperations operations - :vartype linked_services: azure.mgmt.loganalytics.operations.LinkedServicesOperations - :ivar linked_storage_accounts: LinkedStorageAccountsOperations operations - :vartype linked_storage_accounts: - azure.mgmt.loganalytics.operations.LinkedStorageAccountsOperations - :ivar management_groups: ManagementGroupsOperations operations - :vartype management_groups: azure.mgmt.loganalytics.operations.ManagementGroupsOperations - :ivar operation_statuses: OperationStatusesOperations operations - :vartype operation_statuses: azure.mgmt.loganalytics.operations.OperationStatusesOperations - :ivar shared_keys: SharedKeysOperations operations - :vartype shared_keys: azure.mgmt.loganalytics.operations.SharedKeysOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.loganalytics.operations.UsagesOperations - :ivar storage_insight_configs: StorageInsightConfigsOperations operations - :vartype storage_insight_configs: - azure.mgmt.loganalytics.operations.StorageInsightConfigsOperations - :ivar saved_searches: SavedSearchesOperations operations - :vartype saved_searches: azure.mgmt.loganalytics.operations.SavedSearchesOperations - :ivar available_service_tiers: AvailableServiceTiersOperations operations - :vartype available_service_tiers: - azure.mgmt.loganalytics.operations.AvailableServiceTiersOperations - :ivar gateways: GatewaysOperations operations - :vartype gateways: azure.mgmt.loganalytics.operations.GatewaysOperations - :ivar schema: SchemaOperations operations - :vartype schema: azure.mgmt.loganalytics.operations.SchemaOperations - :ivar workspace_purge: WorkspacePurgeOperations operations - :vartype workspace_purge: azure.mgmt.loganalytics.operations.WorkspacePurgeOperations - :ivar clusters: ClustersOperations operations - :vartype clusters: azure.mgmt.loganalytics.operations.ClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. @@ -92,25 +57,9 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.tables = TablesOperations(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.tables = TablesOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_exports = DataExportsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_sources = DataSourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.intelligence_packs = IntelligencePacksOperations(self._client, self._config, self._serialize, self._deserialize) - self.linked_services = LinkedServicesOperations(self._client, self._config, self._serialize, self._deserialize) - self.linked_storage_accounts = LinkedStorageAccountsOperations(self._client, self._config, self._serialize, self._deserialize) - self.management_groups = ManagementGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operation_statuses = OperationStatusesOperations(self._client, self._config, self._serialize, self._deserialize) - self.shared_keys = SharedKeysOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(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(self._client, self._config, self._serialize, self._deserialize) - self.workspace_purge = WorkspacePurgeOperations(self._client, self._config, self._serialize, self._deserialize) - self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_metadata.json b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_metadata.json index 964622710cbe..8b20d1e0a955 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_metadata.json +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "", - "total_api_version_list": ["2020-08-01", "2021-06-01", "2021-12-01-preview"], + "chosen_version": "2022-02-01", + "total_api_version_list": ["2022-02-01"], "client": { "name": "LogAnalyticsManagementClient", "filename": "_log_analytics_management_client", @@ -98,24 +98,8 @@ }, "operation_groups": { "operations": "Operations", - "workspaces": "WorkspacesOperations", - "deleted_workspaces": "DeletedWorkspacesOperations", "tables": "TablesOperations", - "data_exports": "DataExportsOperations", - "data_sources": "DataSourcesOperations", - "intelligence_packs": "IntelligencePacksOperations", - "linked_services": "LinkedServicesOperations", - "linked_storage_accounts": "LinkedStorageAccountsOperations", - "management_groups": "ManagementGroupsOperations", - "operation_statuses": "OperationStatusesOperations", - "shared_keys": "SharedKeysOperations", - "usages": "UsagesOperations", - "storage_insight_configs": "StorageInsightConfigsOperations", - "saved_searches": "SavedSearchesOperations", - "available_service_tiers": "AvailableServiceTiersOperations", - "gateways": "GatewaysOperations", - "schema": "SchemaOperations", - "workspace_purge": "WorkspacePurgeOperations", - "clusters": "ClustersOperations" + "workspaces": "WorkspacesOperations", + "deleted_workspaces": "DeletedWorkspacesOperations" } } \ No newline at end of file diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_version.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_version.py index 28cf8b467ac5..efe7276fe05f 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_version.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "13.0.0b2" +VERSION = "7.0.0b1" diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py index 2d5f005522d1..b47270802140 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py @@ -45,6 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2022-02-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-loganalytics/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_log_analytics_management_client.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_log_analytics_management_client.py index 6256f9c72c32..93413d246dba 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_log_analytics_management_client.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_log_analytics_management_client.py @@ -15,7 +15,7 @@ from .. import models from ._configuration import LogAnalyticsManagementClientConfiguration -from .operations import AvailableServiceTiersOperations, ClustersOperations, DataExportsOperations, DataSourcesOperations, DeletedWorkspacesOperations, GatewaysOperations, IntelligencePacksOperations, LinkedServicesOperations, LinkedStorageAccountsOperations, ManagementGroupsOperations, OperationStatusesOperations, Operations, SavedSearchesOperations, SchemaOperations, SharedKeysOperations, StorageInsightConfigsOperations, TablesOperations, UsagesOperations, WorkspacePurgeOperations, WorkspacesOperations +from .operations import DeletedWorkspacesOperations, Operations, TablesOperations, WorkspacesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -26,47 +26,12 @@ class LogAnalyticsManagementClient: :ivar operations: Operations operations :vartype operations: azure.mgmt.loganalytics.aio.operations.Operations + :ivar tables: TablesOperations operations + :vartype tables: azure.mgmt.loganalytics.aio.operations.TablesOperations :ivar workspaces: WorkspacesOperations operations :vartype workspaces: azure.mgmt.loganalytics.aio.operations.WorkspacesOperations :ivar deleted_workspaces: DeletedWorkspacesOperations operations :vartype deleted_workspaces: azure.mgmt.loganalytics.aio.operations.DeletedWorkspacesOperations - :ivar tables: TablesOperations operations - :vartype tables: azure.mgmt.loganalytics.aio.operations.TablesOperations - :ivar data_exports: DataExportsOperations operations - :vartype data_exports: azure.mgmt.loganalytics.aio.operations.DataExportsOperations - :ivar data_sources: DataSourcesOperations operations - :vartype data_sources: azure.mgmt.loganalytics.aio.operations.DataSourcesOperations - :ivar intelligence_packs: IntelligencePacksOperations operations - :vartype intelligence_packs: azure.mgmt.loganalytics.aio.operations.IntelligencePacksOperations - :ivar linked_services: LinkedServicesOperations operations - :vartype linked_services: azure.mgmt.loganalytics.aio.operations.LinkedServicesOperations - :ivar linked_storage_accounts: LinkedStorageAccountsOperations operations - :vartype linked_storage_accounts: - azure.mgmt.loganalytics.aio.operations.LinkedStorageAccountsOperations - :ivar management_groups: ManagementGroupsOperations operations - :vartype management_groups: azure.mgmt.loganalytics.aio.operations.ManagementGroupsOperations - :ivar operation_statuses: OperationStatusesOperations operations - :vartype operation_statuses: azure.mgmt.loganalytics.aio.operations.OperationStatusesOperations - :ivar shared_keys: SharedKeysOperations operations - :vartype shared_keys: azure.mgmt.loganalytics.aio.operations.SharedKeysOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.loganalytics.aio.operations.UsagesOperations - :ivar storage_insight_configs: StorageInsightConfigsOperations operations - :vartype storage_insight_configs: - azure.mgmt.loganalytics.aio.operations.StorageInsightConfigsOperations - :ivar saved_searches: SavedSearchesOperations operations - :vartype saved_searches: azure.mgmt.loganalytics.aio.operations.SavedSearchesOperations - :ivar available_service_tiers: AvailableServiceTiersOperations operations - :vartype available_service_tiers: - azure.mgmt.loganalytics.aio.operations.AvailableServiceTiersOperations - :ivar gateways: GatewaysOperations operations - :vartype gateways: azure.mgmt.loganalytics.aio.operations.GatewaysOperations - :ivar schema: SchemaOperations operations - :vartype schema: azure.mgmt.loganalytics.aio.operations.SchemaOperations - :ivar workspace_purge: WorkspacePurgeOperations operations - :vartype workspace_purge: azure.mgmt.loganalytics.aio.operations.WorkspacePurgeOperations - :ivar clusters: ClustersOperations operations - :vartype clusters: azure.mgmt.loganalytics.aio.operations.ClustersOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. @@ -92,25 +57,9 @@ def __init__( self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.tables = TablesOperations(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.tables = TablesOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_exports = DataExportsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_sources = DataSourcesOperations(self._client, self._config, self._serialize, self._deserialize) - self.intelligence_packs = IntelligencePacksOperations(self._client, self._config, self._serialize, self._deserialize) - self.linked_services = LinkedServicesOperations(self._client, self._config, self._serialize, self._deserialize) - self.linked_storage_accounts = LinkedStorageAccountsOperations(self._client, self._config, self._serialize, self._deserialize) - self.management_groups = ManagementGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operation_statuses = OperationStatusesOperations(self._client, self._config, self._serialize, self._deserialize) - self.shared_keys = SharedKeysOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(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(self._client, self._config, self._serialize, self._deserialize) - self.workspace_purge = WorkspacePurgeOperations(self._client, self._config, self._serialize, self._deserialize) - self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/__init__.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/__init__.py index 479da079c9c5..21057bbef220 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/__init__.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/__init__.py @@ -7,45 +7,13 @@ # -------------------------------------------------------------------------- from ._operations import Operations +from ._tables_operations import TablesOperations from ._workspaces_operations import WorkspacesOperations from ._deleted_workspaces_operations import DeletedWorkspacesOperations -from ._tables_operations import TablesOperations -from ._data_exports_operations import DataExportsOperations -from ._data_sources_operations import DataSourcesOperations -from ._intelligence_packs_operations import IntelligencePacksOperations -from ._linked_services_operations import LinkedServicesOperations -from ._linked_storage_accounts_operations import LinkedStorageAccountsOperations -from ._management_groups_operations import ManagementGroupsOperations -from ._operation_statuses_operations import OperationStatusesOperations -from ._shared_keys_operations import SharedKeysOperations -from ._usages_operations import UsagesOperations -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 -from ._clusters_operations import ClustersOperations __all__ = [ 'Operations', + 'TablesOperations', 'WorkspacesOperations', 'DeletedWorkspacesOperations', - 'TablesOperations', - 'DataExportsOperations', - 'DataSourcesOperations', - 'IntelligencePacksOperations', - 'LinkedServicesOperations', - 'LinkedStorageAccountsOperations', - 'ManagementGroupsOperations', - 'OperationStatusesOperations', - 'SharedKeysOperations', - 'UsagesOperations', - 'StorageInsightConfigsOperations', - 'SavedSearchesOperations', - 'AvailableServiceTiersOperations', - 'GatewaysOperations', - 'SchemaOperations', - 'WorkspacePurgeOperations', - 'ClustersOperations', ] diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_available_service_tiers_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_available_service_tiers_operations.py deleted file mode 100644 index 66ee66610067..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_available_service_tiers_operations.py +++ /dev/null @@ -1,96 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._available_service_tiers_operations import build_list_by_workspace_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class AvailableServiceTiersOperations: - """AvailableServiceTiersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> List["_models.AvailableServiceTier"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of AvailableServiceTier, or the result of cls(response) - :rtype: list[~azure.mgmt.loganalytics.models.AvailableServiceTier] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.AvailableServiceTier"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_by_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[AvailableServiceTier]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_clusters_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_clusters_operations.py deleted file mode 100644 index 24d73944b912..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_clusters_operations.py +++ /dev/null @@ -1,569 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._clusters_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_request, build_update_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ClustersOperations: - """ClustersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ClusterListResult"]: - """Gets Log Analytics clusters in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ClusterListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.loganalytics.models.ClusterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters'} # type: ignore - - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.ClusterListResult"]: - """Gets the Log Analytics clusters in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ClusterListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.loganalytics.models.ClusterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.Cluster", - **kwargs: Any - ) -> Optional["_models.Cluster"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Cluster"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'Cluster') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - cluster_name=cluster_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Cluster', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Cluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.Cluster", - **kwargs: Any - ) -> AsyncLROPoller["_models.Cluster"]: - """Create or update a Log Analytics cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: The name of the Log Analytics cluster. - :type cluster_name: str - :param parameters: The parameters required to create or update a Log Analytics cluster. - :type parameters: ~azure.mgmt.loganalytics.models.Cluster - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.loganalytics.models.Cluster] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Cluster', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a cluster instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: Name of the Log Analytics Cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> "_models.Cluster": - """Gets a Log Analytics cluster instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: Name of the Log Analytics Cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Cluster, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.Cluster - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Cluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - - async def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.ClusterPatch", - **kwargs: Any - ) -> "_models.Cluster": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterPatch') - - request = build_update_request_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Cluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.ClusterPatch", - **kwargs: Any - ) -> AsyncLROPoller["_models.Cluster"]: - """Updates a Log Analytics cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: Name of the Log Analytics Cluster. - :type cluster_name: str - :param parameters: The parameters required to patch a Log Analytics cluster. - :type parameters: ~azure.mgmt.loganalytics.models.ClusterPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.loganalytics.models.Cluster] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Cluster', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_exports_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_exports_operations.py deleted file mode 100644 index 1d9126b36f51..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_exports_operations.py +++ /dev/null @@ -1,299 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_exports_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_workspace_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataExportsOperations: - """DataExportsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.DataExportListResult"]: - """Lists the data export instances within a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataExportListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.loganalytics.models.DataExportListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataExportListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataExportListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports'} # type: ignore - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - data_export_name: str, - parameters: "_models.DataExport", - **kwargs: Any - ) -> "_models.DataExport": - """Create or update a data export. - - :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 data_export_name: The data export rule name. - :type data_export_name: str - :param parameters: The parameters required to create or update a data export. - :type parameters: ~azure.mgmt.loganalytics.models.DataExport - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataExport, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.DataExport - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataExport"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'DataExport') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_export_name=data_export_name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataExport', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataExport', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - data_export_name: str, - **kwargs: Any - ) -> "_models.DataExport": - """Gets a data export instance. - - :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 data_export_name: The data export rule name. - :type data_export_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataExport, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.DataExport - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataExport"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_export_name=data_export_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataExport', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}'} # type: ignore - - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - data_export_name: str, - **kwargs: Any - ) -> None: - """Deletes the specified data export in a given 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 data_export_name: The data export rule name. - :type data_export_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_export_name=data_export_name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_sources_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_sources_operations.py deleted file mode 100644 index ec28b9132fe3..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_sources_operations.py +++ /dev/null @@ -1,305 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._data_sources_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_workspace_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DataSourcesOperations: - """DataSourcesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - data_source_name: str, - parameters: "_models.DataSource", - **kwargs: Any - ) -> "_models.DataSource": - """Create or update a data source. - - :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 data_source_name: The name of the datasource resource. - :type data_source_name: str - :param parameters: The parameters required to create or update a datasource. - :type parameters: ~azure.mgmt.loganalytics.models.DataSource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSource, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.DataSource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataSource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'DataSource') - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_name=data_source_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataSource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataSource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}'} # type: ignore - - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - data_source_name: str, - **kwargs: Any - ) -> None: - """Deletes a data source instance. - - :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 data_source_name: Name of the datasource. - :type data_source_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_name=data_source_name, - subscription_id=self._config.subscription_id, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - data_source_name: str, - **kwargs: Any - ) -> "_models.DataSource": - """Gets a datasource instance. - - :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 data_source_name: Name of the datasource. - :type data_source_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSource, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.DataSource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataSource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_name=data_source_name, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataSource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}'} # type: ignore - - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - filter: str, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.DataSourceListResult"]: - """Gets the first page of data source instances in a workspace with the link to the next page. - - :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 filter: The filter to apply on the operation. - :type filter: str - :param skiptoken: Starting point of the collection of data source instances. - :type skiptoken: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataSourceListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.loganalytics.models.DataSourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataSourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - filter=filter, - skiptoken=skiptoken, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - filter=filter, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataSourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_gateways_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_gateways_operations.py deleted file mode 100644 index a95ab84604cc..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_gateways_operations.py +++ /dev/null @@ -1,96 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._gateways_operations import build_delete_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class GatewaysOperations: - """GatewaysOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - gateway_id: str, - **kwargs: Any - ) -> None: - """Delete a Log Analytics gateway. - - :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 gateway_id: The Log Analytics gateway Id. - :type gateway_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - gateway_id=gateway_id, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_intelligence_packs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_intelligence_packs_operations.py deleted file mode 100644 index 72c9a0aee83c..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_intelligence_packs_operations.py +++ /dev/null @@ -1,199 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._intelligence_packs_operations import build_disable_request, build_enable_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class IntelligencePacksOperations: - """IntelligencePacksOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def disable( - self, - resource_group_name: str, - workspace_name: str, - intelligence_pack_name: str, - **kwargs: Any - ) -> None: - """Disables an intelligence pack for a given 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 intelligence_pack_name: The name of the intelligence pack to be disabled. - :type intelligence_pack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_disable_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - intelligence_pack_name=intelligence_pack_name, - subscription_id=self._config.subscription_id, - template_url=self.disable.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable'} # type: ignore - - - @distributed_trace_async - async def enable( - self, - resource_group_name: str, - workspace_name: str, - intelligence_pack_name: str, - **kwargs: Any - ) -> None: - """Enables an intelligence pack for a given 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 intelligence_pack_name: The name of the intelligence pack to be enabled. - :type intelligence_pack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_enable_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - intelligence_pack_name=intelligence_pack_name, - subscription_id=self._config.subscription_id, - template_url=self.enable.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - enable.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable'} # type: ignore - - - @distributed_trace_async - async def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> List["_models.IntelligencePack"]: - """Lists all the intelligence packs possible and whether they are enabled or disabled for a given - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of IntelligencePack, or the result of cls(response) - :rtype: list[~azure.mgmt.loganalytics.models.IntelligencePack] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.IntelligencePack"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[IntelligencePack]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_services_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_services_operations.py deleted file mode 100644 index f0c89c5ac63b..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_services_operations.py +++ /dev/null @@ -1,418 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._linked_services_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_workspace_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LinkedServicesOperations: - """LinkedServicesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - parameters: "_models.LinkedService", - **kwargs: Any - ) -> Optional["_models.LinkedService"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LinkedService"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'LinkedService') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - linked_service_name=linked_service_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('LinkedService', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('LinkedService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - parameters: "_models.LinkedService", - **kwargs: Any - ) -> AsyncLROPoller["_models.LinkedService"]: - """Create or update a linked service. - - :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 linked_service_name: Name of the linkedServices resource. - :type linked_service_name: str - :param parameters: The parameters required to create or update a linked service. - :type parameters: ~azure.mgmt.loganalytics.models.LinkedService - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LinkedService or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.loganalytics.models.LinkedService] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedService"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - linked_service_name=linked_service_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LinkedService', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - **kwargs: Any - ) -> Optional["_models.LinkedService"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LinkedService"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - linked_service_name=linked_service_name, - subscription_id=self._config.subscription_id, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('LinkedService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} # type: ignore - - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.LinkedService"]: - """Deletes a linked service instance. - - :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 linked_service_name: Name of the linked service. - :type linked_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LinkedService or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.loganalytics.models.LinkedService] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedService"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - linked_service_name=linked_service_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LinkedService', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - **kwargs: Any - ) -> "_models.LinkedService": - """Gets a linked service instance. - - :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 linked_service_name: Name of the linked service. - :type linked_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LinkedService, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.LinkedService - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedService"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - linked_service_name=linked_service_name, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LinkedService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} # type: ignore - - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.LinkedServiceListResult"]: - """Gets the linked services instances in a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LinkedServiceListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.loganalytics.models.LinkedServiceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedServiceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LinkedServiceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_storage_accounts_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_storage_accounts_operations.py deleted file mode 100644 index 8979093c138c..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_storage_accounts_operations.py +++ /dev/null @@ -1,295 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._linked_storage_accounts_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_workspace_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LinkedStorageAccountsOperations: - """LinkedStorageAccountsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - data_source_type: Union[str, "_models.DataSourceType"], - parameters: "_models.LinkedStorageAccountsResource", - **kwargs: Any - ) -> "_models.LinkedStorageAccountsResource": - """Create or Update a link relation between current workspace and a group of storage accounts of a - specific data source type. - - :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 data_source_type: Linked storage accounts type. - :type data_source_type: str or ~azure.mgmt.loganalytics.models.DataSourceType - :param parameters: The parameters required to create or update linked storage accounts. - :type parameters: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LinkedStorageAccountsResource, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedStorageAccountsResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'LinkedStorageAccountsResource') - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_type=data_source_type, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LinkedStorageAccountsResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}'} # type: ignore - - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - data_source_type: Union[str, "_models.DataSourceType"], - **kwargs: Any - ) -> None: - """Deletes all linked storage accounts of a specific data source type associated with the - specified 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 data_source_type: Linked storage accounts type. - :type data_source_type: str or ~azure.mgmt.loganalytics.models.DataSourceType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_type=data_source_type, - subscription_id=self._config.subscription_id, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - data_source_type: Union[str, "_models.DataSourceType"], - **kwargs: Any - ) -> "_models.LinkedStorageAccountsResource": - """Gets all linked storage account of a specific data source type associated with the specified - 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 data_source_type: Linked storage accounts type. - :type data_source_type: str or ~azure.mgmt.loganalytics.models.DataSourceType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LinkedStorageAccountsResource, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedStorageAccountsResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_type=data_source_type, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LinkedStorageAccountsResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}'} # type: ignore - - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.LinkedStorageAccountsListResult"]: - """Gets all linked storage accounts associated with the specified workspace, storage accounts will - be sorted by their data source type. - - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LinkedStorageAccountsListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.loganalytics.models.LinkedStorageAccountsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedStorageAccountsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LinkedStorageAccountsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_management_groups_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_management_groups_operations.py deleted file mode 100644 index 456a87f940a4..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_management_groups_operations.py +++ /dev/null @@ -1,122 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._management_groups_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ManagementGroupsOperations: - """ManagementGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListManagementGroupsResult"]: - """Gets a list of management groups connected to a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListManagementGroupsResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.loganalytics.models.WorkspaceListManagementGroupsResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListManagementGroupsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListManagementGroupsResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operation_statuses_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operation_statuses_operations.py deleted file mode 100644 index a4f76742d1ac..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operation_statuses_operations.py +++ /dev/null @@ -1,96 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operation_statuses_operations import build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class OperationStatusesOperations: - """OperationStatusesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get( - self, - location: str, - async_operation_id: str, - **kwargs: Any - ) -> "_models.OperationStatus": - """Get the status of a long running azure asynchronous operation. - - :param location: The region name of operation. - :type location: str - :param async_operation_id: The operation Id. - :type async_operation_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationStatus, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.OperationStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - location=location, - async_operation_id=async_operation_id, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_saved_searches_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_saved_searches_operations.py deleted file mode 100644 index cd2cc0dc5a37..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_saved_searches_operations.py +++ /dev/null @@ -1,265 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._saved_searches_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_workspace_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SavedSearchesOperations: - """SavedSearchesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - saved_search_id: str, - **kwargs: Any - ) -> None: - """Deletes the specified saved search in a given 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 saved_search_id: The id of the saved search. - :type saved_search_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - saved_search_id=saved_search_id, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}'} # type: ignore - - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - saved_search_id: str, - parameters: "_models.SavedSearch", - **kwargs: Any - ) -> "_models.SavedSearch": - """Creates or updates a saved search for a given 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 saved_search_id: The id of the saved search. - :type saved_search_id: str - :param parameters: The parameters required to save a search. - :type parameters: ~azure.mgmt.loganalytics.models.SavedSearch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SavedSearch, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SavedSearch - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SavedSearch"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'SavedSearch') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - saved_search_id=saved_search_id, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SavedSearch', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - saved_search_id: str, - **kwargs: Any - ) -> "_models.SavedSearch": - """Gets the specified saved search for a given 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 saved_search_id: The id of the saved search. - :type saved_search_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SavedSearch, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SavedSearch - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SavedSearch"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - saved_search_id=saved_search_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SavedSearch', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}'} # type: ignore - - - @distributed_trace_async - async def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.SavedSearchesListResult": - """Gets the saved searches for a given Log Analytics 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SavedSearchesListResult, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SavedSearchesListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SavedSearchesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SavedSearchesListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_schema_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_schema_operations.py deleted file mode 100644 index 07f00cee84f5..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_schema_operations.py +++ /dev/null @@ -1,96 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._schema_operations import build_get_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SchemaOperations: - """SchemaOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.SearchGetSchemaResponse": - """Gets the schema for a given 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchGetSchemaResponse, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SearchGetSchemaResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchGetSchemaResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SearchGetSchemaResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_shared_keys_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_shared_keys_operations.py deleted file mode 100644 index c7caab3d8060..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_shared_keys_operations.py +++ /dev/null @@ -1,148 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._shared_keys_operations import build_get_shared_keys_request, build_regenerate_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SharedKeysOperations: - """SharedKeysOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get_shared_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.SharedKeys": - """Gets the shared keys for a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SharedKeys, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SharedKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_shared_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.get_shared_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SharedKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_shared_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys'} # type: ignore - - - @distributed_trace_async - async def regenerate( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.SharedKeys": - """Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect - Microsoft Operational Insights agents to 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SharedKeys, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SharedKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_regenerate_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.regenerate.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SharedKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - regenerate.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_storage_insight_configs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_storage_insight_configs_operations.py deleted file mode 100644 index debaecc190a7..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_storage_insight_configs_operations.py +++ /dev/null @@ -1,295 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._storage_insight_configs_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_workspace_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class StorageInsightConfigsOperations: - """StorageInsightConfigsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - storage_insight_name: str, - parameters: "_models.StorageInsight", - **kwargs: Any - ) -> "_models.StorageInsight": - """Create or update a storage insight. - - :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 storage_insight_name: Name of the storageInsightsConfigs resource. - :type storage_insight_name: str - :param parameters: The parameters required to create or update a storage insight. - :type parameters: ~azure.mgmt.loganalytics.models.StorageInsight - :keyword callable cls: A custom type or function that will be passed the direct response - :return: StorageInsight, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.StorageInsight - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageInsight"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'StorageInsight') - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - storage_insight_name=storage_insight_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('StorageInsight', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('StorageInsight', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'} # type: ignore - - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - workspace_name: str, - storage_insight_name: str, - **kwargs: Any - ) -> "_models.StorageInsight": - """Gets a storage insight instance. - - :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 storage_insight_name: Name of the storageInsightsConfigs resource. - :type storage_insight_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: StorageInsight, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.StorageInsight - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageInsight"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - storage_insight_name=storage_insight_name, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('StorageInsight', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'} # type: ignore - - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - workspace_name: str, - storage_insight_name: str, - **kwargs: Any - ) -> None: - """Deletes a storageInsightsConfigs resource. - - :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 storage_insight_name: Name of the storageInsightsConfigs resource. - :type storage_insight_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - storage_insight_name=storage_insight_name, - subscription_id=self._config.subscription_id, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'} # type: ignore - - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.StorageInsightListResult"]: - """Lists the storage insight instances within a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StorageInsightListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.loganalytics.models.StorageInsightListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageInsightListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("StorageInsightListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_usages_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_usages_operations.py deleted file mode 100644 index 41fe53c7f1fe..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_usages_operations.py +++ /dev/null @@ -1,122 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._usages_operations import build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class UsagesOperations: - """UsagesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.WorkspaceListUsagesResult"]: - """Gets a list of usage metrics for a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListUsagesResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.loganalytics.models.WorkspaceListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspace_purge_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspace_purge_operations.py deleted file mode 100644 index d4b38b6364ee..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspace_purge_operations.py +++ /dev/null @@ -1,170 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._workspace_purge_operations import build_get_purge_status_request, build_purge_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class WorkspacePurgeOperations: - """WorkspacePurgeOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def purge( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspacePurgeBody", - **kwargs: Any - ) -> "_models.WorkspacePurgeResponse": - """Purges data in an Log Analytics workspace by a set of user-defined filters. - - In order to manage system resources, purge requests are throttled at 50 requests per hour. You - should batch the execution of purge requests by sending a single command whose predicate - includes all user identities that require purging. Use the in operator to specify multiple - identities. You should run the query prior to using for a purge request to verify that the - results are expected. - - :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 body: Describes the body of a request to purge data in a single table of an Log - Analytics Workspace. - :type body: ~azure.mgmt.loganalytics.models.WorkspacePurgeBody - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspacePurgeResponse, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.WorkspacePurgeResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspacePurgeResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspacePurgeBody') - - request = build_purge_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - workspace_name=workspace_name, - content_type=content_type, - json=_json, - template_url=self.purge.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-status-location']=self._deserialize('str', response.headers.get('x-ms-status-location')) - - deserialized = self._deserialize('WorkspacePurgeResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge'} # type: ignore - - - @distributed_trace_async - async def get_purge_status( - self, - resource_group_name: str, - workspace_name: str, - purge_id: str, - **kwargs: Any - ) -> "_models.WorkspacePurgeStatusResponse": - """Gets status of an ongoing purge operation. - - :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 purge_id: In a purge status request, this is the Id of the operation the status of which - is returned. - :type purge_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspacePurgeStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.WorkspacePurgeStatusResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspacePurgeStatusResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_purge_status_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - workspace_name=workspace_name, - purge_id=purge_id, - template_url=self.get_purge_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspacePurgeStatusResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py index 37678e63343a..a4c1e87d8154 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py @@ -6,200 +6,86 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._models_py3 import AssociatedWorkspace -from ._models_py3 import AvailableServiceTier from ._models_py3 import AzureEntityResource -from ._models_py3 import CapacityReservationProperties -from ._models_py3 import Cluster -from ._models_py3 import ClusterListResult -from ._models_py3 import ClusterPatch -from ._models_py3 import ClusterSku from ._models_py3 import Column -from ._models_py3 import CoreSummary -from ._models_py3 import DataExport -from ._models_py3 import DataExportListResult -from ._models_py3 import DataSource -from ._models_py3 import DataSourceFilter -from ._models_py3 import DataSourceListResult from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse -from ._models_py3 import Identity -from ._models_py3 import IntelligencePack -from ._models_py3 import KeyVaultProperties -from ._models_py3 import LinkedService -from ._models_py3 import LinkedServiceListResult -from ._models_py3 import LinkedStorageAccountsListResult -from ._models_py3 import LinkedStorageAccountsResource -from ._models_py3 import ManagementGroup -from ._models_py3 import MetricName from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult -from ._models_py3 import OperationStatus from ._models_py3 import PrivateLinkScopedResource from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import RestoredLogs from ._models_py3 import ResultStatistics -from ._models_py3 import SavedSearch -from ._models_py3 import SavedSearchesListResult from ._models_py3 import Schema -from ._models_py3 import SearchGetSchemaResponse -from ._models_py3 import SearchMetadata -from ._models_py3 import SearchMetadataSchema from ._models_py3 import SearchResults -from ._models_py3 import SearchSchemaValue -from ._models_py3 import SearchSort -from ._models_py3 import SharedKeys -from ._models_py3 import StorageAccount -from ._models_py3 import StorageInsight -from ._models_py3 import StorageInsightListResult -from ._models_py3 import StorageInsightStatus from ._models_py3 import SystemData from ._models_py3 import Table from ._models_py3 import TablesListResult -from ._models_py3 import Tag from ._models_py3 import TrackedResource -from ._models_py3 import UsageMetric -from ._models_py3 import UserIdentityProperties from ._models_py3 import Workspace from ._models_py3 import WorkspaceCapping from ._models_py3 import WorkspaceFeatures -from ._models_py3 import WorkspaceListManagementGroupsResult from ._models_py3 import WorkspaceListResult -from ._models_py3 import WorkspaceListUsagesResult from ._models_py3 import WorkspacePatch -from ._models_py3 import WorkspacePurgeBody -from ._models_py3 import WorkspacePurgeBodyFilters -from ._models_py3 import WorkspacePurgeResponse -from ._models_py3 import WorkspacePurgeStatusResponse from ._models_py3 import WorkspaceSku from ._log_analytics_management_client_enums import ( - BillingType, - Capacity, CapacityReservationLevel, - ClusterEntityStatus, - ClusterSkuNameEnum, ColumnDataTypeHintEnum, ColumnTypeEnum, CreatedByType, DataIngestionStatus, - DataSourceKind, - DataSourceType, - IdentityType, - LinkedServiceEntityStatus, ProvisioningStateEnum, PublicNetworkAccessType, - PurgeState, - SearchSortEnum, - SkuNameEnum, SourceEnum, - StorageInsightState, TablePlanEnum, TableSubTypeEnum, TableTypeEnum, - Type, WorkspaceEntityStatus, WorkspaceSkuNameEnum, ) __all__ = [ - 'AssociatedWorkspace', - 'AvailableServiceTier', 'AzureEntityResource', - 'CapacityReservationProperties', - 'Cluster', - 'ClusterListResult', - 'ClusterPatch', - 'ClusterSku', 'Column', - 'CoreSummary', - 'DataExport', - 'DataExportListResult', - 'DataSource', - 'DataSourceFilter', - 'DataSourceListResult', 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', - 'Identity', - 'IntelligencePack', - 'KeyVaultProperties', - 'LinkedService', - 'LinkedServiceListResult', - 'LinkedStorageAccountsListResult', - 'LinkedStorageAccountsResource', - 'ManagementGroup', - 'MetricName', 'Operation', 'OperationDisplay', 'OperationListResult', - 'OperationStatus', 'PrivateLinkScopedResource', 'ProxyResource', 'Resource', 'RestoredLogs', 'ResultStatistics', - 'SavedSearch', - 'SavedSearchesListResult', 'Schema', - 'SearchGetSchemaResponse', - 'SearchMetadata', - 'SearchMetadataSchema', 'SearchResults', - 'SearchSchemaValue', - 'SearchSort', - 'SharedKeys', - 'StorageAccount', - 'StorageInsight', - 'StorageInsightListResult', - 'StorageInsightStatus', 'SystemData', 'Table', 'TablesListResult', - 'Tag', 'TrackedResource', - 'UsageMetric', - 'UserIdentityProperties', 'Workspace', 'WorkspaceCapping', 'WorkspaceFeatures', - 'WorkspaceListManagementGroupsResult', 'WorkspaceListResult', - 'WorkspaceListUsagesResult', 'WorkspacePatch', - 'WorkspacePurgeBody', - 'WorkspacePurgeBodyFilters', - 'WorkspacePurgeResponse', - 'WorkspacePurgeStatusResponse', 'WorkspaceSku', - 'BillingType', - 'Capacity', 'CapacityReservationLevel', - 'ClusterEntityStatus', - 'ClusterSkuNameEnum', 'ColumnDataTypeHintEnum', 'ColumnTypeEnum', 'CreatedByType', 'DataIngestionStatus', - 'DataSourceKind', - 'DataSourceType', - 'IdentityType', - 'LinkedServiceEntityStatus', 'ProvisioningStateEnum', 'PublicNetworkAccessType', - 'PurgeState', - 'SearchSortEnum', - 'SkuNameEnum', 'SourceEnum', - 'StorageInsightState', 'TablePlanEnum', 'TableSubTypeEnum', 'TableTypeEnum', - 'Type', 'WorkspaceEntityStatus', 'WorkspaceSkuNameEnum', ] diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_log_analytics_management_client_enums.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_log_analytics_management_client_enums.py index 65a784c72eeb..94daa9ee4931 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_log_analytics_management_client_enums.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_log_analytics_management_client_enums.py @@ -11,24 +11,6 @@ from azure.core import CaseInsensitiveEnumMeta -class BillingType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Configures whether billing will be only on the cluster or each workspace will be billed by its - proportional use. This does not change the overall billing, only how it will be distributed. - Default value is 'Cluster' - """ - - CLUSTER = "Cluster" - WORKSPACES = "Workspaces" - -class Capacity(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): - """The capacity value - """ - - FIVE_HUNDRED = 500 - TEN_HUNDRED = 1000 - TWO_THOUSAND = 2000 - FIVE_THOUSAND = 5000 - class CapacityReservationLevel(with_metaclass(CaseInsensitiveEnumMeta, int, Enum)): """The capacity reservation level in GB for this workspace, when CapacityReservation sku is selected. @@ -43,24 +25,6 @@ class CapacityReservationLevel(with_metaclass(CaseInsensitiveEnumMeta, int, Enum TWO_THOUSAND = 2000 FIVE_THOUSAND = 5000 -class ClusterEntityStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The provisioning state of the cluster. - """ - - CREATING = "Creating" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - DELETING = "Deleting" - PROVISIONING_ACCOUNT = "ProvisioningAccount" - UPDATING = "Updating" - -class ClusterSkuNameEnum(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The name of the SKU. - """ - - CAPACITY_RESERVATION = "CapacityReservation" - class ColumnDataTypeHintEnum(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Column data type logical hint. """ @@ -115,70 +79,6 @@ class DataIngestionStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: 80% of daily cap quota reached. APPROACHING_QUOTA = "ApproachingQuota" -class DataSourceKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The kind of the DataSource. - """ - - WINDOWS_EVENT = "WindowsEvent" - WINDOWS_PERFORMANCE_COUNTER = "WindowsPerformanceCounter" - IIS_LOGS = "IISLogs" - LINUX_SYSLOG = "LinuxSyslog" - LINUX_SYSLOG_COLLECTION = "LinuxSyslogCollection" - LINUX_PERFORMANCE_OBJECT = "LinuxPerformanceObject" - LINUX_PERFORMANCE_COLLECTION = "LinuxPerformanceCollection" - CUSTOM_LOG = "CustomLog" - CUSTOM_LOG_COLLECTION = "CustomLogCollection" - AZURE_AUDIT_LOG = "AzureAuditLog" - AZURE_ACTIVITY_LOG = "AzureActivityLog" - GENERIC_DATA_SOURCE = "GenericDataSource" - CHANGE_TRACKING_CUSTOM_PATH = "ChangeTrackingCustomPath" - CHANGE_TRACKING_PATH = "ChangeTrackingPath" - CHANGE_TRACKING_SERVICES = "ChangeTrackingServices" - CHANGE_TRACKING_DATA_TYPE_CONFIGURATION = "ChangeTrackingDataTypeConfiguration" - CHANGE_TRACKING_DEFAULT_REGISTRY = "ChangeTrackingDefaultRegistry" - CHANGE_TRACKING_REGISTRY = "ChangeTrackingRegistry" - CHANGE_TRACKING_LINUX_PATH = "ChangeTrackingLinuxPath" - LINUX_CHANGE_TRACKING_PATH = "LinuxChangeTrackingPath" - CHANGE_TRACKING_CONTENT_LOCATION = "ChangeTrackingContentLocation" - WINDOWS_TELEMETRY = "WindowsTelemetry" - OFFICE365 = "Office365" - SECURITY_WINDOWS_BASELINE_CONFIGURATION = "SecurityWindowsBaselineConfiguration" - SECURITY_CENTER_SECURITY_WINDOWS_BASELINE_CONFIGURATION = "SecurityCenterSecurityWindowsBaselineConfiguration" - SECURITY_EVENT_COLLECTION_CONFIGURATION = "SecurityEventCollectionConfiguration" - SECURITY_INSIGHTS_SECURITY_EVENT_COLLECTION_CONFIGURATION = "SecurityInsightsSecurityEventCollectionConfiguration" - IMPORT_COMPUTER_GROUP = "ImportComputerGroup" - NETWORK_MONITORING = "NetworkMonitoring" - ITSM = "Itsm" - DNS_ANALYTICS = "DnsAnalytics" - APPLICATION_INSIGHTS = "ApplicationInsights" - SQL_DATA_CLASSIFICATION = "SqlDataClassification" - -class DataSourceType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Linked storage accounts type. - """ - - CUSTOM_LOGS = "CustomLogs" - AZURE_WATSON = "AzureWatson" - QUERY = "Query" - ALERTS = "Alerts" - -class IdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of managed service identity. - """ - - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - NONE = "None" - -class LinkedServiceEntityStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The provisioning state of the linked service. - """ - - SUCCEEDED = "Succeeded" - DELETING = "Deleting" - PROVISIONING_ACCOUNT = "ProvisioningAccount" - UPDATING = "Updating" - class ProvisioningStateEnum(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Table's current provisioning state. If set to 'updating', indicates a resource lock due to ongoing operation, forbidding any update to the table until the ongoing operation is concluded. @@ -201,32 +101,6 @@ class PublicNetworkAccessType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum) #: Disables public connectivity to Log Analytics through public DNS. DISABLED = "Disabled" -class PurgeState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Status of the operation represented by the requested Id. - """ - - PENDING = "pending" - COMPLETED = "completed" - -class SearchSortEnum(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The sort order of the search. - """ - - ASC = "asc" - DESC = "desc" - -class SkuNameEnum(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The name of the Service Tier. - """ - - FREE = "Free" - STANDARD = "Standard" - PREMIUM = "Premium" - PER_NODE = "PerNode" - PER_GB2018 = "PerGB2018" - STANDALONE = "Standalone" - CAPACITY_RESERVATION = "CapacityReservation" - class SourceEnum(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Table's creator. """ @@ -237,13 +111,6 @@ class SourceEnum(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Tables created by the owner of the Workspace, and only found in this Workspace. CUSTOMER = "customer" -class StorageInsightState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The state of the storage insight connection to the workspace - """ - - OK = "OK" - ERROR = "ERROR" - class TablePlanEnum(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """Instruct the system how to handle and charge the logs ingested to this table. """ @@ -281,13 +148,6 @@ class TableTypeEnum(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: Data collected by a search job. SEARCH_RESULTS = "SearchResults" -class Type(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of the destination resource - """ - - STORAGE_ACCOUNT = "StorageAccount" - EVENT_HUB = "EventHub" - class WorkspaceEntityStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The provisioning state of the workspace. """ 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 dc180fd51d1f..d1edd765002f 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 @@ -15,108 +15,6 @@ from ._log_analytics_management_client_enums import * -class AssociatedWorkspace(msrest.serialization.Model): - """The list of Log Analytics workspaces associated with the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar workspace_id: The id of the assigned workspace. - :vartype workspace_id: str - :ivar workspace_name: The name id the assigned workspace. - :vartype workspace_name: str - :ivar resource_id: The ResourceId id the assigned workspace. - :vartype resource_id: str - :ivar associate_date: The time of workspace association. - :vartype associate_date: str - """ - - _validation = { - 'workspace_id': {'readonly': True}, - 'workspace_name': {'readonly': True}, - 'resource_id': {'readonly': True}, - 'associate_date': {'readonly': True}, - } - - _attribute_map = { - 'workspace_id': {'key': 'workspaceId', 'type': 'str'}, - 'workspace_name': {'key': 'workspaceName', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'associate_date': {'key': 'associateDate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AssociatedWorkspace, self).__init__(**kwargs) - self.workspace_id = None - self.workspace_name = None - self.resource_id = None - self.associate_date = None - - -class AvailableServiceTier(msrest.serialization.Model): - """Service Tier details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar service_tier: The name of the Service Tier. Possible values include: "Free", "Standard", - "Premium", "PerNode", "PerGB2018", "Standalone", "CapacityReservation". - :vartype service_tier: str or ~azure.mgmt.loganalytics.models.SkuNameEnum - :ivar enabled: True if the Service Tier is enabled for the workspace. - :vartype enabled: bool - :ivar minimum_retention: The minimum retention for the Service Tier, in days. - :vartype minimum_retention: long - :ivar maximum_retention: The maximum retention for the Service Tier, in days. - :vartype maximum_retention: long - :ivar default_retention: The default retention for the Service Tier, in days. - :vartype default_retention: long - :ivar capacity_reservation_level: The capacity reservation level in GB per day. Returned for - the Capacity Reservation Service Tier. - :vartype capacity_reservation_level: long - :ivar last_sku_update: Time when the sku was last updated for the workspace. Returned for the - Capacity Reservation Service Tier. - :vartype last_sku_update: str - """ - - _validation = { - 'service_tier': {'readonly': True}, - 'enabled': {'readonly': True}, - 'minimum_retention': {'readonly': True}, - 'maximum_retention': {'readonly': True}, - 'default_retention': {'readonly': True}, - 'capacity_reservation_level': {'readonly': True}, - 'last_sku_update': {'readonly': True}, - } - - _attribute_map = { - 'service_tier': {'key': 'serviceTier', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'minimum_retention': {'key': 'minimumRetention', 'type': 'long'}, - 'maximum_retention': {'key': 'maximumRetention', 'type': 'long'}, - 'default_retention': {'key': 'defaultRetention', 'type': 'long'}, - 'capacity_reservation_level': {'key': 'capacityReservationLevel', 'type': 'long'}, - 'last_sku_update': {'key': 'lastSkuUpdate', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(AvailableServiceTier, self).__init__(**kwargs) - self.service_tier = None - self.enabled = None - self.minimum_retention = None - self.maximum_retention = None - self.default_retention = None - self.capacity_reservation_level = None - self.last_sku_update = None - - class Resource(msrest.serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. @@ -197,501 +95,331 @@ def __init__( self.etag = None -class CapacityReservationProperties(msrest.serialization.Model): - """The Capacity Reservation properties. +class Column(msrest.serialization.Model): + """Table column. Variables are only populated by the server, and will be ignored when sending a request. - :ivar last_sku_update: The last time Sku was updated. - :vartype last_sku_update: str - :ivar min_capacity: Minimum CapacityReservation value in GB. - :vartype min_capacity: long + :ivar name: Column name. + :vartype name: str + :ivar type: Column data type. Possible values include: "string", "int", "long", "real", + "boolean", "dateTime", "guid", "dynamic". + :vartype type: str or ~azure.mgmt.loganalytics.models.ColumnTypeEnum + :ivar data_type_hint: Column data type logical hint. Possible values include: "uri", "guid", + "armPath", "ip". + :vartype data_type_hint: str or ~azure.mgmt.loganalytics.models.ColumnDataTypeHintEnum + :ivar display_name: Column display name. + :vartype display_name: str + :ivar description: Column description. + :vartype description: str + :ivar is_default_display: Is displayed by default. + :vartype is_default_display: bool + :ivar is_hidden: Is column hidden. + :vartype is_hidden: bool """ _validation = { - 'last_sku_update': {'readonly': True}, - 'min_capacity': {'readonly': True}, + 'is_default_display': {'readonly': True}, + 'is_hidden': {'readonly': True}, } _attribute_map = { - 'last_sku_update': {'key': 'lastSkuUpdate', 'type': 'str'}, - 'min_capacity': {'key': 'minCapacity', 'type': 'long'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_type_hint': {'key': 'dataTypeHint', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'is_default_display': {'key': 'isDefaultDisplay', 'type': 'bool'}, + 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, } def __init__( self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "ColumnTypeEnum"]] = None, + data_type_hint: Optional[Union[str, "ColumnDataTypeHintEnum"]] = None, + display_name: Optional[str] = None, + description: Optional[str] = None, **kwargs ): """ + :keyword name: Column name. + :paramtype name: str + :keyword type: Column data type. Possible values include: "string", "int", "long", "real", + "boolean", "dateTime", "guid", "dynamic". + :paramtype type: str or ~azure.mgmt.loganalytics.models.ColumnTypeEnum + :keyword data_type_hint: Column data type logical hint. Possible values include: "uri", "guid", + "armPath", "ip". + :paramtype data_type_hint: str or ~azure.mgmt.loganalytics.models.ColumnDataTypeHintEnum + :keyword display_name: Column display name. + :paramtype display_name: str + :keyword description: Column description. + :paramtype description: str """ - super(CapacityReservationProperties, self).__init__(**kwargs) - self.last_sku_update = None - self.min_capacity = None + super(Column, self).__init__(**kwargs) + self.name = name + self.type = type + self.data_type_hint = data_type_hint + self.display_name = display_name + self.description = description + self.is_default_display = None + self.is_hidden = None -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The additional info type. :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str + :ivar info: The additional info. + :vartype info: any """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, + 'info': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__( self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, **kwargs ): """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None -class Cluster(TrackedResource): - """The top level Log Analytics cluster resource container. +class ErrorDetail(msrest.serialization.Model): + """The error detail. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.loganalytics.models.Identity - :ivar sku: The sku properties. - :vartype sku: ~azure.mgmt.loganalytics.models.ClusterSku - :ivar cluster_id: The ID associated with the cluster. - :vartype cluster_id: str - :ivar provisioning_state: The provisioning state of the cluster. Possible values include: - "Creating", "Succeeded", "Failed", "Canceled", "Deleting", "ProvisioningAccount", "Updating". - :vartype provisioning_state: str or ~azure.mgmt.loganalytics.models.ClusterEntityStatus - :ivar is_double_encryption_enabled: Configures whether cluster will use double encryption. This - Property can not be modified after cluster creation. Default value is 'true'. - :vartype is_double_encryption_enabled: bool - :ivar is_availability_zones_enabled: Sets whether the cluster will support availability zones. - This can be set as true only in regions where Azure Data Explorer support Availability Zones. - This Property can not be modified after cluster creation. Default value is 'true' if region - supports Availability Zones. - :vartype is_availability_zones_enabled: bool - :ivar billing_type: The cluster's billing type. Possible values include: "Cluster", - "Workspaces". - :vartype billing_type: str or ~azure.mgmt.loganalytics.models.BillingType - :ivar key_vault_properties: The associated key properties. - :vartype key_vault_properties: ~azure.mgmt.loganalytics.models.KeyVaultProperties - :ivar last_modified_date: The last time the cluster was updated. - :vartype last_modified_date: str - :ivar created_date: The cluster creation time. - :vartype created_date: str - :ivar associated_workspaces: The list of Log Analytics workspaces associated with the cluster. - :vartype associated_workspaces: list[~azure.mgmt.loganalytics.models.AssociatedWorkspace] - :ivar capacity_reservation_properties: Additional properties for capacity reservation. - :vartype capacity_reservation_properties: - ~azure.mgmt.loganalytics.models.CapacityReservationProperties + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.loganalytics.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.loganalytics.models.ErrorAdditionalInfo] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'cluster_id': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'last_modified_date': {'readonly': True}, - 'created_date': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'ClusterSku'}, - 'cluster_id': {'key': 'properties.clusterId', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'is_double_encryption_enabled': {'key': 'properties.isDoubleEncryptionEnabled', 'type': 'bool'}, - 'is_availability_zones_enabled': {'key': 'properties.isAvailabilityZonesEnabled', 'type': 'bool'}, - 'billing_type': {'key': 'properties.billingType', 'type': 'str'}, - 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'last_modified_date': {'key': 'properties.lastModifiedDate', 'type': 'str'}, - 'created_date': {'key': 'properties.createdDate', 'type': 'str'}, - 'associated_workspaces': {'key': 'properties.associatedWorkspaces', 'type': '[AssociatedWorkspace]'}, - 'capacity_reservation_properties': {'key': 'properties.capacityReservationProperties', 'type': 'CapacityReservationProperties'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__( self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["Identity"] = None, - sku: Optional["ClusterSku"] = None, - is_double_encryption_enabled: Optional[bool] = None, - is_availability_zones_enabled: Optional[bool] = None, - billing_type: Optional[Union[str, "BillingType"]] = None, - key_vault_properties: Optional["KeyVaultProperties"] = None, - associated_workspaces: Optional[List["AssociatedWorkspace"]] = None, - capacity_reservation_properties: Optional["CapacityReservationProperties"] = None, **kwargs ): """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.loganalytics.models.Identity - :keyword sku: The sku properties. - :paramtype sku: ~azure.mgmt.loganalytics.models.ClusterSku - :keyword is_double_encryption_enabled: Configures whether cluster will use double encryption. - This Property can not be modified after cluster creation. Default value is 'true'. - :paramtype is_double_encryption_enabled: bool - :keyword is_availability_zones_enabled: Sets whether the cluster will support availability - zones. This can be set as true only in regions where Azure Data Explorer support Availability - Zones. This Property can not be modified after cluster creation. Default value is 'true' if - region supports Availability Zones. - :paramtype is_availability_zones_enabled: bool - :keyword billing_type: The cluster's billing type. Possible values include: "Cluster", - "Workspaces". - :paramtype billing_type: str or ~azure.mgmt.loganalytics.models.BillingType - :keyword key_vault_properties: The associated key properties. - :paramtype key_vault_properties: ~azure.mgmt.loganalytics.models.KeyVaultProperties - :keyword associated_workspaces: The list of Log Analytics workspaces associated with the - cluster. - :paramtype associated_workspaces: list[~azure.mgmt.loganalytics.models.AssociatedWorkspace] - :keyword capacity_reservation_properties: Additional properties for capacity reservation. - :paramtype capacity_reservation_properties: - ~azure.mgmt.loganalytics.models.CapacityReservationProperties """ - super(Cluster, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.sku = sku - self.cluster_id = None - self.provisioning_state = None - self.is_double_encryption_enabled = is_double_encryption_enabled - self.is_availability_zones_enabled = is_availability_zones_enabled - self.billing_type = billing_type - self.key_vault_properties = key_vault_properties - self.last_modified_date = None - self.created_date = None - self.associated_workspaces = associated_workspaces - self.capacity_reservation_properties = capacity_reservation_properties + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None -class ClusterListResult(msrest.serialization.Model): - """The list clusters operation response. +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - :ivar next_link: The link used to get the next page of recommendations. - :vartype next_link: str - :ivar value: A list of Log Analytics clusters. - :vartype value: list[~azure.mgmt.loganalytics.models.Cluster] + :ivar error: The error object. + :vartype error: ~azure.mgmt.loganalytics.models.ErrorDetail """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[Cluster]'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, } def __init__( self, *, - next_link: Optional[str] = None, - value: Optional[List["Cluster"]] = None, + error: Optional["ErrorDetail"] = None, **kwargs ): """ - :keyword next_link: The link used to get the next page of recommendations. - :paramtype next_link: str - :keyword value: A list of Log Analytics clusters. - :paramtype value: list[~azure.mgmt.loganalytics.models.Cluster] + :keyword error: The error object. + :paramtype error: ~azure.mgmt.loganalytics.models.ErrorDetail """ - super(ClusterListResult, self).__init__(**kwargs) - self.next_link = next_link - self.value = value + super(ErrorResponse, self).__init__(**kwargs) + self.error = error -class ClusterPatch(msrest.serialization.Model): - """The top level Log Analytics cluster resource container. +class Operation(msrest.serialization.Model): + """Supported operation of OperationalInsights resource provider. - :ivar identity: The identity of the resource. - :vartype identity: ~azure.mgmt.loganalytics.models.Identity - :ivar sku: The sku properties. - :vartype sku: ~azure.mgmt.loganalytics.models.ClusterSku - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar key_vault_properties: The associated key properties. - :vartype key_vault_properties: ~azure.mgmt.loganalytics.models.KeyVaultProperties - :ivar billing_type: The cluster's billing type. Possible values include: "Cluster", - "Workspaces". - :vartype billing_type: str or ~azure.mgmt.loganalytics.models.BillingType + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :ivar display: Display metadata associated with the operation. + :vartype display: ~azure.mgmt.loganalytics.models.OperationDisplay """ _attribute_map = { - 'identity': {'key': 'identity', 'type': 'Identity'}, - 'sku': {'key': 'sku', 'type': 'ClusterSku'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'KeyVaultProperties'}, - 'billing_type': {'key': 'properties.billingType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, } def __init__( self, *, - identity: Optional["Identity"] = None, - sku: Optional["ClusterSku"] = None, - tags: Optional[Dict[str, str]] = None, - key_vault_properties: Optional["KeyVaultProperties"] = None, - billing_type: Optional[Union[str, "BillingType"]] = None, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, **kwargs ): """ - :keyword identity: The identity of the resource. - :paramtype identity: ~azure.mgmt.loganalytics.models.Identity - :keyword sku: The sku properties. - :paramtype sku: ~azure.mgmt.loganalytics.models.ClusterSku - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword key_vault_properties: The associated key properties. - :paramtype key_vault_properties: ~azure.mgmt.loganalytics.models.KeyVaultProperties - :keyword billing_type: The cluster's billing type. Possible values include: "Cluster", - "Workspaces". - :paramtype billing_type: str or ~azure.mgmt.loganalytics.models.BillingType + :keyword name: Operation name: {provider}/{resource}/{operation}. + :paramtype name: str + :keyword display: Display metadata associated with the operation. + :paramtype display: ~azure.mgmt.loganalytics.models.OperationDisplay """ - super(ClusterPatch, self).__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - self.key_vault_properties = key_vault_properties - self.billing_type = billing_type - - -class ClusterSku(msrest.serialization.Model): - """The cluster sku definition. + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display - :ivar capacity: The capacity value. Possible values include: 500, 1000, 2000, 5000. - :vartype capacity: int or ~azure.mgmt.loganalytics.models.Capacity - :ivar name: The name of the SKU. Possible values include: "CapacityReservation". - :vartype name: str or ~azure.mgmt.loganalytics.models.ClusterSkuNameEnum - """ - _attribute_map = { - 'capacity': {'key': 'capacity', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'str'}, - } +class OperationDisplay(msrest.serialization.Model): + """Display metadata associated with the operation. - def __init__( - self, - *, - capacity: Optional[Union[int, "Capacity"]] = None, - name: Optional[Union[str, "ClusterSkuNameEnum"]] = None, - **kwargs - ): - """ - :keyword capacity: The capacity value. Possible values include: 500, 1000, 2000, 5000. - :paramtype capacity: int or ~azure.mgmt.loganalytics.models.Capacity - :keyword name: The name of the SKU. Possible values include: "CapacityReservation". - :paramtype name: str or ~azure.mgmt.loganalytics.models.ClusterSkuNameEnum - """ - super(ClusterSku, self).__init__(**kwargs) - self.capacity = capacity - self.name = name - - -class Column(msrest.serialization.Model): - """Table column. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Column name. - :vartype name: str - :ivar type: Column data type. Possible values include: "string", "int", "long", "real", - "boolean", "dateTime", "guid", "dynamic". - :vartype type: str or ~azure.mgmt.loganalytics.models.ColumnTypeEnum - :ivar data_type_hint: Column data type logical hint. Possible values include: "uri", "guid", - "armPath", "ip". - :vartype data_type_hint: str or ~azure.mgmt.loganalytics.models.ColumnDataTypeHintEnum - :ivar display_name: Column display name. - :vartype display_name: str - :ivar description: Column description. + :ivar provider: Service provider: Microsoft OperationsManagement. + :vartype provider: str + :ivar resource: Resource on which the operation is performed etc. + :vartype resource: str + :ivar operation: Type of operation: get, read, delete, etc. + :vartype operation: str + :ivar description: Description of operation. :vartype description: str - :ivar is_default_display: Is displayed by default. - :vartype is_default_display: bool - :ivar is_hidden: Is column hidden. - :vartype is_hidden: bool """ - _validation = { - 'is_default_display': {'readonly': True}, - 'is_hidden': {'readonly': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'data_type_hint': {'key': 'dataTypeHint', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, - 'is_default_display': {'key': 'isDefaultDisplay', 'type': 'bool'}, - 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, } def __init__( self, *, - name: Optional[str] = None, - type: Optional[Union[str, "ColumnTypeEnum"]] = None, - data_type_hint: Optional[Union[str, "ColumnDataTypeHintEnum"]] = None, - display_name: Optional[str] = None, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, description: Optional[str] = None, **kwargs ): """ - :keyword name: Column name. - :paramtype name: str - :keyword type: Column data type. Possible values include: "string", "int", "long", "real", - "boolean", "dateTime", "guid", "dynamic". - :paramtype type: str or ~azure.mgmt.loganalytics.models.ColumnTypeEnum - :keyword data_type_hint: Column data type logical hint. Possible values include: "uri", "guid", - "armPath", "ip". - :paramtype data_type_hint: str or ~azure.mgmt.loganalytics.models.ColumnDataTypeHintEnum - :keyword display_name: Column display name. - :paramtype display_name: str - :keyword description: Column description. + :keyword provider: Service provider: Microsoft OperationsManagement. + :paramtype provider: str + :keyword resource: Resource on which the operation is performed etc. + :paramtype resource: str + :keyword operation: Type of operation: get, read, delete, etc. + :paramtype operation: str + :keyword description: Description of operation. :paramtype description: str """ - super(Column, self).__init__(**kwargs) - self.name = name - self.type = type - self.data_type_hint = data_type_hint - self.display_name = display_name + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation self.description = description - self.is_default_display = None - self.is_hidden = None -class CoreSummary(msrest.serialization.Model): - """The core summary of a search. +class OperationListResult(msrest.serialization.Model): + """Result of the request to list solution operations. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: The status of a core summary. - :vartype status: str - :ivar number_of_documents: Required. The number of documents of a core summary. - :vartype number_of_documents: long + :ivar value: List of solution operations supported by the OperationsManagement resource + provider. + :vartype value: list[~azure.mgmt.loganalytics.models.Operation] + :ivar next_link: URL to get the next set of operation list results if there are any. + :vartype next_link: str """ _validation = { - 'number_of_documents': {'required': True}, + 'next_link': {'readonly': True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'number_of_documents': {'key': 'numberOfDocuments', 'type': 'long'}, + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, - number_of_documents: int, - status: Optional[str] = None, + value: Optional[List["Operation"]] = None, **kwargs ): """ - :keyword status: The status of a core summary. - :paramtype status: str - :keyword number_of_documents: Required. The number of documents of a core summary. - :paramtype number_of_documents: long + :keyword value: List of solution operations supported by the OperationsManagement resource + provider. + :paramtype value: list[~azure.mgmt.loganalytics.models.Operation] """ - super(CoreSummary, self).__init__(**kwargs) - self.status = status - self.number_of_documents = number_of_documents - + super(OperationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - Variables are only populated by the server, and will be ignored when sending a request. +class PrivateLinkScopedResource(msrest.serialization.Model): + """The private link scope resource reference. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str + :ivar resource_id: The full resource Id of the private link scope resource. + :vartype resource_id: str + :ivar scope_id: The private link scope unique Identifier. + :vartype scope_id: str """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'scope_id': {'key': 'scopeId', 'type': 'str'}, } def __init__( self, + *, + resource_id: Optional[str] = None, + scope_id: Optional[str] = None, **kwargs ): """ + :keyword resource_id: The full resource Id of the private link scope resource. + :paramtype resource_id: str + :keyword scope_id: The private link scope unique Identifier. + :paramtype scope_id: str """ - super(ProxyResource, self).__init__(**kwargs) + super(PrivateLinkScopedResource, self).__init__(**kwargs) + self.resource_id = resource_id + self.scope_id = scope_id -class DataExport(ProxyResource): - """The top level data export resource container. +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. @@ -703,1909 +431,260 @@ class DataExport(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar data_export_id: The data export rule ID. - :vartype data_export_id: str - :ivar table_names: An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. - :vartype table_names: list[str] - :ivar enable: Active when enabled. - :vartype enable: bool - :ivar created_date: The latest data export rule modification time. - :vartype created_date: str - :ivar last_modified_date: Date and time when the export was last modified. - :vartype last_modified_date: str - :ivar resource_id: The destination resource ID. This can be copied from the Properties entry of - the destination resource in Azure. - :vartype resource_id: str - :ivar type_properties_destination_type: The type of the destination resource. Possible values - include: "StorageAccount", "EventHub". - :vartype type_properties_destination_type: str or ~azure.mgmt.loganalytics.models.Type - :ivar event_hub_name: Optional. Allows to define an Event Hub name. Not applicable when - destination is Storage Account. - :vartype event_hub_name: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'type_properties_destination_type': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'data_export_id': {'key': 'properties.dataExportId', 'type': 'str'}, - 'table_names': {'key': 'properties.tableNames', 'type': '[str]'}, - 'enable': {'key': 'properties.enable', 'type': 'bool'}, - 'created_date': {'key': 'properties.createdDate', 'type': 'str'}, - 'last_modified_date': {'key': 'properties.lastModifiedDate', 'type': 'str'}, - 'resource_id': {'key': 'properties.destination.resourceId', 'type': 'str'}, - 'type_properties_destination_type': {'key': 'properties.destination.type', 'type': 'str'}, - 'event_hub_name': {'key': 'properties.destination.metaData.eventHubName', 'type': 'str'}, } def __init__( self, - *, - data_export_id: Optional[str] = None, - table_names: Optional[List[str]] = None, - enable: Optional[bool] = None, - created_date: Optional[str] = None, - last_modified_date: Optional[str] = None, - resource_id: Optional[str] = None, - event_hub_name: Optional[str] = None, **kwargs ): """ - :keyword data_export_id: The data export rule ID. - :paramtype data_export_id: str - :keyword table_names: An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. - :paramtype table_names: list[str] - :keyword enable: Active when enabled. - :paramtype enable: bool - :keyword created_date: The latest data export rule modification time. - :paramtype created_date: str - :keyword last_modified_date: Date and time when the export was last modified. - :paramtype last_modified_date: str - :keyword resource_id: The destination resource ID. This can be copied from the Properties entry - of the destination resource in Azure. - :paramtype resource_id: str - :keyword event_hub_name: Optional. Allows to define an Event Hub name. Not applicable when - destination is Storage Account. - :paramtype event_hub_name: str """ - super(DataExport, self).__init__(**kwargs) - self.data_export_id = data_export_id - self.table_names = table_names - self.enable = enable - self.created_date = created_date - self.last_modified_date = last_modified_date - self.resource_id = resource_id - self.type_properties_destination_type = None - self.event_hub_name = event_hub_name + super(ProxyResource, self).__init__(**kwargs) -class DataExportListResult(msrest.serialization.Model): - """Result of the request to list data exports. +class RestoredLogs(msrest.serialization.Model): + """Restore parameters. - :ivar value: List of data export instances within a workspace.. - :vartype value: list[~azure.mgmt.loganalytics.models.DataExport] + :ivar start_restore_time: The timestamp to start the restore from (UTC). + :vartype start_restore_time: ~datetime.datetime + :ivar end_restore_time: The timestamp to end the restore by (UTC). + :vartype end_restore_time: ~datetime.datetime + :ivar source_table: The table to restore data from. + :vartype source_table: str """ _attribute_map = { - 'value': {'key': 'value', 'type': '[DataExport]'}, + 'start_restore_time': {'key': 'startRestoreTime', 'type': 'iso-8601'}, + 'end_restore_time': {'key': 'endRestoreTime', 'type': 'iso-8601'}, + 'source_table': {'key': 'sourceTable', 'type': 'str'}, } def __init__( self, *, - value: Optional[List["DataExport"]] = None, + start_restore_time: Optional[datetime.datetime] = None, + end_restore_time: Optional[datetime.datetime] = None, + source_table: Optional[str] = None, **kwargs ): """ - :keyword value: List of data export instances within a workspace.. - :paramtype value: list[~azure.mgmt.loganalytics.models.DataExport] + :keyword start_restore_time: The timestamp to start the restore from (UTC). + :paramtype start_restore_time: ~datetime.datetime + :keyword end_restore_time: The timestamp to end the restore by (UTC). + :paramtype end_restore_time: ~datetime.datetime + :keyword source_table: The table to restore data from. + :paramtype source_table: str """ - super(DataExportListResult, self).__init__(**kwargs) - self.value = value + super(RestoredLogs, self).__init__(**kwargs) + self.start_restore_time = start_restore_time + self.end_restore_time = end_restore_time + self.source_table = source_table -class DataSource(ProxyResource): - """Datasources under OMS Workspace. +class ResultStatistics(msrest.serialization.Model): + """Search job execution statistics. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar properties: Required. The data source properties in raw json format, each kind of data - source have it's own schema. - :vartype properties: any - :ivar etag: The ETag of the data source. - :vartype etag: str - :ivar kind: Required. The kind of the DataSource. Possible values include: "WindowsEvent", - "WindowsPerformanceCounter", "IISLogs", "LinuxSyslog", "LinuxSyslogCollection", - "LinuxPerformanceObject", "LinuxPerformanceCollection", "CustomLog", "CustomLogCollection", - "AzureAuditLog", "AzureActivityLog", "GenericDataSource", "ChangeTrackingCustomPath", - "ChangeTrackingPath", "ChangeTrackingServices", "ChangeTrackingDataTypeConfiguration", - "ChangeTrackingDefaultRegistry", "ChangeTrackingRegistry", "ChangeTrackingLinuxPath", - "LinuxChangeTrackingPath", "ChangeTrackingContentLocation", "WindowsTelemetry", "Office365", - "SecurityWindowsBaselineConfiguration", "SecurityCenterSecurityWindowsBaselineConfiguration", - "SecurityEventCollectionConfiguration", "SecurityInsightsSecurityEventCollectionConfiguration", - "ImportComputerGroup", "NetworkMonitoring", "Itsm", "DnsAnalytics", "ApplicationInsights", - "SqlDataClassification". - :vartype kind: str or ~azure.mgmt.loganalytics.models.DataSourceKind - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] + :ivar progress: Search job completion percentage. + :vartype progress: float + :ivar ingested_records: The number of rows that were returned by the search job. + :vartype ingested_records: int """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'properties': {'required': True}, - 'kind': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - properties: Any, - kind: Union[str, "DataSourceKind"], - etag: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword properties: Required. The data source properties in raw json format, each kind of data - source have it's own schema. - :paramtype properties: any - :keyword etag: The ETag of the data source. - :paramtype etag: str - :keyword kind: Required. The kind of the DataSource. Possible values include: "WindowsEvent", - "WindowsPerformanceCounter", "IISLogs", "LinuxSyslog", "LinuxSyslogCollection", - "LinuxPerformanceObject", "LinuxPerformanceCollection", "CustomLog", "CustomLogCollection", - "AzureAuditLog", "AzureActivityLog", "GenericDataSource", "ChangeTrackingCustomPath", - "ChangeTrackingPath", "ChangeTrackingServices", "ChangeTrackingDataTypeConfiguration", - "ChangeTrackingDefaultRegistry", "ChangeTrackingRegistry", "ChangeTrackingLinuxPath", - "LinuxChangeTrackingPath", "ChangeTrackingContentLocation", "WindowsTelemetry", "Office365", - "SecurityWindowsBaselineConfiguration", "SecurityCenterSecurityWindowsBaselineConfiguration", - "SecurityEventCollectionConfiguration", "SecurityInsightsSecurityEventCollectionConfiguration", - "ImportComputerGroup", "NetworkMonitoring", "Itsm", "DnsAnalytics", "ApplicationInsights", - "SqlDataClassification". - :paramtype kind: str or ~azure.mgmt.loganalytics.models.DataSourceKind - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(DataSource, self).__init__(**kwargs) - self.properties = properties - self.etag = etag - self.kind = kind - self.tags = tags - - -class DataSourceFilter(msrest.serialization.Model): - """DataSource filter. Right now, only filter by kind is supported. - - :ivar kind: The kind of the DataSource. Possible values include: "WindowsEvent", - "WindowsPerformanceCounter", "IISLogs", "LinuxSyslog", "LinuxSyslogCollection", - "LinuxPerformanceObject", "LinuxPerformanceCollection", "CustomLog", "CustomLogCollection", - "AzureAuditLog", "AzureActivityLog", "GenericDataSource", "ChangeTrackingCustomPath", - "ChangeTrackingPath", "ChangeTrackingServices", "ChangeTrackingDataTypeConfiguration", - "ChangeTrackingDefaultRegistry", "ChangeTrackingRegistry", "ChangeTrackingLinuxPath", - "LinuxChangeTrackingPath", "ChangeTrackingContentLocation", "WindowsTelemetry", "Office365", - "SecurityWindowsBaselineConfiguration", "SecurityCenterSecurityWindowsBaselineConfiguration", - "SecurityEventCollectionConfiguration", "SecurityInsightsSecurityEventCollectionConfiguration", - "ImportComputerGroup", "NetworkMonitoring", "Itsm", "DnsAnalytics", "ApplicationInsights", - "SqlDataClassification". - :vartype kind: str or ~azure.mgmt.loganalytics.models.DataSourceKind - """ - - _attribute_map = { - 'kind': {'key': 'kind', 'type': 'str'}, + 'progress': {'readonly': True, 'multiple': 0.01}, + 'ingested_records': {'readonly': True}, } - def __init__( - self, - *, - kind: Optional[Union[str, "DataSourceKind"]] = None, - **kwargs - ): - """ - :keyword kind: The kind of the DataSource. Possible values include: "WindowsEvent", - "WindowsPerformanceCounter", "IISLogs", "LinuxSyslog", "LinuxSyslogCollection", - "LinuxPerformanceObject", "LinuxPerformanceCollection", "CustomLog", "CustomLogCollection", - "AzureAuditLog", "AzureActivityLog", "GenericDataSource", "ChangeTrackingCustomPath", - "ChangeTrackingPath", "ChangeTrackingServices", "ChangeTrackingDataTypeConfiguration", - "ChangeTrackingDefaultRegistry", "ChangeTrackingRegistry", "ChangeTrackingLinuxPath", - "LinuxChangeTrackingPath", "ChangeTrackingContentLocation", "WindowsTelemetry", "Office365", - "SecurityWindowsBaselineConfiguration", "SecurityCenterSecurityWindowsBaselineConfiguration", - "SecurityEventCollectionConfiguration", "SecurityInsightsSecurityEventCollectionConfiguration", - "ImportComputerGroup", "NetworkMonitoring", "Itsm", "DnsAnalytics", "ApplicationInsights", - "SqlDataClassification". - :paramtype kind: str or ~azure.mgmt.loganalytics.models.DataSourceKind - """ - super(DataSourceFilter, self).__init__(**kwargs) - self.kind = kind - - -class DataSourceListResult(msrest.serialization.Model): - """The list data source by workspace operation response. - - :ivar value: A list of datasources. - :vartype value: list[~azure.mgmt.loganalytics.models.DataSource] - :ivar next_link: The link (url) to the next page of datasources. - :vartype next_link: str - """ - _attribute_map = { - 'value': {'key': 'value', 'type': '[DataSource]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'progress': {'key': 'progress', 'type': 'float'}, + 'ingested_records': {'key': 'ingestedRecords', 'type': 'int'}, } def __init__( self, - *, - value: Optional[List["DataSource"]] = None, - next_link: Optional[str] = None, **kwargs ): """ - :keyword value: A list of datasources. - :paramtype value: list[~azure.mgmt.loganalytics.models.DataSource] - :keyword next_link: The link (url) to the next page of datasources. - :paramtype next_link: str """ - super(DataSourceListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link + super(ResultStatistics, self).__init__(**kwargs) + self.progress = None + self.ingested_records = None -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. +class Schema(msrest.serialization.Model): + """Table's schema. Variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.loganalytics.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.loganalytics.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.loganalytics.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.loganalytics.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class Identity(msrest.serialization.Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The principal ID of resource identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of resource. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity. Possible values include: - "SystemAssigned", "UserAssigned", "None". - :vartype type: str or ~azure.mgmt.loganalytics.models.IdentityType - :ivar user_assigned_identities: The list of user identities associated with the resource. The - user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.loganalytics.models.UserIdentityProperties] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'}, - } - - def __init__( - self, - *, - type: Union[str, "IdentityType"], - user_assigned_identities: Optional[Dict[str, "UserIdentityProperties"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity. Possible values include: - "SystemAssigned", "UserAssigned", "None". - :paramtype type: str or ~azure.mgmt.loganalytics.models.IdentityType - :keyword user_assigned_identities: The list of user identities associated with the resource. - The user identity dictionary key references will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.loganalytics.models.UserIdentityProperties] - """ - super(Identity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class IntelligencePack(msrest.serialization.Model): - """Intelligence Pack containing a string name and boolean indicating if it's enabled. - - :ivar name: The name of the intelligence pack. - :vartype name: str - :ivar enabled: The enabled boolean for the intelligence pack. - :vartype enabled: bool - :ivar display_name: The display name of the intelligence pack. - :vartype display_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - enabled: Optional[bool] = None, - display_name: Optional[str] = None, - **kwargs - ): - """ - :keyword name: The name of the intelligence pack. - :paramtype name: str - :keyword enabled: The enabled boolean for the intelligence pack. - :paramtype enabled: bool - :keyword display_name: The display name of the intelligence pack. - :paramtype display_name: str - """ - super(IntelligencePack, self).__init__(**kwargs) - self.name = name - self.enabled = enabled - self.display_name = display_name - - -class KeyVaultProperties(msrest.serialization.Model): - """The key vault properties. - - :ivar key_vault_uri: The Key Vault uri which holds they key associated with the Log Analytics - cluster. - :vartype key_vault_uri: str - :ivar key_name: The name of the key associated with the Log Analytics cluster. - :vartype key_name: str - :ivar key_version: The version of the key associated with the Log Analytics cluster. - :vartype key_version: str - :ivar key_rsa_size: Selected key minimum required size. - :vartype key_rsa_size: int - """ - - _attribute_map = { - 'key_vault_uri': {'key': 'keyVaultUri', 'type': 'str'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'key_version': {'key': 'keyVersion', 'type': 'str'}, - 'key_rsa_size': {'key': 'keyRsaSize', 'type': 'int'}, - } - - def __init__( - self, - *, - key_vault_uri: Optional[str] = None, - key_name: Optional[str] = None, - key_version: Optional[str] = None, - key_rsa_size: Optional[int] = None, - **kwargs - ): - """ - :keyword key_vault_uri: The Key Vault uri which holds they key associated with the Log - Analytics cluster. - :paramtype key_vault_uri: str - :keyword key_name: The name of the key associated with the Log Analytics cluster. - :paramtype key_name: str - :keyword key_version: The version of the key associated with the Log Analytics cluster. - :paramtype key_version: str - :keyword key_rsa_size: Selected key minimum required size. - :paramtype key_rsa_size: int - """ - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_vault_uri = key_vault_uri - self.key_name = key_name - self.key_version = key_version - self.key_rsa_size = key_rsa_size - - -class LinkedService(ProxyResource): - """The top level Linked service resource container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar resource_id: The resource id of the resource that will be linked to the workspace. This - should be used for linking resources which require read access. - :vartype resource_id: str - :ivar write_access_resource_id: The resource id of the resource that will be linked to the - workspace. This should be used for linking resources which require write access. - :vartype write_access_resource_id: str - :ivar provisioning_state: The provisioning state of the linked service. Possible values - include: "Succeeded", "Deleting", "ProvisioningAccount", "Updating". - :vartype provisioning_state: str or ~azure.mgmt.loganalytics.models.LinkedServiceEntityStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, - 'write_access_resource_id': {'key': 'properties.writeAccessResourceId', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - resource_id: Optional[str] = None, - write_access_resource_id: Optional[str] = None, - provisioning_state: Optional[Union[str, "LinkedServiceEntityStatus"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword resource_id: The resource id of the resource that will be linked to the workspace. - This should be used for linking resources which require read access. - :paramtype resource_id: str - :keyword write_access_resource_id: The resource id of the resource that will be linked to the - workspace. This should be used for linking resources which require write access. - :paramtype write_access_resource_id: str - :keyword provisioning_state: The provisioning state of the linked service. Possible values - include: "Succeeded", "Deleting", "ProvisioningAccount", "Updating". - :paramtype provisioning_state: str or ~azure.mgmt.loganalytics.models.LinkedServiceEntityStatus - """ - super(LinkedService, self).__init__(**kwargs) - self.tags = tags - self.resource_id = resource_id - self.write_access_resource_id = write_access_resource_id - self.provisioning_state = provisioning_state - - -class LinkedServiceListResult(msrest.serialization.Model): - """The list linked service operation response. - - :ivar value: The list of linked service instances. - :vartype value: list[~azure.mgmt.loganalytics.models.LinkedService] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LinkedService]'}, - } - - def __init__( - self, - *, - value: Optional[List["LinkedService"]] = None, - **kwargs - ): - """ - :keyword value: The list of linked service instances. - :paramtype value: list[~azure.mgmt.loganalytics.models.LinkedService] - """ - super(LinkedServiceListResult, self).__init__(**kwargs) - self.value = value - - -class LinkedStorageAccountsListResult(msrest.serialization.Model): - """The list linked storage accounts service operation response. - - :ivar value: A list of linked storage accounts instances. - :vartype value: list[~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LinkedStorageAccountsResource]'}, - } - - def __init__( - self, - *, - value: Optional[List["LinkedStorageAccountsResource"]] = None, - **kwargs - ): - """ - :keyword value: A list of linked storage accounts instances. - :paramtype value: list[~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource] - """ - super(LinkedStorageAccountsListResult, self).__init__(**kwargs) - self.value = value - - -class LinkedStorageAccountsResource(ProxyResource): - """Linked storage accounts top level resource container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar data_source_type: Linked storage accounts type. Possible values include: "CustomLogs", - "AzureWatson", "Query", "Alerts". - :vartype data_source_type: str or ~azure.mgmt.loganalytics.models.DataSourceType - :ivar storage_account_ids: Linked storage accounts resources ids. - :vartype storage_account_ids: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'data_source_type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'data_source_type': {'key': 'properties.dataSourceType', 'type': 'str'}, - 'storage_account_ids': {'key': 'properties.storageAccountIds', 'type': '[str]'}, - } - - def __init__( - self, - *, - storage_account_ids: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword storage_account_ids: Linked storage accounts resources ids. - :paramtype storage_account_ids: list[str] - """ - super(LinkedStorageAccountsResource, self).__init__(**kwargs) - self.data_source_type = None - self.storage_account_ids = storage_account_ids - - -class ManagementGroup(msrest.serialization.Model): - """A management group that is connected to a workspace. - - :ivar server_count: The number of servers connected to the management group. - :vartype server_count: int - :ivar is_gateway: Gets or sets a value indicating whether the management group is a gateway. - :vartype is_gateway: bool - :ivar name: The name of the management group. - :vartype name: str - :ivar id: The unique ID of the management group. - :vartype id: str - :ivar created: The datetime that the management group was created. - :vartype created: ~datetime.datetime - :ivar data_received: The last datetime that the management group received data. - :vartype data_received: ~datetime.datetime - :ivar version: The version of System Center that is managing the management group. - :vartype version: str - :ivar sku: The SKU of System Center that is managing the management group. - :vartype sku: str - """ - - _attribute_map = { - 'server_count': {'key': 'properties.serverCount', 'type': 'int'}, - 'is_gateway': {'key': 'properties.isGateway', 'type': 'bool'}, - 'name': {'key': 'properties.name', 'type': 'str'}, - 'id': {'key': 'properties.id', 'type': 'str'}, - 'created': {'key': 'properties.created', 'type': 'iso-8601'}, - 'data_received': {'key': 'properties.dataReceived', 'type': 'iso-8601'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'sku': {'key': 'properties.sku', 'type': 'str'}, - } - - def __init__( - self, - *, - server_count: Optional[int] = None, - is_gateway: Optional[bool] = None, - name: Optional[str] = None, - id: Optional[str] = None, - created: Optional[datetime.datetime] = None, - data_received: Optional[datetime.datetime] = None, - version: Optional[str] = None, - sku: Optional[str] = None, - **kwargs - ): - """ - :keyword server_count: The number of servers connected to the management group. - :paramtype server_count: int - :keyword is_gateway: Gets or sets a value indicating whether the management group is a gateway. - :paramtype is_gateway: bool - :keyword name: The name of the management group. - :paramtype name: str - :keyword id: The unique ID of the management group. - :paramtype id: str - :keyword created: The datetime that the management group was created. - :paramtype created: ~datetime.datetime - :keyword data_received: The last datetime that the management group received data. - :paramtype data_received: ~datetime.datetime - :keyword version: The version of System Center that is managing the management group. - :paramtype version: str - :keyword sku: The SKU of System Center that is managing the management group. - :paramtype sku: str - """ - super(ManagementGroup, self).__init__(**kwargs) - self.server_count = server_count - self.is_gateway = is_gateway - self.name = name - self.id = id - self.created = created - self.data_received = data_received - self.version = version - self.sku = sku - - -class MetricName(msrest.serialization.Model): - """The name of a metric. - - :ivar value: The system name of the metric. - :vartype value: str - :ivar localized_value: The localized name of the metric. - :vartype localized_value: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[str] = None, - localized_value: Optional[str] = None, - **kwargs - ): - """ - :keyword value: The system name of the metric. - :paramtype value: str - :keyword localized_value: The localized name of the metric. - :paramtype localized_value: str - """ - super(MetricName, self).__init__(**kwargs) - self.value = value - self.localized_value = localized_value - - -class Operation(msrest.serialization.Model): - """Supported operation of OperationalInsights resource provider. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar display: Display metadata associated with the operation. - :vartype display: ~azure.mgmt.loganalytics.models.OperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display: Optional["OperationDisplay"] = None, - **kwargs - ): - """ - :keyword name: Operation name: {provider}/{resource}/{operation}. - :paramtype name: str - :keyword display: Display metadata associated with the operation. - :paramtype display: ~azure.mgmt.loganalytics.models.OperationDisplay - """ - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - - -class OperationDisplay(msrest.serialization.Model): - """Display metadata associated with the operation. - - :ivar provider: Service provider: Microsoft OperationsManagement. - :vartype provider: str - :ivar resource: Resource on which the operation is performed etc. - :vartype resource: str - :ivar operation: Type of operation: get, read, delete, etc. - :vartype operation: str - :ivar description: Description of operation. - :vartype description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword provider: Service provider: Microsoft OperationsManagement. - :paramtype provider: str - :keyword resource: Resource on which the operation is performed etc. - :paramtype resource: str - :keyword operation: Type of operation: get, read, delete, etc. - :paramtype operation: str - :keyword description: Description of operation. - :paramtype description: str - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class OperationListResult(msrest.serialization.Model): - """Result of the request to list solution operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of solution operations supported by the OperationsManagement resource - provider. - :vartype value: list[~azure.mgmt.loganalytics.models.Operation] - :ivar next_link: URL to get the next set of operation list results if there are any. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Operation"]] = None, - **kwargs - ): - """ - :keyword value: List of solution operations supported by the OperationsManagement resource - provider. - :paramtype value: list[~azure.mgmt.loganalytics.models.Operation] - """ - super(OperationListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class OperationStatus(msrest.serialization.Model): - """The status of operation. - - :ivar id: The operation Id. - :vartype id: str - :ivar name: The operation name. - :vartype name: str - :ivar start_time: The start time of the operation. - :vartype start_time: str - :ivar end_time: The end time of the operation. - :vartype end_time: str - :ivar status: The status of the operation. - :vartype status: str - :ivar error: The error detail of the operation if any. - :vartype error: ~azure.mgmt.loganalytics.models.ErrorResponse - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - status: Optional[str] = None, - error: Optional["ErrorResponse"] = None, - **kwargs - ): - """ - :keyword id: The operation Id. - :paramtype id: str - :keyword name: The operation name. - :paramtype name: str - :keyword start_time: The start time of the operation. - :paramtype start_time: str - :keyword end_time: The end time of the operation. - :paramtype end_time: str - :keyword status: The status of the operation. - :paramtype status: str - :keyword error: The error detail of the operation if any. - :paramtype error: ~azure.mgmt.loganalytics.models.ErrorResponse - """ - super(OperationStatus, self).__init__(**kwargs) - self.id = id - self.name = name - self.start_time = start_time - self.end_time = end_time - self.status = status - self.error = error - - -class PrivateLinkScopedResource(msrest.serialization.Model): - """The private link scope resource reference. - - :ivar resource_id: The full resource Id of the private link scope resource. - :vartype resource_id: str - :ivar scope_id: The private link scope unique Identifier. - :vartype scope_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'scope_id': {'key': 'scopeId', 'type': 'str'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - scope_id: Optional[str] = None, - **kwargs - ): - """ - :keyword resource_id: The full resource Id of the private link scope resource. - :paramtype resource_id: str - :keyword scope_id: The private link scope unique Identifier. - :paramtype scope_id: str - """ - super(PrivateLinkScopedResource, self).__init__(**kwargs) - self.resource_id = resource_id - self.scope_id = scope_id - - -class RestoredLogs(msrest.serialization.Model): - """Restore parameters. - - :ivar start_restore_time: The timestamp to start the restore from (UTC). - :vartype start_restore_time: ~datetime.datetime - :ivar end_restore_time: The timestamp to end the restore by (UTC). - :vartype end_restore_time: ~datetime.datetime - :ivar source_table: The table to restore data from. - :vartype source_table: str - """ - - _attribute_map = { - 'start_restore_time': {'key': 'startRestoreTime', 'type': 'iso-8601'}, - 'end_restore_time': {'key': 'endRestoreTime', 'type': 'iso-8601'}, - 'source_table': {'key': 'sourceTable', 'type': 'str'}, - } - - def __init__( - self, - *, - start_restore_time: Optional[datetime.datetime] = None, - end_restore_time: Optional[datetime.datetime] = None, - source_table: Optional[str] = None, - **kwargs - ): - """ - :keyword start_restore_time: The timestamp to start the restore from (UTC). - :paramtype start_restore_time: ~datetime.datetime - :keyword end_restore_time: The timestamp to end the restore by (UTC). - :paramtype end_restore_time: ~datetime.datetime - :keyword source_table: The table to restore data from. - :paramtype source_table: str - """ - super(RestoredLogs, self).__init__(**kwargs) - self.start_restore_time = start_restore_time - self.end_restore_time = end_restore_time - self.source_table = source_table - - -class ResultStatistics(msrest.serialization.Model): - """Search job execution statistics. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar progress: Search job completion percentage. - :vartype progress: float - :ivar ingested_records: The number of rows that were returned by the search job. - :vartype ingested_records: int - """ - - _validation = { - 'progress': {'readonly': True, 'multiple': 0.01}, - 'ingested_records': {'readonly': True}, - } - - _attribute_map = { - 'progress': {'key': 'progress', 'type': 'float'}, - 'ingested_records': {'key': 'ingestedRecords', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ResultStatistics, self).__init__(**kwargs) - self.progress = None - self.ingested_records = None - - -class SavedSearch(ProxyResource): - """Value object for saved search results. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar etag: The ETag of the saved search. To override an existing saved search, use "*" or - specify the current Etag. - :vartype etag: str - :ivar category: Required. The category of the saved search. This helps the user to find a saved - search faster. - :vartype category: str - :ivar display_name: Required. Saved search display name. - :vartype display_name: str - :ivar query: Required. The query expression for the saved search. - :vartype query: str - :ivar function_alias: The function alias if query serves as a function. - :vartype function_alias: str - :ivar 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. - :vartype function_parameters: str - :ivar version: The version number of the query language. The current version is 2 and is the - default. - :vartype version: long - :ivar tags: A set of tags. The tags attached to the saved search. - :vartype tags: list[~azure.mgmt.loganalytics.models.Tag] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'category': {'required': True}, - 'display_name': {'required': True}, - 'query': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - '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, - etag: Optional[str] = None, - function_alias: Optional[str] = None, - function_parameters: Optional[str] = None, - version: Optional[int] = None, - tags: Optional[List["Tag"]] = None, - **kwargs - ): - """ - :keyword etag: The ETag of the saved search. To override an existing saved search, use "*" or - specify the current Etag. - :paramtype etag: str - :keyword category: Required. The category of the saved search. This helps the user to find a - saved search faster. - :paramtype category: str - :keyword display_name: Required. Saved search display name. - :paramtype display_name: str - :keyword query: Required. The query expression for the saved search. - :paramtype query: str - :keyword function_alias: The function alias if query serves as a function. - :paramtype function_alias: str - :keyword 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. - :paramtype function_parameters: str - :keyword version: The version number of the query language. The current version is 2 and is the - default. - :paramtype version: long - :keyword tags: A set of tags. The tags attached to the saved search. - :paramtype tags: list[~azure.mgmt.loganalytics.models.Tag] - """ - super(SavedSearch, self).__init__(**kwargs) - self.etag = etag - 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 - - -class SavedSearchesListResult(msrest.serialization.Model): - """The saved search list operation response. - - :ivar value: The array of result values. - :vartype value: list[~azure.mgmt.loganalytics.models.SavedSearch] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SavedSearch]'}, - } - - def __init__( - self, - *, - value: Optional[List["SavedSearch"]] = None, - **kwargs - ): - """ - :keyword value: The array of result values. - :paramtype value: list[~azure.mgmt.loganalytics.models.SavedSearch] - """ - super(SavedSearchesListResult, self).__init__(**kwargs) - self.value = value - - -class Schema(msrest.serialization.Model): - """Table's schema. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Table name. - :vartype name: str - :ivar display_name: Table display name. - :vartype display_name: str - :ivar description: Table description. - :vartype description: str - :ivar columns: A list of table custom columns. - :vartype columns: list[~azure.mgmt.loganalytics.models.Column] - :ivar standard_columns: A list of table standard columns. - :vartype standard_columns: list[~azure.mgmt.loganalytics.models.Column] - :ivar categories: Table category. - :vartype categories: list[str] - :ivar labels: Table labels. - :vartype labels: list[str] - :ivar source: Table's creator. Possible values include: "microsoft", "customer". - :vartype source: str or ~azure.mgmt.loganalytics.models.SourceEnum - :ivar table_type: Table's creator. Possible values include: "Microsoft", "CustomLog", - "RestoredLogs", "SearchResults". - :vartype table_type: str or ~azure.mgmt.loganalytics.models.TableTypeEnum - :ivar table_sub_type: The subtype describes what APIs can be used to interact with the table, - and what features are available against it. Possible values include: "Any", "Classic", - "DataCollectionRuleBased". - :vartype table_sub_type: str or ~azure.mgmt.loganalytics.models.TableSubTypeEnum - :ivar solutions: List of solutions the table is affiliated with. - :vartype solutions: list[str] - :ivar search_results: Parameters of the search job that initiated this table. - :vartype search_results: ~azure.mgmt.loganalytics.models.SearchResults - :ivar restored_logs: Parameters of the restore operation that initiated this table. - :vartype restored_logs: ~azure.mgmt.loganalytics.models.RestoredLogs - """ - - _validation = { - 'standard_columns': {'readonly': True}, - 'categories': {'readonly': True}, - 'labels': {'readonly': True}, - 'source': {'readonly': True}, - 'table_type': {'readonly': True}, - 'table_sub_type': {'readonly': True}, - 'solutions': {'readonly': True}, - 'search_results': {'readonly': True}, - 'restored_logs': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'columns': {'key': 'columns', 'type': '[Column]'}, - 'standard_columns': {'key': 'standardColumns', 'type': '[Column]'}, - 'categories': {'key': 'categories', 'type': '[str]'}, - 'labels': {'key': 'labels', 'type': '[str]'}, - 'source': {'key': 'source', 'type': 'str'}, - 'table_type': {'key': 'tableType', 'type': 'str'}, - 'table_sub_type': {'key': 'tableSubType', 'type': 'str'}, - 'solutions': {'key': 'solutions', 'type': '[str]'}, - 'search_results': {'key': 'searchResults', 'type': 'SearchResults'}, - 'restored_logs': {'key': 'restoredLogs', 'type': 'RestoredLogs'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - description: Optional[str] = None, - columns: Optional[List["Column"]] = None, - **kwargs - ): - """ - :keyword name: Table name. - :paramtype name: str - :keyword display_name: Table display name. - :paramtype display_name: str - :keyword description: Table description. - :paramtype description: str - :keyword columns: A list of table custom columns. - :paramtype columns: list[~azure.mgmt.loganalytics.models.Column] - """ - super(Schema, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.description = description - self.columns = columns - self.standard_columns = None - self.categories = None - self.labels = None - self.source = None - self.table_type = None - self.table_sub_type = None - self.solutions = None - self.search_results = None - self.restored_logs = None - - -class SearchGetSchemaResponse(msrest.serialization.Model): - """The get schema operation response. - - :ivar metadata: The metadata from search results. - :vartype metadata: ~azure.mgmt.loganalytics.models.SearchMetadata - :ivar value: The array of result values. - :vartype value: list[~azure.mgmt.loganalytics.models.SearchSchemaValue] - """ - - _attribute_map = { - 'metadata': {'key': 'metadata', 'type': 'SearchMetadata'}, - 'value': {'key': 'value', 'type': '[SearchSchemaValue]'}, - } - - def __init__( - self, - *, - metadata: Optional["SearchMetadata"] = None, - value: Optional[List["SearchSchemaValue"]] = None, - **kwargs - ): - """ - :keyword metadata: The metadata from search results. - :paramtype metadata: ~azure.mgmt.loganalytics.models.SearchMetadata - :keyword value: The array of result values. - :paramtype value: list[~azure.mgmt.loganalytics.models.SearchSchemaValue] - """ - super(SearchGetSchemaResponse, self).__init__(**kwargs) - self.metadata = metadata - self.value = value - - -class SearchMetadata(msrest.serialization.Model): - """Metadata for search results. - - :ivar search_id: The request id of the search. - :vartype search_id: str - :ivar result_type: The search result type. - :vartype result_type: str - :ivar total: The total number of search results. - :vartype total: long - :ivar top: The number of top search results. - :vartype top: long - :ivar id: The id of the search results request. - :vartype id: str - :ivar core_summaries: The core summaries. - :vartype core_summaries: list[~azure.mgmt.loganalytics.models.CoreSummary] - :ivar status: The status of the search results. - :vartype status: str - :ivar start_time: The start time for the search. - :vartype start_time: ~datetime.datetime - :ivar last_updated: The time of last update. - :vartype last_updated: ~datetime.datetime - :ivar e_tag: The ETag of the search results. - :vartype e_tag: str - :ivar sort: How the results are sorted. - :vartype sort: list[~azure.mgmt.loganalytics.models.SearchSort] - :ivar request_time: The request time. - :vartype request_time: long - :ivar aggregated_value_field: The aggregated value field. - :vartype aggregated_value_field: str - :ivar aggregated_grouping_fields: The aggregated grouping fields. - :vartype aggregated_grouping_fields: str - :ivar sum: The sum of all aggregates returned in the result set. - :vartype sum: long - :ivar max: The max of all aggregates returned in the result set. - :vartype max: long - :ivar schema: The schema. - :vartype schema: ~azure.mgmt.loganalytics.models.SearchMetadataSchema - """ - - _attribute_map = { - 'search_id': {'key': 'requestId', 'type': 'str'}, - 'result_type': {'key': 'resultType', 'type': 'str'}, - 'total': {'key': 'total', 'type': 'long'}, - 'top': {'key': 'top', 'type': 'long'}, - 'id': {'key': 'id', 'type': 'str'}, - 'core_summaries': {'key': 'coreSummaries', 'type': '[CoreSummary]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'sort': {'key': 'sort', 'type': '[SearchSort]'}, - 'request_time': {'key': 'requestTime', 'type': 'long'}, - 'aggregated_value_field': {'key': 'aggregatedValueField', 'type': 'str'}, - 'aggregated_grouping_fields': {'key': 'aggregatedGroupingFields', 'type': 'str'}, - 'sum': {'key': 'sum', 'type': 'long'}, - 'max': {'key': 'max', 'type': 'long'}, - 'schema': {'key': 'schema', 'type': 'SearchMetadataSchema'}, - } - - def __init__( - self, - *, - search_id: Optional[str] = None, - result_type: Optional[str] = None, - total: Optional[int] = None, - top: Optional[int] = None, - id: Optional[str] = None, - core_summaries: Optional[List["CoreSummary"]] = None, - status: Optional[str] = None, - start_time: Optional[datetime.datetime] = None, - last_updated: Optional[datetime.datetime] = None, - e_tag: Optional[str] = None, - sort: Optional[List["SearchSort"]] = None, - request_time: Optional[int] = None, - aggregated_value_field: Optional[str] = None, - aggregated_grouping_fields: Optional[str] = None, - sum: Optional[int] = None, - max: Optional[int] = None, - schema: Optional["SearchMetadataSchema"] = None, - **kwargs - ): - """ - :keyword search_id: The request id of the search. - :paramtype search_id: str - :keyword result_type: The search result type. - :paramtype result_type: str - :keyword total: The total number of search results. - :paramtype total: long - :keyword top: The number of top search results. - :paramtype top: long - :keyword id: The id of the search results request. - :paramtype id: str - :keyword core_summaries: The core summaries. - :paramtype core_summaries: list[~azure.mgmt.loganalytics.models.CoreSummary] - :keyword status: The status of the search results. - :paramtype status: str - :keyword start_time: The start time for the search. - :paramtype start_time: ~datetime.datetime - :keyword last_updated: The time of last update. - :paramtype last_updated: ~datetime.datetime - :keyword e_tag: The ETag of the search results. - :paramtype e_tag: str - :keyword sort: How the results are sorted. - :paramtype sort: list[~azure.mgmt.loganalytics.models.SearchSort] - :keyword request_time: The request time. - :paramtype request_time: long - :keyword aggregated_value_field: The aggregated value field. - :paramtype aggregated_value_field: str - :keyword aggregated_grouping_fields: The aggregated grouping fields. - :paramtype aggregated_grouping_fields: str - :keyword sum: The sum of all aggregates returned in the result set. - :paramtype sum: long - :keyword max: The max of all aggregates returned in the result set. - :paramtype max: long - :keyword schema: The schema. - :paramtype schema: ~azure.mgmt.loganalytics.models.SearchMetadataSchema - """ - super(SearchMetadata, self).__init__(**kwargs) - self.search_id = search_id - self.result_type = result_type - self.total = total - self.top = top - self.id = id - self.core_summaries = core_summaries - self.status = status - self.start_time = start_time - self.last_updated = last_updated - self.e_tag = e_tag - self.sort = sort - self.request_time = request_time - self.aggregated_value_field = aggregated_value_field - self.aggregated_grouping_fields = aggregated_grouping_fields - self.sum = sum - self.max = max - self.schema = schema - - -class SearchMetadataSchema(msrest.serialization.Model): - """Schema metadata for search. - - :ivar name: The name of the metadata schema. - :vartype name: str - :ivar version: The version of the metadata schema. - :vartype version: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - version: Optional[int] = None, - **kwargs - ): - """ - :keyword name: The name of the metadata schema. - :paramtype name: str - :keyword version: The version of the metadata schema. - :paramtype version: int - """ - super(SearchMetadataSchema, self).__init__(**kwargs) - self.name = name - self.version = version - - -class SearchResults(msrest.serialization.Model): - """Parameters of the search job that initiated this table. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar query: Search job query. - :vartype query: str - :ivar description: Search job Description. - :vartype description: str - :ivar limit: Limit the search job to return up to specified number of rows. - :vartype limit: int - :ivar start_search_time: The timestamp to start the search from (UTC). - :vartype start_search_time: ~datetime.datetime - :ivar end_search_time: The timestamp to end the search by (UTC). - :vartype end_search_time: ~datetime.datetime - :ivar source_table: The table used in the search job. - :vartype source_table: str - """ - - _validation = { - 'source_table': {'readonly': True}, - } - - _attribute_map = { - 'query': {'key': 'query', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'int'}, - 'start_search_time': {'key': 'startSearchTime', 'type': 'iso-8601'}, - 'end_search_time': {'key': 'endSearchTime', 'type': 'iso-8601'}, - 'source_table': {'key': 'sourceTable', 'type': 'str'}, - } - - def __init__( - self, - *, - query: Optional[str] = None, - description: Optional[str] = None, - limit: Optional[int] = None, - start_search_time: Optional[datetime.datetime] = None, - end_search_time: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword query: Search job query. - :paramtype query: str - :keyword description: Search job Description. - :paramtype description: str - :keyword limit: Limit the search job to return up to specified number of rows. - :paramtype limit: int - :keyword start_search_time: The timestamp to start the search from (UTC). - :paramtype start_search_time: ~datetime.datetime - :keyword end_search_time: The timestamp to end the search by (UTC). - :paramtype end_search_time: ~datetime.datetime - """ - super(SearchResults, self).__init__(**kwargs) - self.query = query - self.description = description - self.limit = limit - self.start_search_time = start_search_time - self.end_search_time = end_search_time - self.source_table = None - - -class SearchSchemaValue(msrest.serialization.Model): - """Value object for schema results. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the schema. + :ivar name: Table name. :vartype name: str - :ivar display_name: The display name of the schema. + :ivar display_name: Table display name. :vartype display_name: str - :ivar type: The type. - :vartype type: str - :ivar indexed: Required. The boolean that indicates the field is searchable as free text. - :vartype indexed: bool - :ivar stored: Required. The boolean that indicates whether or not the field is stored. - :vartype stored: bool - :ivar facet: Required. The boolean that indicates whether or not the field is a facet. - :vartype facet: bool - :ivar owner_type: The array of workflows containing the field. - :vartype owner_type: list[str] - """ - - _validation = { - 'indexed': {'required': True}, - 'stored': {'required': True}, - 'facet': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'indexed': {'key': 'indexed', 'type': 'bool'}, - 'stored': {'key': 'stored', 'type': 'bool'}, - 'facet': {'key': 'facet', 'type': 'bool'}, - 'owner_type': {'key': 'ownerType', 'type': '[str]'}, - } - - def __init__( - self, - *, - indexed: bool, - stored: bool, - facet: bool, - name: Optional[str] = None, - display_name: Optional[str] = None, - type: Optional[str] = None, - owner_type: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword name: The name of the schema. - :paramtype name: str - :keyword display_name: The display name of the schema. - :paramtype display_name: str - :keyword type: The type. - :paramtype type: str - :keyword indexed: Required. The boolean that indicates the field is searchable as free text. - :paramtype indexed: bool - :keyword stored: Required. The boolean that indicates whether or not the field is stored. - :paramtype stored: bool - :keyword facet: Required. The boolean that indicates whether or not the field is a facet. - :paramtype facet: bool - :keyword owner_type: The array of workflows containing the field. - :paramtype owner_type: list[str] - """ - super(SearchSchemaValue, self).__init__(**kwargs) - self.name = name - self.display_name = display_name - self.type = type - self.indexed = indexed - self.stored = stored - self.facet = facet - self.owner_type = owner_type - - -class SearchSort(msrest.serialization.Model): - """The sort parameters for search. - - :ivar name: The name of the field the search query is sorted on. - :vartype name: str - :ivar order: The sort order of the search. Possible values include: "asc", "desc". - :vartype order: str or ~azure.mgmt.loganalytics.models.SearchSortEnum - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - order: Optional[Union[str, "SearchSortEnum"]] = None, - **kwargs - ): - """ - :keyword name: The name of the field the search query is sorted on. - :paramtype name: str - :keyword order: The sort order of the search. Possible values include: "asc", "desc". - :paramtype order: str or ~azure.mgmt.loganalytics.models.SearchSortEnum - """ - super(SearchSort, self).__init__(**kwargs) - self.name = name - self.order = order - - -class SharedKeys(msrest.serialization.Model): - """The shared keys for a workspace. - - :ivar primary_shared_key: The primary shared key of a workspace. - :vartype primary_shared_key: str - :ivar secondary_shared_key: The secondary shared key of a workspace. - :vartype secondary_shared_key: str - """ - - _attribute_map = { - 'primary_shared_key': {'key': 'primarySharedKey', 'type': 'str'}, - 'secondary_shared_key': {'key': 'secondarySharedKey', 'type': 'str'}, - } - - def __init__( - self, - *, - primary_shared_key: Optional[str] = None, - secondary_shared_key: Optional[str] = None, - **kwargs - ): - """ - :keyword primary_shared_key: The primary shared key of a workspace. - :paramtype primary_shared_key: str - :keyword secondary_shared_key: The secondary shared key of a workspace. - :paramtype secondary_shared_key: str - """ - super(SharedKeys, self).__init__(**kwargs) - self.primary_shared_key = primary_shared_key - self.secondary_shared_key = secondary_shared_key - - -class StorageAccount(msrest.serialization.Model): - """Describes a storage account connection. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Required. The Azure Resource Manager ID of the storage account resource. - :vartype id: str - :ivar key: Required. The storage account key. - :vartype key: str - """ - - _validation = { - 'id': {'required': True}, - 'key': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - key: str, - **kwargs - ): - """ - :keyword id: Required. The Azure Resource Manager ID of the storage account resource. - :paramtype id: str - :keyword key: Required. The storage account key. - :paramtype key: str - """ - super(StorageAccount, self).__init__(**kwargs) - self.id = id - self.key = key - - -class StorageInsight(ProxyResource): - """The top level storage insight resource container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar e_tag: The ETag of the storage insight. - :vartype e_tag: str - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar containers: The names of the blob containers that the workspace should read. - :vartype containers: list[str] - :ivar tables: The names of the Azure tables that the workspace should read. - :vartype tables: list[str] - :ivar storage_account: The storage account connection details. - :vartype storage_account: ~azure.mgmt.loganalytics.models.StorageAccount - :ivar status: The status of the storage insight. - :vartype status: ~azure.mgmt.loganalytics.models.StorageInsightStatus + :ivar description: Table description. + :vartype description: str + :ivar columns: A list of table custom columns. + :vartype columns: list[~azure.mgmt.loganalytics.models.Column] + :ivar standard_columns: A list of table standard columns. + :vartype standard_columns: list[~azure.mgmt.loganalytics.models.Column] + :ivar categories: Table category. + :vartype categories: list[str] + :ivar labels: Table labels. + :vartype labels: list[str] + :ivar source: Table's creator. Possible values include: "microsoft", "customer". + :vartype source: str or ~azure.mgmt.loganalytics.models.SourceEnum + :ivar table_type: Table's creator. Possible values include: "Microsoft", "CustomLog", + "RestoredLogs", "SearchResults". + :vartype table_type: str or ~azure.mgmt.loganalytics.models.TableTypeEnum + :ivar table_sub_type: The subtype describes what APIs can be used to interact with the table, + and what features are available against it. Possible values include: "Any", "Classic", + "DataCollectionRuleBased". + :vartype table_sub_type: str or ~azure.mgmt.loganalytics.models.TableSubTypeEnum + :ivar solutions: List of solutions the table is affiliated with. + :vartype solutions: list[str] + :ivar search_results: Parameters of the search job that initiated this table. + :vartype search_results: ~azure.mgmt.loganalytics.models.SearchResults + :ivar restored_logs: Parameters of the restore operation that initiated this table. + :vartype restored_logs: ~azure.mgmt.loganalytics.models.RestoredLogs """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'status': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'e_tag': {'key': 'eTag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'containers': {'key': 'properties.containers', 'type': '[str]'}, - 'tables': {'key': 'properties.tables', 'type': '[str]'}, - 'storage_account': {'key': 'properties.storageAccount', 'type': 'StorageAccount'}, - 'status': {'key': 'properties.status', 'type': 'StorageInsightStatus'}, + 'standard_columns': {'readonly': True}, + 'categories': {'readonly': True}, + 'labels': {'readonly': True}, + 'source': {'readonly': True}, + 'table_type': {'readonly': True}, + 'table_sub_type': {'readonly': True}, + 'solutions': {'readonly': True}, + 'search_results': {'readonly': True}, + 'restored_logs': {'readonly': True}, } - def __init__( - self, - *, - e_tag: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - containers: Optional[List[str]] = None, - tables: Optional[List[str]] = None, - storage_account: Optional["StorageAccount"] = None, - **kwargs - ): - """ - :keyword e_tag: The ETag of the storage insight. - :paramtype e_tag: str - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword containers: The names of the blob containers that the workspace should read. - :paramtype containers: list[str] - :keyword tables: The names of the Azure tables that the workspace should read. - :paramtype tables: list[str] - :keyword storage_account: The storage account connection details. - :paramtype storage_account: ~azure.mgmt.loganalytics.models.StorageAccount - """ - super(StorageInsight, self).__init__(**kwargs) - self.e_tag = e_tag - self.tags = tags - self.containers = containers - self.tables = tables - self.storage_account = storage_account - self.status = None - - -class StorageInsightListResult(msrest.serialization.Model): - """The list storage insights operation response. - - :ivar value: A list of storage insight items. - :vartype value: list[~azure.mgmt.loganalytics.models.StorageInsight] - :ivar odata_next_link: The link (url) to the next page of results. - :vartype odata_next_link: str - """ - _attribute_map = { - 'value': {'key': 'value', 'type': '[StorageInsight]'}, - 'odata_next_link': {'key': '@odata\\.nextLink', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'columns': {'key': 'columns', 'type': '[Column]'}, + 'standard_columns': {'key': 'standardColumns', 'type': '[Column]'}, + 'categories': {'key': 'categories', 'type': '[str]'}, + 'labels': {'key': 'labels', 'type': '[str]'}, + 'source': {'key': 'source', 'type': 'str'}, + 'table_type': {'key': 'tableType', 'type': 'str'}, + 'table_sub_type': {'key': 'tableSubType', 'type': 'str'}, + 'solutions': {'key': 'solutions', 'type': '[str]'}, + 'search_results': {'key': 'searchResults', 'type': 'SearchResults'}, + 'restored_logs': {'key': 'restoredLogs', 'type': 'RestoredLogs'}, } def __init__( self, *, - value: Optional[List["StorageInsight"]] = None, - odata_next_link: Optional[str] = None, + name: Optional[str] = None, + display_name: Optional[str] = None, + description: Optional[str] = None, + columns: Optional[List["Column"]] = None, **kwargs ): """ - :keyword value: A list of storage insight items. - :paramtype value: list[~azure.mgmt.loganalytics.models.StorageInsight] - :keyword odata_next_link: The link (url) to the next page of results. - :paramtype odata_next_link: str + :keyword name: Table name. + :paramtype name: str + :keyword display_name: Table display name. + :paramtype display_name: str + :keyword description: Table description. + :paramtype description: str + :keyword columns: A list of table custom columns. + :paramtype columns: list[~azure.mgmt.loganalytics.models.Column] """ - super(StorageInsightListResult, self).__init__(**kwargs) - self.value = value - self.odata_next_link = odata_next_link + super(Schema, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.description = description + self.columns = columns + self.standard_columns = None + self.categories = None + self.labels = None + self.source = None + self.table_type = None + self.table_sub_type = None + self.solutions = None + self.search_results = None + self.restored_logs = None -class StorageInsightStatus(msrest.serialization.Model): - """The status of the storage insight. +class SearchResults(msrest.serialization.Model): + """Parameters of the search job that initiated this table. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar state: Required. The state of the storage insight connection to the workspace. Possible - values include: "OK", "ERROR". - :vartype state: str or ~azure.mgmt.loganalytics.models.StorageInsightState - :ivar description: Description of the state of the storage insight. + :ivar query: Search job query. + :vartype query: str + :ivar description: Search job Description. :vartype description: str + :ivar limit: Limit the search job to return up to specified number of rows. + :vartype limit: int + :ivar start_search_time: The timestamp to start the search from (UTC). + :vartype start_search_time: ~datetime.datetime + :ivar end_search_time: The timestamp to end the search by (UTC). + :vartype end_search_time: ~datetime.datetime + :ivar source_table: The table used in the search job. + :vartype source_table: str """ _validation = { - 'state': {'required': True}, + 'source_table': {'readonly': True}, } _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, + 'query': {'key': 'query', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'int'}, + 'start_search_time': {'key': 'startSearchTime', 'type': 'iso-8601'}, + 'end_search_time': {'key': 'endSearchTime', 'type': 'iso-8601'}, + 'source_table': {'key': 'sourceTable', 'type': 'str'}, } def __init__( self, *, - state: Union[str, "StorageInsightState"], + query: Optional[str] = None, description: Optional[str] = None, + limit: Optional[int] = None, + start_search_time: Optional[datetime.datetime] = None, + end_search_time: Optional[datetime.datetime] = None, **kwargs ): """ - :keyword state: Required. The state of the storage insight connection to the workspace. - Possible values include: "OK", "ERROR". - :paramtype state: str or ~azure.mgmt.loganalytics.models.StorageInsightState - :keyword description: Description of the state of the storage insight. + :keyword query: Search job query. + :paramtype query: str + :keyword description: Search job Description. :paramtype description: str + :keyword limit: Limit the search job to return up to specified number of rows. + :paramtype limit: int + :keyword start_search_time: The timestamp to start the search from (UTC). + :paramtype start_search_time: ~datetime.datetime + :keyword end_search_time: The timestamp to end the search by (UTC). + :paramtype end_search_time: ~datetime.datetime """ - super(StorageInsightStatus, self).__init__(**kwargs) - self.state = state + super(SearchResults, self).__init__(**kwargs) + self.query = query self.description = description + self.limit = limit + self.start_search_time = start_search_time + self.end_search_time = end_search_time + self.source_table = None class SystemData(msrest.serialization.Model): @@ -2814,136 +893,58 @@ def __init__( self.value = value -class Tag(msrest.serialization.Model): - """A tag of a saved search. +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :ivar name: Required. The tag name. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. :vartype name: str - :ivar value: Required. The tag value. - :vartype value: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str """ _validation = { - 'name': {'required': True}, - 'value': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - value: str, - **kwargs - ): - """ - :keyword name: Required. The tag name. - :paramtype name: str - :keyword value: Required. The tag value. - :paramtype value: str - """ - super(Tag, self).__init__(**kwargs) - self.name = name - self.value = value - - -class UsageMetric(msrest.serialization.Model): - """A metric describing the usage of a resource. - - :ivar name: The name of the metric. - :vartype name: ~azure.mgmt.loganalytics.models.MetricName - :ivar unit: The units used for the metric. - :vartype unit: str - :ivar current_value: The current value of the metric. - :vartype current_value: float - :ivar limit: The quota limit for the metric. - :vartype limit: float - :ivar next_reset_time: The time that the metric's value will reset. - :vartype next_reset_time: ~datetime.datetime - :ivar quota_period: The quota period that determines the length of time between value resets. - :vartype quota_period: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'MetricName'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'float'}, - 'limit': {'key': 'limit', 'type': 'float'}, - 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, - 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, } def __init__( self, *, - name: Optional["MetricName"] = None, - unit: Optional[str] = None, - current_value: Optional[float] = None, - limit: Optional[float] = None, - next_reset_time: Optional[datetime.datetime] = None, - quota_period: Optional[str] = None, - **kwargs - ): - """ - :keyword name: The name of the metric. - :paramtype name: ~azure.mgmt.loganalytics.models.MetricName - :keyword unit: The units used for the metric. - :paramtype unit: str - :keyword current_value: The current value of the metric. - :paramtype current_value: float - :keyword limit: The quota limit for the metric. - :paramtype limit: float - :keyword next_reset_time: The time that the metric's value will reset. - :paramtype next_reset_time: ~datetime.datetime - :keyword quota_period: The quota period that determines the length of time between value - resets. - :paramtype quota_period: str - """ - super(UsageMetric, self).__init__(**kwargs) - self.name = name - self.unit = unit - self.current_value = current_value - self.limit = limit - self.next_reset_time = next_reset_time - self.quota_period = quota_period - - -class UserIdentityProperties(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, + location: str, + tags: Optional[Dict[str, str]] = None, **kwargs ): """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str """ - super(UserIdentityProperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location class Workspace(TrackedResource): @@ -3218,31 +1219,6 @@ def __init__( self.disable_local_auth = disable_local_auth -class WorkspaceListManagementGroupsResult(msrest.serialization.Model): - """The list workspace management groups operation response. - - :ivar value: Gets or sets a list of management groups attached to the workspace. - :vartype value: list[~azure.mgmt.loganalytics.models.ManagementGroup] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagementGroup]'}, - } - - def __init__( - self, - *, - value: Optional[List["ManagementGroup"]] = None, - **kwargs - ): - """ - :keyword value: Gets or sets a list of management groups attached to the workspace. - :paramtype value: list[~azure.mgmt.loganalytics.models.ManagementGroup] - """ - super(WorkspaceListManagementGroupsResult, self).__init__(**kwargs) - self.value = value - - class WorkspaceListResult(msrest.serialization.Model): """The list workspaces operation response. @@ -3268,31 +1244,6 @@ def __init__( self.value = value -class WorkspaceListUsagesResult(msrest.serialization.Model): - """The list workspace usages operation response. - - :ivar value: Gets or sets a list of usage metrics for a workspace. - :vartype value: list[~azure.mgmt.loganalytics.models.UsageMetric] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[UsageMetric]'}, - } - - def __init__( - self, - *, - value: Optional[List["UsageMetric"]] = None, - **kwargs - ): - """ - :keyword value: Gets or sets a list of usage metrics for a workspace. - :paramtype value: list[~azure.mgmt.loganalytics.models.UsageMetric] - """ - super(WorkspaceListUsagesResult, self).__init__(**kwargs) - self.value = value - - class WorkspacePatch(AzureEntityResource): """The top level Workspace resource container. @@ -3441,167 +1392,6 @@ def __init__( self.default_data_collection_rule_resource_id = default_data_collection_rule_resource_id -class WorkspacePurgeBody(msrest.serialization.Model): - """Describes the body of a purge request for an App Insights Workspace. - - All required parameters must be populated in order to send to Azure. - - :ivar table: Required. Table from which to purge data. - :vartype table: str - :ivar filters: Required. The set of columns and filters (queries) to run over them to purge the - resulting data. - :vartype filters: list[~azure.mgmt.loganalytics.models.WorkspacePurgeBodyFilters] - """ - - _validation = { - 'table': {'required': True}, - 'filters': {'required': True}, - } - - _attribute_map = { - 'table': {'key': 'table', 'type': 'str'}, - 'filters': {'key': 'filters', 'type': '[WorkspacePurgeBodyFilters]'}, - } - - def __init__( - self, - *, - table: str, - filters: List["WorkspacePurgeBodyFilters"], - **kwargs - ): - """ - :keyword table: Required. Table from which to purge data. - :paramtype table: str - :keyword filters: Required. The set of columns and filters (queries) to run over them to purge - the resulting data. - :paramtype filters: list[~azure.mgmt.loganalytics.models.WorkspacePurgeBodyFilters] - """ - super(WorkspacePurgeBody, self).__init__(**kwargs) - self.table = table - self.filters = filters - - -class WorkspacePurgeBodyFilters(msrest.serialization.Model): - """User-defined filters to return data which will be purged from the table. - - :ivar column: The column of the table over which the given query should run. - :vartype column: str - :ivar operator: A query operator to evaluate over the provided column and value(s). Supported - operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would - in a KQL query. - :vartype operator: str - :ivar value: the value for the operator to function over. This can be a number (e.g., > 100), a - string (timestamp >= '2017-09-01') or array of values. - :vartype value: any - :ivar key: When filtering over custom dimensions, this key will be used as the name of the - custom dimension. - :vartype key: str - """ - - _attribute_map = { - 'column': {'key': 'column', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - *, - column: Optional[str] = None, - operator: Optional[str] = None, - value: Optional[Any] = None, - key: Optional[str] = None, - **kwargs - ): - """ - :keyword column: The column of the table over which the given query should run. - :paramtype column: str - :keyword operator: A query operator to evaluate over the provided column and value(s). - Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as - they would in a KQL query. - :paramtype operator: str - :keyword value: the value for the operator to function over. This can be a number (e.g., > - 100), a string (timestamp >= '2017-09-01') or array of values. - :paramtype value: any - :keyword key: When filtering over custom dimensions, this key will be used as the name of the - custom dimension. - :paramtype key: str - """ - super(WorkspacePurgeBodyFilters, self).__init__(**kwargs) - self.column = column - self.operator = operator - self.value = value - self.key = key - - -class WorkspacePurgeResponse(msrest.serialization.Model): - """Response containing operationId for a specific purge action. - - All required parameters must be populated in order to send to Azure. - - :ivar operation_id: Required. Id to use when querying for status for a particular purge - operation. - :vartype operation_id: str - """ - - _validation = { - 'operation_id': {'required': True}, - } - - _attribute_map = { - 'operation_id': {'key': 'operationId', 'type': 'str'}, - } - - def __init__( - self, - *, - operation_id: str, - **kwargs - ): - """ - :keyword operation_id: Required. Id to use when querying for status for a particular purge - operation. - :paramtype operation_id: str - """ - super(WorkspacePurgeResponse, self).__init__(**kwargs) - self.operation_id = operation_id - - -class WorkspacePurgeStatusResponse(msrest.serialization.Model): - """Response containing status for a specific purge operation. - - All required parameters must be populated in order to send to Azure. - - :ivar status: Required. Status of the operation represented by the requested Id. Possible - values include: "pending", "completed". - :vartype status: str or ~azure.mgmt.loganalytics.models.PurgeState - """ - - _validation = { - 'status': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Union[str, "PurgeState"], - **kwargs - ): - """ - :keyword status: Required. Status of the operation represented by the requested Id. Possible - values include: "pending", "completed". - :paramtype status: str or ~azure.mgmt.loganalytics.models.PurgeState - """ - super(WorkspacePurgeStatusResponse, self).__init__(**kwargs) - self.status = status - - class WorkspaceSku(msrest.serialization.Model): """The SKU (tier) of a workspace. 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 479da079c9c5..21057bbef220 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 @@ -7,45 +7,13 @@ # -------------------------------------------------------------------------- from ._operations import Operations +from ._tables_operations import TablesOperations from ._workspaces_operations import WorkspacesOperations from ._deleted_workspaces_operations import DeletedWorkspacesOperations -from ._tables_operations import TablesOperations -from ._data_exports_operations import DataExportsOperations -from ._data_sources_operations import DataSourcesOperations -from ._intelligence_packs_operations import IntelligencePacksOperations -from ._linked_services_operations import LinkedServicesOperations -from ._linked_storage_accounts_operations import LinkedStorageAccountsOperations -from ._management_groups_operations import ManagementGroupsOperations -from ._operation_statuses_operations import OperationStatusesOperations -from ._shared_keys_operations import SharedKeysOperations -from ._usages_operations import UsagesOperations -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 -from ._clusters_operations import ClustersOperations __all__ = [ 'Operations', + 'TablesOperations', 'WorkspacesOperations', 'DeletedWorkspacesOperations', - 'TablesOperations', - 'DataExportsOperations', - 'DataSourcesOperations', - 'IntelligencePacksOperations', - 'LinkedServicesOperations', - 'LinkedStorageAccountsOperations', - 'ManagementGroupsOperations', - 'OperationStatusesOperations', - 'SharedKeysOperations', - 'UsagesOperations', - 'StorageInsightConfigsOperations', - 'SavedSearchesOperations', - 'AvailableServiceTiersOperations', - 'GatewaysOperations', - 'SchemaOperations', - 'WorkspacePurgeOperations', - 'ClustersOperations', ] 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 deleted file mode 100644 index 2b27e239ff10..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_available_service_tiers_operations.py +++ /dev/null @@ -1,133 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_list_by_workspace_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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 = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class AvailableServiceTiersOperations(object): - """AvailableServiceTiersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> List["_models.AvailableServiceTier"]: - """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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of AvailableServiceTier, or the result of cls(response) - :rtype: list[~azure.mgmt.loganalytics.models.AvailableServiceTier] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.AvailableServiceTier"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_by_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[AvailableServiceTier]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_clusters_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_clusters_operations.py deleted file mode 100644 index 71e7fc93be24..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_clusters_operations.py +++ /dev/null @@ -1,789 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_list_by_resource_group_request( - resource_group_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-06-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_request( - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-06-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - resource_group_name: str, - subscription_id: str, - cluster_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2021-06-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_delete_request_initial( - resource_group_name: str, - cluster_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-06-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id: str, - resource_group_name: str, - cluster_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2021-06-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_update_request_initial( - resource_group_name: str, - cluster_name: str, - subscription_id: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2021-06-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - -class ClustersOperations(object): - """ClustersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> Iterable["_models.ClusterListResult"]: - """Gets Log Analytics clusters in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.ClusterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters'} # type: ignore - - @distributed_trace - def list( - self, - **kwargs: Any - ) -> Iterable["_models.ClusterListResult"]: - """Gets the Log Analytics clusters in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ClusterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.ClusterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.Cluster", - **kwargs: Any - ) -> Optional["_models.Cluster"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Cluster"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'Cluster') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - cluster_name=cluster_name, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Cluster', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Cluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.Cluster", - **kwargs: Any - ) -> LROPoller["_models.Cluster"]: - """Create or update a Log Analytics cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: The name of the Log Analytics cluster. - :type cluster_name: str - :param parameters: The parameters required to create or update a Log Analytics cluster. - :type parameters: ~azure.mgmt.loganalytics.models.Cluster - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.loganalytics.models.Cluster] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Cluster', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes a cluster instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: Name of the Log Analytics Cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - cluster_name: str, - **kwargs: Any - ) -> "_models.Cluster": - """Gets a Log Analytics cluster instance. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: Name of the Log Analytics Cluster. - :type cluster_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Cluster, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.Cluster - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - cluster_name=cluster_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Cluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - - def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.ClusterPatch", - **kwargs: Any - ) -> "_models.Cluster": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ClusterPatch') - - request = build_update_request_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self._update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Cluster', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore - - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - cluster_name: str, - parameters: "_models.ClusterPatch", - **kwargs: Any - ) -> LROPoller["_models.Cluster"]: - """Updates a Log Analytics cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param cluster_name: Name of the Log Analytics Cluster. - :type cluster_name: str - :param parameters: The parameters required to patch a Log Analytics cluster. - :type parameters: ~azure.mgmt.loganalytics.models.ClusterPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.loganalytics.models.Cluster] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Cluster"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Cluster', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_exports_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_exports_operations.py deleted file mode 100644 index 2364fc9878f1..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_exports_operations.py +++ /dev/null @@ -1,455 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_list_by_workspace_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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 = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - data_export_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "dataExportName": _SERIALIZER.url("data_export_name", data_export_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_get_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - data_export_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "dataExportName": _SERIALIZER.url("data_export_name", data_export_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - data_export_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "dataExportName": _SERIALIZER.url("data_export_name", data_export_name, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class DataExportsOperations(object): - """DataExportsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Iterable["_models.DataExportListResult"]: - """Lists the data export instances within a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataExportListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.DataExportListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataExportListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataExportListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports'} # type: ignore - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - data_export_name: str, - parameters: "_models.DataExport", - **kwargs: Any - ) -> "_models.DataExport": - """Create or update a data export. - - :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 data_export_name: The data export rule name. - :type data_export_name: str - :param parameters: The parameters required to create or update a data export. - :type parameters: ~azure.mgmt.loganalytics.models.DataExport - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataExport, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.DataExport - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataExport"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'DataExport') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_export_name=data_export_name, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataExport', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataExport', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - data_export_name: str, - **kwargs: Any - ) -> "_models.DataExport": - """Gets a data export instance. - - :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 data_export_name: The data export rule name. - :type data_export_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataExport, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.DataExport - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataExport"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_export_name=data_export_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataExport', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}'} # type: ignore - - - @distributed_trace - def delete( - self, - resource_group_name: str, - workspace_name: str, - data_export_name: str, - **kwargs: Any - ) -> None: - """Deletes the specified data export in a given 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 data_export_name: The data export rule name. - :type data_export_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_export_name=data_export_name, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_sources_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_sources_operations.py deleted file mode 100644 index 460d7b9148ad..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_sources_operations.py +++ /dev/null @@ -1,461 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_create_or_update_request( - resource_group_name: str, - workspace_name: str, - data_source_name: str, - subscription_id: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "dataSourceName": _SERIALIZER.url("data_source_name", data_source_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_delete_request( - resource_group_name: str, - workspace_name: str, - data_source_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "dataSourceName": _SERIALIZER.url("data_source_name", data_source_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name: str, - workspace_name: str, - data_source_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "dataSourceName": _SERIALIZER.url("data_source_name", data_source_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_by_workspace_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - *, - filter: str, - skiptoken: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') - if skiptoken is not None: - query_parameters['$skiptoken'] = _SERIALIZER.query("skiptoken", skiptoken, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class DataSourcesOperations(object): - """DataSourcesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - data_source_name: str, - parameters: "_models.DataSource", - **kwargs: Any - ) -> "_models.DataSource": - """Create or update a data source. - - :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 data_source_name: The name of the datasource resource. - :type data_source_name: str - :param parameters: The parameters required to create or update a datasource. - :type parameters: ~azure.mgmt.loganalytics.models.DataSource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSource, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.DataSource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataSource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'DataSource') - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_name=data_source_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('DataSource', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('DataSource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}'} # type: ignore - - - @distributed_trace - def delete( - self, - resource_group_name: str, - workspace_name: str, - data_source_name: str, - **kwargs: Any - ) -> None: - """Deletes a data source instance. - - :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 data_source_name: Name of the datasource. - :type data_source_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_name=data_source_name, - subscription_id=self._config.subscription_id, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - data_source_name: str, - **kwargs: Any - ) -> "_models.DataSource": - """Gets a datasource instance. - - :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 data_source_name: Name of the datasource. - :type data_source_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DataSource, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.DataSource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataSource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_name=data_source_name, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DataSource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}'} # type: ignore - - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - filter: str, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.DataSourceListResult"]: - """Gets the first page of data source instances in a workspace with the link to the next page. - - :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 filter: The filter to apply on the operation. - :type filter: str - :param skiptoken: Starting point of the collection of data source instances. - :type skiptoken: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either DataSourceListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.DataSourceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DataSourceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - filter=filter, - skiptoken=skiptoken, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - filter=filter, - skiptoken=skiptoken, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataSourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources'} # type: ignore 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 index 24373c0a0d9f..69339b64503d 100644 --- 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 @@ -30,7 +30,7 @@ def build_list_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces') @@ -62,7 +62,7 @@ def build_list_by_resource_group_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces') diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_gateways_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_gateways_operations.py deleted file mode 100644 index 44b02b4ab2b6..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_gateways_operations.py +++ /dev/null @@ -1,129 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_delete_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - gateway_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "gatewayId": _SERIALIZER.url("gateway_id", gateway_id, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - **kwargs - ) - -class GatewaysOperations(object): - """GatewaysOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def delete( - self, - resource_group_name: str, - workspace_name: str, - gateway_id: str, - **kwargs: Any - ) -> None: - """Delete a Log Analytics gateway. - - :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 gateway_id: The Log Analytics gateway Id. - :type gateway_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - gateway_id=gateway_id, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_intelligence_packs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_intelligence_packs_operations.py deleted file mode 100644 index bf3c5129281b..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_intelligence_packs_operations.py +++ /dev/null @@ -1,298 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_disable_request( - resource_group_name: str, - workspace_name: str, - intelligence_pack_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "intelligencePackName": _SERIALIZER.url("intelligence_pack_name", intelligence_pack_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - **kwargs - ) - - -def build_enable_request( - resource_group_name: str, - workspace_name: str, - intelligence_pack_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "intelligencePackName": _SERIALIZER.url("intelligence_pack_name", intelligence_pack_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - **kwargs - ) - - -def build_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class IntelligencePacksOperations(object): - """IntelligencePacksOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def disable( - self, - resource_group_name: str, - workspace_name: str, - intelligence_pack_name: str, - **kwargs: Any - ) -> None: - """Disables an intelligence pack for a given 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 intelligence_pack_name: The name of the intelligence pack to be disabled. - :type intelligence_pack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_disable_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - intelligence_pack_name=intelligence_pack_name, - subscription_id=self._config.subscription_id, - template_url=self.disable.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable'} # type: ignore - - - @distributed_trace - def enable( - self, - resource_group_name: str, - workspace_name: str, - intelligence_pack_name: str, - **kwargs: Any - ) -> None: - """Enables an intelligence pack for a given 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 intelligence_pack_name: The name of the intelligence pack to be enabled. - :type intelligence_pack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_enable_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - intelligence_pack_name=intelligence_pack_name, - subscription_id=self._config.subscription_id, - template_url=self.enable.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - enable.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable'} # type: ignore - - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> List["_models.IntelligencePack"]: - """Lists all the intelligence packs possible and whether they are enabled or disabled for a given - 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of IntelligencePack, or the result of cls(response) - :rtype: list[~azure.mgmt.loganalytics.models.IntelligencePack] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.IntelligencePack"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[IntelligencePack]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_services_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_services_operations.py deleted file mode 100644 index cce186c1e694..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_services_operations.py +++ /dev/null @@ -1,574 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_create_or_update_request_initial( - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - subscription_id: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "linkedServiceName": _SERIALIZER.url("linked_service_name", linked_service_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_delete_request_initial( - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "linkedServiceName": _SERIALIZER.url("linked_service_name", linked_service_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "linkedServiceName": _SERIALIZER.url("linked_service_name", linked_service_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_by_workspace_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class LinkedServicesOperations(object): - """LinkedServicesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _create_or_update_initial( - self, - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - parameters: "_models.LinkedService", - **kwargs: Any - ) -> Optional["_models.LinkedService"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LinkedService"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'LinkedService') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - linked_service_name=linked_service_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('LinkedService', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('LinkedService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - parameters: "_models.LinkedService", - **kwargs: Any - ) -> LROPoller["_models.LinkedService"]: - """Create or update a linked service. - - :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 linked_service_name: Name of the linkedServices resource. - :type linked_service_name: str - :param parameters: The parameters required to create or update a linked service. - :type parameters: ~azure.mgmt.loganalytics.models.LinkedService - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either LinkedService or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.loganalytics.models.LinkedService] - :raises: ~azure.core.exceptions.HttpResponseError - """ - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedService"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - linked_service_name=linked_service_name, - parameters=parameters, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LinkedService', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - **kwargs: Any - ) -> Optional["_models.LinkedService"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LinkedService"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - linked_service_name=linked_service_name, - subscription_id=self._config.subscription_id, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('LinkedService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} # type: ignore - - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - **kwargs: Any - ) -> LROPoller["_models.LinkedService"]: - """Deletes a linked service instance. - - :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 linked_service_name: Name of the linked service. - :type linked_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either LinkedService or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.loganalytics.models.LinkedService] - :raises: ~azure.core.exceptions.HttpResponseError - """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedService"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - linked_service_name=linked_service_name, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('LinkedService', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - linked_service_name: str, - **kwargs: Any - ) -> "_models.LinkedService": - """Gets a linked service instance. - - :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 linked_service_name: Name of the linked service. - :type linked_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LinkedService, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.LinkedService - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedService"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - linked_service_name=linked_service_name, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LinkedService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} # type: ignore - - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Iterable["_models.LinkedServiceListResult"]: - """Gets the linked services instances in a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LinkedServiceListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.LinkedServiceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedServiceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LinkedServiceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_storage_accounts_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_storage_accounts_operations.py deleted file mode 100644 index 9b4654d6b88e..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_storage_accounts_operations.py +++ /dev/null @@ -1,446 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_create_or_update_request( - resource_group_name: str, - workspace_name: str, - data_source_type: Union[str, "_models.DataSourceType"], - subscription_id: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "dataSourceType": _SERIALIZER.url("data_source_type", data_source_type, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_delete_request( - resource_group_name: str, - workspace_name: str, - data_source_type: Union[str, "_models.DataSourceType"], - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "dataSourceType": _SERIALIZER.url("data_source_type", data_source_type, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name: str, - workspace_name: str, - data_source_type: Union[str, "_models.DataSourceType"], - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "dataSourceType": _SERIALIZER.url("data_source_type", data_source_type, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_by_workspace_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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 = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class LinkedStorageAccountsOperations(object): - """LinkedStorageAccountsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - data_source_type: Union[str, "_models.DataSourceType"], - parameters: "_models.LinkedStorageAccountsResource", - **kwargs: Any - ) -> "_models.LinkedStorageAccountsResource": - """Create or Update a link relation between current workspace and a group of storage accounts of a - specific data source type. - - :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 data_source_type: Linked storage accounts type. - :type data_source_type: str or ~azure.mgmt.loganalytics.models.DataSourceType - :param parameters: The parameters required to create or update linked storage accounts. - :type parameters: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LinkedStorageAccountsResource, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedStorageAccountsResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'LinkedStorageAccountsResource') - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_type=data_source_type, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LinkedStorageAccountsResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}'} # type: ignore - - - @distributed_trace - def delete( - self, - resource_group_name: str, - workspace_name: str, - data_source_type: Union[str, "_models.DataSourceType"], - **kwargs: Any - ) -> None: - """Deletes all linked storage accounts of a specific data source type associated with the - specified 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 data_source_type: Linked storage accounts type. - :type data_source_type: str or ~azure.mgmt.loganalytics.models.DataSourceType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_type=data_source_type, - subscription_id=self._config.subscription_id, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - data_source_type: Union[str, "_models.DataSourceType"], - **kwargs: Any - ) -> "_models.LinkedStorageAccountsResource": - """Gets all linked storage account of a specific data source type associated with the specified - 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 data_source_type: Linked storage accounts type. - :type data_source_type: str or ~azure.mgmt.loganalytics.models.DataSourceType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LinkedStorageAccountsResource, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedStorageAccountsResource"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - data_source_type=data_source_type, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LinkedStorageAccountsResource', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}'} # type: ignore - - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Iterable["_models.LinkedStorageAccountsListResult"]: - """Gets all linked storage accounts associated with the specified workspace, storage accounts will - be sorted by their data source type. - - :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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LinkedStorageAccountsListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.LinkedStorageAccountsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LinkedStorageAccountsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_workspace_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LinkedStorageAccountsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_management_groups_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_management_groups_operations.py deleted file mode 100644 index 072394582c52..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_management_groups_operations.py +++ /dev/null @@ -1,158 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class ManagementGroupsOperations(object): - """ManagementGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Iterable["_models.WorkspaceListManagementGroupsResult"]: - """Gets a list of management groups connected to a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListManagementGroupsResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.WorkspaceListManagementGroupsResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListManagementGroupsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListManagementGroupsResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operation_statuses_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operation_statuses_operations.py deleted file mode 100644 index 11cd5ce16b89..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operation_statuses_operations.py +++ /dev/null @@ -1,133 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_get_request( - location: str, - async_operation_id: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}') - path_format_arguments = { - "location": _SERIALIZER.url("location", location, 'str'), - "asyncOperationId": _SERIALIZER.url("async_operation_id", async_operation_id, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class OperationStatusesOperations(object): - """OperationStatusesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get( - self, - location: str, - async_operation_id: str, - **kwargs: Any - ) -> "_models.OperationStatus": - """Get the status of a long running azure asynchronous operation. - - :param location: The region name of operation. - :type location: str - :param async_operation_id: The operation Id. - :type async_operation_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: OperationStatus, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.OperationStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - location=location, - async_operation_id=async_operation_id, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('OperationStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operations.py index 68ee29ebe31c..9eb3f4483f70 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operations.py @@ -29,7 +29,7 @@ def build_list_request( **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/providers/Microsoft.OperationalInsights/operations') diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_saved_searches_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_saved_searches_operations.py deleted file mode 100644 index 9fd0136a9f4c..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_saved_searches_operations.py +++ /dev/null @@ -1,417 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_delete_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - saved_search_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "savedSearchId": _SERIALIZER.url("saved_search_id", saved_search_id, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - **kwargs - ) - - -def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - saved_search_id: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "savedSearchId": _SERIALIZER.url("saved_search_id", saved_search_id, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_get_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - saved_search_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "savedSearchId": _SERIALIZER.url("saved_search_id", saved_search_id, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_list_by_workspace_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class SavedSearchesOperations(object): - """SavedSearchesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def delete( - self, - resource_group_name: str, - workspace_name: str, - saved_search_id: str, - **kwargs: Any - ) -> None: - """Deletes the specified saved search in a given 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 saved_search_id: The id of the saved search. - :type saved_search_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - saved_search_id=saved_search_id, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}'} # type: ignore - - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - saved_search_id: str, - parameters: "_models.SavedSearch", - **kwargs: Any - ) -> "_models.SavedSearch": - """Creates or updates a saved search for a given 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 saved_search_id: The id of the saved search. - :type saved_search_id: str - :param parameters: The parameters required to save a search. - :type parameters: ~azure.mgmt.loganalytics.models.SavedSearch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SavedSearch, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SavedSearch - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SavedSearch"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'SavedSearch') - - request = build_create_or_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - saved_search_id=saved_search_id, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SavedSearch', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - saved_search_id: str, - **kwargs: Any - ) -> "_models.SavedSearch": - """Gets the specified saved search for a given 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 saved_search_id: The id of the saved search. - :type saved_search_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SavedSearch, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SavedSearch - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SavedSearch"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - saved_search_id=saved_search_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SavedSearch', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}'} # type: ignore - - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.SavedSearchesListResult": - """Gets the saved searches for a given Log Analytics 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SavedSearchesListResult, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SavedSearchesListResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SavedSearchesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SavedSearchesListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_schema_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_schema_operations.py deleted file mode 100644 index b1375421918c..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_schema_operations.py +++ /dev/null @@ -1,133 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_get_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class SchemaOperations(object): - """SchemaOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.SearchGetSchemaResponse": - """Gets the schema for a given 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SearchGetSchemaResponse, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SearchGetSchemaResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SearchGetSchemaResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SearchGetSchemaResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_shared_keys_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_shared_keys_operations.py deleted file mode 100644 index 33ae467863ff..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_shared_keys_operations.py +++ /dev/null @@ -1,220 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_get_shared_keys_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_regenerate_request( - subscription_id: str, - resource_group_name: str, - workspace_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey') - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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 = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class SharedKeysOperations(object): - """SharedKeysOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get_shared_keys( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.SharedKeys": - """Gets the shared keys for a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SharedKeys, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SharedKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_shared_keys_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.get_shared_keys.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SharedKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_shared_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys'} # type: ignore - - - @distributed_trace - def regenerate( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> "_models.SharedKeys": - """Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect - Microsoft Operational Insights agents to 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SharedKeys, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.SharedKeys - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SharedKeys"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_regenerate_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workspace_name=workspace_name, - template_url=self.regenerate.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SharedKeys', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - regenerate.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey'} # type: ignore - diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insight_configs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insight_configs_operations.py deleted file mode 100644 index 4d1e44c2dfb5..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insight_configs_operations.py +++ /dev/null @@ -1,445 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_create_or_update_request( - resource_group_name: str, - workspace_name: str, - storage_insight_name: str, - subscription_id: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "storageInsightName": _SERIALIZER.url("storage_insight_name", storage_insight_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_get_request( - resource_group_name: str, - workspace_name: str, - storage_insight_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "storageInsightName": _SERIALIZER.url("storage_insight_name", storage_insight_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - - -def build_delete_request( - resource_group_name: str, - workspace_name: str, - storage_insight_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "storageInsightName": _SERIALIZER.url("storage_insight_name", storage_insight_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - return HttpRequest( - method="DELETE", - url=url, - params=query_parameters, - **kwargs - ) - - -def build_list_by_workspace_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class StorageInsightConfigsOperations(object): - """StorageInsightConfigsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - workspace_name: str, - storage_insight_name: str, - parameters: "_models.StorageInsight", - **kwargs: Any - ) -> "_models.StorageInsight": - """Create or update a storage insight. - - :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 storage_insight_name: Name of the storageInsightsConfigs resource. - :type storage_insight_name: str - :param parameters: The parameters required to create or update a storage insight. - :type parameters: ~azure.mgmt.loganalytics.models.StorageInsight - :keyword callable cls: A custom type or function that will be passed the direct response - :return: StorageInsight, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.StorageInsight - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageInsight"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'StorageInsight') - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - storage_insight_name=storage_insight_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - json=_json, - template_url=self.create_or_update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('StorageInsight', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('StorageInsight', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'} # type: ignore - - - @distributed_trace - def get( - self, - resource_group_name: str, - workspace_name: str, - storage_insight_name: str, - **kwargs: Any - ) -> "_models.StorageInsight": - """Gets a storage insight instance. - - :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 storage_insight_name: Name of the storageInsightsConfigs resource. - :type storage_insight_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: StorageInsight, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.StorageInsight - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageInsight"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - storage_insight_name=storage_insight_name, - subscription_id=self._config.subscription_id, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('StorageInsight', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'} # type: ignore - - - @distributed_trace - def delete( - self, - resource_group_name: str, - workspace_name: str, - storage_insight_name: str, - **kwargs: Any - ) -> None: - """Deletes a storageInsightsConfigs resource. - - :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 storage_insight_name: Name of the storageInsightsConfigs resource. - :type storage_insight_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_delete_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - storage_insight_name=storage_insight_name, - subscription_id=self._config.subscription_id, - template_url=self.delete.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'} # type: ignore - - - @distributed_trace - def list_by_workspace( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Iterable["_models.StorageInsightListResult"]: - """Lists the storage insight instances within a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either StorageInsightListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.StorageInsightListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.StorageInsightListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list_by_workspace.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_workspace_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("StorageInsightListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_tables_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_tables_operations.py index 92f630390a58..5353f6b45bcb 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_tables_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_tables_operations.py @@ -35,7 +35,7 @@ def build_list_by_workspace_request( workspace_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables') @@ -76,7 +76,7 @@ def build_create_or_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}') @@ -122,7 +122,7 @@ def build_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}') @@ -163,7 +163,7 @@ def build_get_request( table_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}') @@ -200,7 +200,7 @@ def build_delete_request_initial( table_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}') @@ -237,7 +237,7 @@ def build_migrate_request( table_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate') diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_usages_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_usages_operations.py deleted file mode 100644 index 7e769ff13ef3..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_usages_operations.py +++ /dev/null @@ -1,157 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_list_request( - resource_group_name: str, - workspace_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class UsagesOperations(object): - """UsagesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - workspace_name: str, - **kwargs: Any - ) -> Iterable["_models.WorkspaceListUsagesResult"]: - """Gets a list of usage metrics for a 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 - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkspaceListUsagesResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.loganalytics.models.WorkspaceListUsagesResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspaceListUsagesResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - workspace_name=workspace_name, - subscription_id=self._config.subscription_id, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkspaceListUsagesResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages'} # type: ignore diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspace_purge_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspace_purge_operations.py deleted file mode 100644 index c2db08c34b3a..000000000000 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspace_purge_operations.py +++ /dev/null @@ -1,254 +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. -# -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - -def build_purge_request( - resource_group_name: str, - subscription_id: str, - workspace_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any -) -> HttpRequest: - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "workspaceName": _SERIALIZER.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 = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=url, - params=query_parameters, - headers=header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_get_purge_status_request( - resource_group_name: str, - subscription_id: str, - workspace_name: str, - purge_id: str, - **kwargs: Any -) -> HttpRequest: - api_version = "2020-08-01" - accept = "application/json" - # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}') - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "workspaceName": _SERIALIZER.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]$'), - "purgeId": _SERIALIZER.url("purge_id", purge_id, 'str'), - } - - url = _format_url_section(url, **path_format_arguments) - - # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=url, - params=query_parameters, - headers=header_parameters, - **kwargs - ) - -class WorkspacePurgeOperations(object): - """WorkspacePurgeOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.loganalytics.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def purge( - self, - resource_group_name: str, - workspace_name: str, - body: "_models.WorkspacePurgeBody", - **kwargs: Any - ) -> "_models.WorkspacePurgeResponse": - """Purges data in an Log Analytics workspace by a set of user-defined filters. - - In order to manage system resources, purge requests are throttled at 50 requests per hour. You - should batch the execution of purge requests by sending a single command whose predicate - includes all user identities that require purging. Use the in operator to specify multiple - identities. You should run the query prior to using for a purge request to verify that the - results are expected. - - :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 body: Describes the body of a request to purge data in a single table of an Log - Analytics Workspace. - :type body: ~azure.mgmt.loganalytics.models.WorkspacePurgeBody - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspacePurgeResponse, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.WorkspacePurgeResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspacePurgeResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(body, 'WorkspacePurgeBody') - - request = build_purge_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - workspace_name=workspace_name, - content_type=content_type, - json=_json, - template_url=self.purge.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['x-ms-status-location']=self._deserialize('str', response.headers.get('x-ms-status-location')) - - deserialized = self._deserialize('WorkspacePurgeResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - - purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge'} # type: ignore - - - @distributed_trace - def get_purge_status( - self, - resource_group_name: str, - workspace_name: str, - purge_id: str, - **kwargs: Any - ) -> "_models.WorkspacePurgeStatusResponse": - """Gets status of an ongoing purge operation. - - :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 purge_id: In a purge status request, this is the Id of the operation the status of which - is returned. - :type purge_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkspacePurgeStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.loganalytics.models.WorkspacePurgeStatusResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkspacePurgeStatusResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - - request = build_get_purge_status_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - workspace_name=workspace_name, - purge_id=purge_id, - template_url=self.get_purge_status.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkspacePurgeStatusResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}'} # type: ignore - 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 ecd41a4a6871..bf796bf92407 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 @@ -33,7 +33,7 @@ def build_list_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces') @@ -65,7 +65,7 @@ def build_list_by_resource_group_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces') @@ -104,7 +104,7 @@ def build_create_or_update_request_initial( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}') @@ -145,7 +145,7 @@ def build_delete_request_initial( force: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}') @@ -182,7 +182,7 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}') @@ -222,7 +222,7 @@ def build_update_request( ) -> HttpRequest: content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-12-01-preview" + api_version = "2022-02-01" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}')