From e0c2d6caa23e5369d445da974fc4553c786103a6 Mon Sep 17 00:00:00 2001 From: Qiaoqiao Zhang <55688292+qiaozha@users.noreply.github.com> Date: Mon, 20 Apr 2020 22:40:17 +0800 Subject: [PATCH] release mgmt loganalytics 0.4.0 (#10923) * release mgmt loganalytics 0.4.0 * Packaging update of azure-mgmt-loganalytics Co-authored-by: Azure SDK Bot --- .../azure-mgmt-loganalytics/CHANGELOG.md | 27 + .../azure-mgmt-loganalytics/MANIFEST.in | 4 + .../azure-mgmt-loganalytics/README.md | 48 +- ..._operational_insights_management_client.py | 59 ++- .../mgmt/loganalytics/models/__init__.py | 53 +- .../azure/mgmt/loganalytics/models/_models.py | 407 ++++++++++++++- .../mgmt/loganalytics/models/_models_py3.py | 409 ++++++++++++++- ...tional_insights_management_client_enums.py | 45 +- .../mgmt/loganalytics/models/_paged_models.py | 48 +- .../mgmt/loganalytics/operations/__init__.py | 26 +- .../operations/_clusters_operations.py | 62 ++- .../operations/_gateways_operations.py | 97 ++++ .../_intelligence_packs_operations.py | 219 ++++++++ .../operations/_linked_services_operations.py | 147 ++++-- .../_management_groups_operations.py | 113 ++++ ...s.py => _operation_statuses_operations.py} | 34 +- .../operations/_schema_operations.py | 102 ++++ .../operations/_shared_keys_operations.py | 166 ++++++ ...=> _storage_insight_configs_operations.py} | 4 +- .../operations/_usages_operations.py | 113 ++++ .../operations/_workspace_purge_operations.py | 192 +++++++ .../operations/_workspaces_operations.py | 485 +++--------------- .../azure/mgmt/loganalytics/version.py | 2 +- .../dev_requirements.txt | 2 + .../azure-mgmt-loganalytics/setup.py | 2 +- 25 files changed, 2303 insertions(+), 563 deletions(-) create mode 100644 sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_gateways_operations.py create mode 100644 sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_intelligence_packs_operations.py create mode 100644 sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_management_groups_operations.py rename sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/{_operational_insights_management_client_operations.py => _operation_statuses_operations.py} (76%) create mode 100644 sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_schema_operations.py create mode 100644 sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_shared_keys_operations.py rename sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/{_storage_insights_operations.py => _storage_insight_configs_operations.py} (99%) create mode 100644 sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_usages_operations.py create mode 100644 sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspace_purge_operations.py create mode 100644 sdk/loganalytics/azure-mgmt-loganalytics/dev_requirements.txt diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/CHANGELOG.md b/sdk/loganalytics/azure-mgmt-loganalytics/CHANGELOG.md index 8f3939b95eab..5273164b2d9a 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/CHANGELOG.md +++ b/sdk/loganalytics/azure-mgmt-loganalytics/CHANGELOG.md @@ -1,5 +1,32 @@ # Release History +## 0.4.0 (2020-04-20) + +**Features** + + - Model LinkedService has a new parameter provisioning_state + - Added operation WorkspacesOperations.available_service_tiers + - Added operation group ManagementGroupsOperations + - Added operation group GatewaysOperations + - Added operation group OperationStatusesOperations + - Added operation group SchemaOperations + - Added operation group WorkspacePurgeOperations + - Added operation group UsagesOperations + - Added operation group SharedKeysOperations + - Added operation group StorageInsightConfigsOperations + - Added operation group IntelligencePacksOperations + +**Breaking changes** + + - Removed operation WorkspacesOperations.list_usages + - Removed operation WorkspacesOperations.get_shared_keys + - Removed operation WorkspacesOperations.disable_intelligence_pack + - Removed operation WorkspacesOperations.list_intelligence_packs + - Removed operation WorkspacesOperations.list_management_groups + - Removed operation WorkspacesOperations.enable_intelligence_pack + - Removed operation group StorageInsightsOperations + - Removed operation group OperationalInsightsManagementClientOperationsMixin + ## 0.3.0 (2020-04-08) **Features** diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/MANIFEST.in b/sdk/loganalytics/azure-mgmt-loganalytics/MANIFEST.in index efa752eaff96..a3cb07df8765 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/MANIFEST.in +++ b/sdk/loganalytics/azure-mgmt-loganalytics/MANIFEST.in @@ -1 +1,5 @@ +recursive-include tests *.py *.yaml include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/README.md b/sdk/loganalytics/azure-mgmt-loganalytics/README.md index beaa342dc92f..87dcf93e2334 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/README.md +++ b/sdk/loganalytics/azure-mgmt-loganalytics/README.md @@ -1,47 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure Log Analytics Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/) -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. +# Usage -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. +For code examples, see [Log Analytics Management](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. -## Compatibility +# Provide Feedback -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this -package. - -You can check the version using pip: - -``` shell -pip freeze -``` - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -``` shell -pip uninstall azure -``` - -## Usage - -For code examples, see [Log Analytics -Management](https://docs.microsoft.com/python/api/overview/azure/) on -docs.microsoft.com. - -## Provide Feedback - -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-loganalytics%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-loganalytics%2FREADME.png) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_operational_insights_management_client.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_operational_insights_management_client.py index eac309bd9033..5a0407ade5c4 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_operational_insights_management_client.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_operational_insights_management_client.py @@ -13,20 +13,27 @@ from msrest import Serializer, Deserializer from ._configuration import OperationalInsightsManagementClientConfiguration -from .operations import OperationalInsightsManagementClientOperationsMixin from .operations import DataExportsOperations from .operations import DataSourcesOperations -from .operations import WorkspacesOperations +from .operations import IntelligencePacksOperations from .operations import LinkedServicesOperations from .operations import LinkedStorageAccountsOperations +from .operations import ManagementGroupsOperations from .operations import Operations +from .operations import OperationStatusesOperations +from .operations import SharedKeysOperations +from .operations import UsagesOperations +from .operations import WorkspacesOperations from .operations import ClustersOperations -from .operations import StorageInsightsOperations +from .operations import StorageInsightConfigsOperations from .operations import SavedSearchesOperations +from .operations import GatewaysOperations +from .operations import SchemaOperations +from .operations import WorkspacePurgeOperations from . import models -class OperationalInsightsManagementClient(OperationalInsightsManagementClientOperationsMixin, SDKClient): +class OperationalInsightsManagementClient(SDKClient): """Operational Insights Client :ivar config: Configuration for client. @@ -36,20 +43,36 @@ class OperationalInsightsManagementClient(OperationalInsightsManagementClientOpe :vartype data_exports: azure.mgmt.loganalytics.operations.DataExportsOperations :ivar data_sources: DataSources operations :vartype data_sources: azure.mgmt.loganalytics.operations.DataSourcesOperations - :ivar workspaces: Workspaces operations - :vartype workspaces: azure.mgmt.loganalytics.operations.WorkspacesOperations + :ivar intelligence_packs: IntelligencePacks operations + :vartype intelligence_packs: azure.mgmt.loganalytics.operations.IntelligencePacksOperations :ivar linked_services: LinkedServices operations :vartype linked_services: azure.mgmt.loganalytics.operations.LinkedServicesOperations :ivar linked_storage_accounts: LinkedStorageAccounts operations :vartype linked_storage_accounts: azure.mgmt.loganalytics.operations.LinkedStorageAccountsOperations + :ivar management_groups: ManagementGroups operations + :vartype management_groups: azure.mgmt.loganalytics.operations.ManagementGroupsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.loganalytics.operations.Operations + :ivar operation_statuses: OperationStatuses operations + :vartype operation_statuses: azure.mgmt.loganalytics.operations.OperationStatusesOperations + :ivar shared_keys: SharedKeys operations + :vartype shared_keys: azure.mgmt.loganalytics.operations.SharedKeysOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.loganalytics.operations.UsagesOperations + :ivar workspaces: Workspaces operations + :vartype workspaces: azure.mgmt.loganalytics.operations.WorkspacesOperations :ivar clusters: Clusters operations :vartype clusters: azure.mgmt.loganalytics.operations.ClustersOperations - :ivar storage_insights: StorageInsights operations - :vartype storage_insights: azure.mgmt.loganalytics.operations.StorageInsightsOperations + :ivar storage_insight_configs: StorageInsightConfigs operations + :vartype storage_insight_configs: azure.mgmt.loganalytics.operations.StorageInsightConfigsOperations :ivar saved_searches: SavedSearches operations :vartype saved_searches: azure.mgmt.loganalytics.operations.SavedSearchesOperations + :ivar gateways: Gateways operations + :vartype gateways: azure.mgmt.loganalytics.operations.GatewaysOperations + :ivar schema: Schema operations + :vartype schema: azure.mgmt.loganalytics.operations.SchemaOperations + :ivar workspace_purge: WorkspacePurge operations + :vartype workspace_purge: azure.mgmt.loganalytics.operations.WorkspacePurgeOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -74,17 +97,33 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.data_sources = DataSourcesOperations( self._client, self.config, self._serialize, self._deserialize) - self.workspaces = WorkspacesOperations( + 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.operations = Operations( 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.workspaces = WorkspacesOperations( + self._client, self.config, self._serialize, self._deserialize) self.clusters = ClustersOperations( self._client, self.config, self._serialize, self._deserialize) - self.storage_insights = StorageInsightsOperations( + 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.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) 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 d441d7803976..a25cdc5c9908 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 @@ -10,11 +10,13 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AvailableServiceTier from ._models_py3 import AzureEntityResource from ._models_py3 import Cluster from ._models_py3 import ClusterErrorResponse, ClusterErrorResponseException from ._models_py3 import ClusterPatch from ._models_py3 import ClusterSku + from ._models_py3 import CoreSummary from ._models_py3 import DataExport from ._models_py3 import DataExportErrorResponse, DataExportErrorResponseException from ._models_py3 import DataSource @@ -36,6 +38,11 @@ from ._models_py3 import Resource from ._models_py3 import SavedSearch from ._models_py3 import SavedSearchesListResult + from ._models_py3 import SearchGetSchemaResponse + from ._models_py3 import SearchMetadata + from ._models_py3 import SearchMetadataSchema + 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 @@ -45,13 +52,19 @@ from ._models_py3 import UsageMetric from ._models_py3 import Workspace 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 except (SyntaxError, ImportError): + from ._models import AvailableServiceTier from ._models import AzureEntityResource from ._models import Cluster from ._models import ClusterErrorResponse, ClusterErrorResponseException from ._models import ClusterPatch from ._models import ClusterSku + from ._models import CoreSummary from ._models import DataExport from ._models import DataExportErrorResponse, DataExportErrorResponseException from ._models import DataSource @@ -73,6 +86,11 @@ from ._models import Resource from ._models import SavedSearch from ._models import SavedSearchesListResult + from ._models import SearchGetSchemaResponse + from ._models import SearchMetadata + from ._models import SearchMetadataSchema + from ._models import SearchSchemaValue + from ._models import SearchSort from ._models import SharedKeys from ._models import StorageAccount from ._models import StorageInsight @@ -82,6 +100,10 @@ from ._models import UsageMetric from ._models import Workspace from ._models import WorkspacePatch + from ._models import WorkspacePurgeBody + from ._models import WorkspacePurgeBodyFilters + from ._models import WorkspacePurgeResponse + from ._models import WorkspacePurgeStatusResponse from ._models import WorkspaceSku from ._paged_models import ClusterPaged from ._paged_models import DataExportPaged @@ -96,21 +118,28 @@ from ._operational_insights_management_client_enums import ( Type, DataSourceKind, + LinkedServiceEntityStatus, DataSourceType, WorkspaceSkuNameEnum, - EntityStatus, + WorkspaceEntityStatus, PublicNetworkAccessType, + ClusterEntityStatus, ClusterSkuNameEnum, IdentityType, StorageInsightState, + SkuNameEnum, + SearchSortEnum, + PurgeState, ) __all__ = [ + 'AvailableServiceTier', 'AzureEntityResource', 'Cluster', 'ClusterErrorResponse', 'ClusterErrorResponseException', 'ClusterPatch', 'ClusterSku', + 'CoreSummary', 'DataExport', 'DataExportErrorResponse', 'DataExportErrorResponseException', 'DataSource', @@ -132,6 +161,11 @@ 'Resource', 'SavedSearch', 'SavedSearchesListResult', + 'SearchGetSchemaResponse', + 'SearchMetadata', + 'SearchMetadataSchema', + 'SearchSchemaValue', + 'SearchSort', 'SharedKeys', 'StorageAccount', 'StorageInsight', @@ -141,24 +175,33 @@ 'UsageMetric', 'Workspace', 'WorkspacePatch', + 'WorkspacePurgeBody', + 'WorkspacePurgeBodyFilters', + 'WorkspacePurgeResponse', + 'WorkspacePurgeStatusResponse', 'WorkspaceSku', 'DataExportPaged', 'DataSourcePaged', - 'ManagementGroupPaged', - 'UsageMetricPaged', - 'WorkspacePaged', 'LinkedServicePaged', 'LinkedStorageAccountsResourcePaged', + 'ManagementGroupPaged', 'OperationPaged', + 'UsageMetricPaged', + 'WorkspacePaged', 'ClusterPaged', 'StorageInsightPaged', 'Type', 'DataSourceKind', + 'LinkedServiceEntityStatus', 'DataSourceType', 'WorkspaceSkuNameEnum', - 'EntityStatus', + 'WorkspaceEntityStatus', 'PublicNetworkAccessType', + 'ClusterEntityStatus', 'ClusterSkuNameEnum', 'IdentityType', 'StorageInsightState', + 'SkuNameEnum', + 'SearchSortEnum', + 'PurgeState', ] diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py index dec384ebc1f5..bb1bd8a415b8 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models.py @@ -13,6 +13,66 @@ from msrest.exceptions import HttpOperationError +class AvailableServiceTier(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: datetime + """ + + _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': 'iso-8601'}, + } + + 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(Model): """Resource. @@ -167,9 +227,9 @@ class Cluster(TrackedResource): :vartype cluster_id: str :ivar provisioning_state: The provisioning state of the cluster. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', - 'ProvisioningAccount' + 'ProvisioningAccount', 'Updating' :vartype provisioning_state: str or - ~azure.mgmt.loganalytics.models.EntityStatus + ~azure.mgmt.loganalytics.models.ClusterEntityStatus :param key_vault_properties: The associated key properties. :type key_vault_properties: ~azure.mgmt.loganalytics.models.KeyVaultProperties @@ -283,6 +343,33 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) +class CoreSummary(Model): + """The core summary of a search. + + All required parameters must be populated in order to send to Azure. + + :param status: The status of a core summary. + :type status: str + :param number_of_documents: Required. The number of documents of a core + summary. + :type number_of_documents: long + """ + + _validation = { + 'number_of_documents': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'number_of_documents': {'key': 'numberOfDocuments', 'type': 'long'}, + } + + def __init__(self, **kwargs): + super(CoreSummary, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.number_of_documents = kwargs.get('number_of_documents', None) + + class ProxyResource(Resource): """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. @@ -703,6 +790,11 @@ class LinkedService(ProxyResource): be linked to the workspace. This should be used for linking resources which require write access :type write_access_resource_id: str + :param provisioning_state: The provisioning state of the linked service. + Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', + 'Updating' + :type provisioning_state: str or + ~azure.mgmt.loganalytics.models.LinkedServiceEntityStatus :param tags: Resource tags. :type tags: dict[str, str] """ @@ -719,6 +811,7 @@ class LinkedService(ProxyResource): 'type': {'key': 'type', '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'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -726,6 +819,7 @@ def __init__(self, **kwargs): super(LinkedService, self).__init__(**kwargs) self.resource_id = kwargs.get('resource_id', None) self.write_access_resource_id = kwargs.get('write_access_resource_id', None) + self.provisioning_state = kwargs.get('provisioning_state', None) self.tags = kwargs.get('tags', None) @@ -1028,6 +1122,198 @@ def __init__(self, **kwargs): self.value = kwargs.get('value', None) +class SearchGetSchemaResponse(Model): + """The get schema operation response. + + :param metadata: The metadata from search results. + :type metadata: ~azure.mgmt.loganalytics.models.SearchMetadata + :param value: The array of result values. + :type value: list[~azure.mgmt.loganalytics.models.SearchSchemaValue] + """ + + _attribute_map = { + 'metadata': {'key': 'metadata', 'type': 'SearchMetadata'}, + 'value': {'key': 'value', 'type': '[SearchSchemaValue]'}, + } + + def __init__(self, **kwargs): + super(SearchGetSchemaResponse, self).__init__(**kwargs) + self.metadata = kwargs.get('metadata', None) + self.value = kwargs.get('value', None) + + +class SearchMetadata(Model): + """Metadata for search results. + + :param search_id: The request id of the search. + :type search_id: str + :param result_type: The search result type. + :type result_type: str + :param total: The total number of search results. + :type total: long + :param top: The number of top search results. + :type top: long + :param id: The id of the search results request. + :type id: str + :param core_summaries: The core summaries. + :type core_summaries: list[~azure.mgmt.loganalytics.models.CoreSummary] + :param status: The status of the search results. + :type status: str + :param start_time: The start time for the search. + :type start_time: datetime + :param last_updated: The time of last update. + :type last_updated: datetime + :param e_tag: The ETag of the search results. + :type e_tag: str + :param sort: How the results are sorted. + :type sort: list[~azure.mgmt.loganalytics.models.SearchSort] + :param request_time: The request time. + :type request_time: long + :param aggregated_value_field: The aggregated value field. + :type aggregated_value_field: str + :param aggregated_grouping_fields: The aggregated grouping fields. + :type aggregated_grouping_fields: str + :param sum: The sum of all aggregates returned in the result set. + :type sum: long + :param max: The max of all aggregates returned in the result set. + :type max: long + :param schema: The schema. + :type 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, **kwargs): + super(SearchMetadata, self).__init__(**kwargs) + self.search_id = kwargs.get('search_id', None) + self.result_type = kwargs.get('result_type', None) + self.total = kwargs.get('total', None) + self.top = kwargs.get('top', None) + self.id = kwargs.get('id', None) + self.core_summaries = kwargs.get('core_summaries', None) + self.status = kwargs.get('status', None) + self.start_time = kwargs.get('start_time', None) + self.last_updated = kwargs.get('last_updated', None) + self.e_tag = kwargs.get('e_tag', None) + self.sort = kwargs.get('sort', None) + self.request_time = kwargs.get('request_time', None) + self.aggregated_value_field = kwargs.get('aggregated_value_field', None) + self.aggregated_grouping_fields = kwargs.get('aggregated_grouping_fields', None) + self.sum = kwargs.get('sum', None) + self.max = kwargs.get('max', None) + self.schema = kwargs.get('schema', None) + + +class SearchMetadataSchema(Model): + """Schema metadata for search. + + :param name: The name of the metadata schema. + :type name: str + :param version: The version of the metadata schema. + :type version: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(SearchMetadataSchema, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.version = kwargs.get('version', None) + + +class SearchSchemaValue(Model): + """Value object for schema results. + + All required parameters must be populated in order to send to Azure. + + :param name: The name of the schema. + :type name: str + :param display_name: The display name of the schema. + :type display_name: str + :param type: The type. + :type type: str + :param indexed: Required. The boolean that indicates the field is + searchable as free text. + :type indexed: bool + :param stored: Required. The boolean that indicates whether or not the + field is stored. + :type stored: bool + :param facet: Required. The boolean that indicates whether or not the + field is a facet. + :type facet: bool + :param owner_type: The array of workflows containing the field. + :type 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, **kwargs): + super(SearchSchemaValue, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.type = kwargs.get('type', None) + self.indexed = kwargs.get('indexed', None) + self.stored = kwargs.get('stored', None) + self.facet = kwargs.get('facet', None) + self.owner_type = kwargs.get('owner_type', None) + + +class SearchSort(Model): + """The sort parameters for search. + + :param name: The name of the field the search query is sorted on. + :type name: str + :param order: The sort order of the search. Possible values include: + 'asc', 'desc' + :type order: str or ~azure.mgmt.loganalytics.models.SearchSortEnum + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SearchSort, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.order = kwargs.get('order', None) + + class SharedKeys(Model): """The shared keys for a workspace. @@ -1251,9 +1537,9 @@ class Workspace(TrackedResource): :type location: str :param provisioning_state: The provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', - 'Deleting', 'ProvisioningAccount' + 'Deleting', 'ProvisioningAccount', 'Updating' :type provisioning_state: str or - ~azure.mgmt.loganalytics.models.EntityStatus + ~azure.mgmt.loganalytics.models.WorkspaceEntityStatus :ivar customer_id: This is a read-only property. Represents the ID associated with the workspace. :vartype customer_id: str @@ -1337,9 +1623,9 @@ class WorkspacePatch(AzureEntityResource): :vartype etag: str :param provisioning_state: The provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', - 'Deleting', 'ProvisioningAccount' + 'Deleting', 'ProvisioningAccount', 'Updating' :type provisioning_state: str or - ~azure.mgmt.loganalytics.models.EntityStatus + ~azure.mgmt.loganalytics.models.WorkspaceEntityStatus :ivar customer_id: This is a read-only property. Represents the ID associated with the workspace. :vartype customer_id: str @@ -1404,6 +1690,115 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) +class WorkspacePurgeBody(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. + + :param table: Required. Table from which to purge data. + :type table: str + :param filters: Required. The set of columns and filters (queries) to run + over them to purge the resulting data. + :type 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, **kwargs): + super(WorkspacePurgeBody, self).__init__(**kwargs) + self.table = kwargs.get('table', None) + self.filters = kwargs.get('filters', None) + + +class WorkspacePurgeBodyFilters(Model): + """User-defined filters to return data which will be purged from the table. + + :param column: The column of the table over which the given query should + run + :type column: str + :param 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. + :type operator: str + :param 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. + :type value: object + :param key: When filtering over custom dimensions, this key will be used + as the name of the custom dimension. + :type 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, **kwargs): + super(WorkspacePurgeBodyFilters, self).__init__(**kwargs) + self.column = kwargs.get('column', None) + self.operator = kwargs.get('operator', None) + self.value = kwargs.get('value', None) + self.key = kwargs.get('key', None) + + +class WorkspacePurgeResponse(Model): + """Response containing operationId for a specific purge action. + + All required parameters must be populated in order to send to Azure. + + :param operation_id: Required. Id to use when querying for status for a + particular purge operation. + :type operation_id: str + """ + + _validation = { + 'operation_id': {'required': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkspacePurgeResponse, self).__init__(**kwargs) + self.operation_id = kwargs.get('operation_id', None) + + +class WorkspacePurgeStatusResponse(Model): + """Response containing status for a specific purge operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the operation represented by the + requested Id. Possible values include: 'pending', 'completed' + :type status: str or ~azure.mgmt.loganalytics.models.PurgeState + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkspacePurgeStatusResponse, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + + class WorkspaceSku(Model): """The SKU (tier) of a 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 2ebee3fa3e3f..15cd80e08782 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 @@ -13,6 +13,66 @@ from msrest.exceptions import HttpOperationError +class AvailableServiceTier(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: datetime + """ + + _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': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + 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(Model): """Resource. @@ -167,9 +227,9 @@ class Cluster(TrackedResource): :vartype cluster_id: str :ivar provisioning_state: The provisioning state of the cluster. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', - 'ProvisioningAccount' + 'ProvisioningAccount', 'Updating' :vartype provisioning_state: str or - ~azure.mgmt.loganalytics.models.EntityStatus + ~azure.mgmt.loganalytics.models.ClusterEntityStatus :param key_vault_properties: The associated key properties. :type key_vault_properties: ~azure.mgmt.loganalytics.models.KeyVaultProperties @@ -283,6 +343,33 @@ def __init__(self, *, capacity: int=None, name=None, **kwargs) -> None: self.name = name +class CoreSummary(Model): + """The core summary of a search. + + All required parameters must be populated in order to send to Azure. + + :param status: The status of a core summary. + :type status: str + :param number_of_documents: Required. The number of documents of a core + summary. + :type number_of_documents: long + """ + + _validation = { + 'number_of_documents': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'number_of_documents': {'key': 'numberOfDocuments', 'type': 'long'}, + } + + def __init__(self, *, number_of_documents: int, status: str=None, **kwargs) -> None: + super(CoreSummary, self).__init__(**kwargs) + self.status = status + self.number_of_documents = number_of_documents + + class ProxyResource(Resource): """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. @@ -703,6 +790,11 @@ class LinkedService(ProxyResource): be linked to the workspace. This should be used for linking resources which require write access :type write_access_resource_id: str + :param provisioning_state: The provisioning state of the linked service. + Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', + 'Updating' + :type provisioning_state: str or + ~azure.mgmt.loganalytics.models.LinkedServiceEntityStatus :param tags: Resource tags. :type tags: dict[str, str] """ @@ -719,13 +811,15 @@ class LinkedService(ProxyResource): 'type': {'key': 'type', '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'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, resource_id: str=None, write_access_resource_id: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, resource_id: str=None, write_access_resource_id: str=None, provisioning_state=None, tags=None, **kwargs) -> None: super(LinkedService, self).__init__(**kwargs) self.resource_id = resource_id self.write_access_resource_id = write_access_resource_id + self.provisioning_state = provisioning_state self.tags = tags @@ -1028,6 +1122,198 @@ def __init__(self, *, value=None, **kwargs) -> None: self.value = value +class SearchGetSchemaResponse(Model): + """The get schema operation response. + + :param metadata: The metadata from search results. + :type metadata: ~azure.mgmt.loganalytics.models.SearchMetadata + :param value: The array of result values. + :type value: list[~azure.mgmt.loganalytics.models.SearchSchemaValue] + """ + + _attribute_map = { + 'metadata': {'key': 'metadata', 'type': 'SearchMetadata'}, + 'value': {'key': 'value', 'type': '[SearchSchemaValue]'}, + } + + def __init__(self, *, metadata=None, value=None, **kwargs) -> None: + super(SearchGetSchemaResponse, self).__init__(**kwargs) + self.metadata = metadata + self.value = value + + +class SearchMetadata(Model): + """Metadata for search results. + + :param search_id: The request id of the search. + :type search_id: str + :param result_type: The search result type. + :type result_type: str + :param total: The total number of search results. + :type total: long + :param top: The number of top search results. + :type top: long + :param id: The id of the search results request. + :type id: str + :param core_summaries: The core summaries. + :type core_summaries: list[~azure.mgmt.loganalytics.models.CoreSummary] + :param status: The status of the search results. + :type status: str + :param start_time: The start time for the search. + :type start_time: datetime + :param last_updated: The time of last update. + :type last_updated: datetime + :param e_tag: The ETag of the search results. + :type e_tag: str + :param sort: How the results are sorted. + :type sort: list[~azure.mgmt.loganalytics.models.SearchSort] + :param request_time: The request time. + :type request_time: long + :param aggregated_value_field: The aggregated value field. + :type aggregated_value_field: str + :param aggregated_grouping_fields: The aggregated grouping fields. + :type aggregated_grouping_fields: str + :param sum: The sum of all aggregates returned in the result set. + :type sum: long + :param max: The max of all aggregates returned in the result set. + :type max: long + :param schema: The schema. + :type 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: str=None, result_type: str=None, total: int=None, top: int=None, id: str=None, core_summaries=None, status: str=None, start_time=None, last_updated=None, e_tag: str=None, sort=None, request_time: int=None, aggregated_value_field: str=None, aggregated_grouping_fields: str=None, sum: int=None, max: int=None, schema=None, **kwargs) -> None: + 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(Model): + """Schema metadata for search. + + :param name: The name of the metadata schema. + :type name: str + :param version: The version of the metadata schema. + :type version: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, version: int=None, **kwargs) -> None: + super(SearchMetadataSchema, self).__init__(**kwargs) + self.name = name + self.version = version + + +class SearchSchemaValue(Model): + """Value object for schema results. + + All required parameters must be populated in order to send to Azure. + + :param name: The name of the schema. + :type name: str + :param display_name: The display name of the schema. + :type display_name: str + :param type: The type. + :type type: str + :param indexed: Required. The boolean that indicates the field is + searchable as free text. + :type indexed: bool + :param stored: Required. The boolean that indicates whether or not the + field is stored. + :type stored: bool + :param facet: Required. The boolean that indicates whether or not the + field is a facet. + :type facet: bool + :param owner_type: The array of workflows containing the field. + :type 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: str=None, display_name: str=None, type: str=None, owner_type=None, **kwargs) -> None: + 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(Model): + """The sort parameters for search. + + :param name: The name of the field the search query is sorted on. + :type name: str + :param order: The sort order of the search. Possible values include: + 'asc', 'desc' + :type order: str or ~azure.mgmt.loganalytics.models.SearchSortEnum + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, order=None, **kwargs) -> None: + super(SearchSort, self).__init__(**kwargs) + self.name = name + self.order = order + + class SharedKeys(Model): """The shared keys for a workspace. @@ -1251,9 +1537,9 @@ class Workspace(TrackedResource): :type location: str :param provisioning_state: The provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', - 'Deleting', 'ProvisioningAccount' + 'Deleting', 'ProvisioningAccount', 'Updating' :type provisioning_state: str or - ~azure.mgmt.loganalytics.models.EntityStatus + ~azure.mgmt.loganalytics.models.WorkspaceEntityStatus :ivar customer_id: This is a read-only property. Represents the ID associated with the workspace. :vartype customer_id: str @@ -1337,9 +1623,9 @@ class WorkspacePatch(AzureEntityResource): :vartype etag: str :param provisioning_state: The provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', - 'Deleting', 'ProvisioningAccount' + 'Deleting', 'ProvisioningAccount', 'Updating' :type provisioning_state: str or - ~azure.mgmt.loganalytics.models.EntityStatus + ~azure.mgmt.loganalytics.models.WorkspaceEntityStatus :ivar customer_id: This is a read-only property. Represents the ID associated with the workspace. :vartype customer_id: str @@ -1404,6 +1690,115 @@ def __init__(self, *, provisioning_state=None, sku=None, retention_in_days: int= self.tags = tags +class WorkspacePurgeBody(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. + + :param table: Required. Table from which to purge data. + :type table: str + :param filters: Required. The set of columns and filters (queries) to run + over them to purge the resulting data. + :type 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, **kwargs) -> None: + super(WorkspacePurgeBody, self).__init__(**kwargs) + self.table = table + self.filters = filters + + +class WorkspacePurgeBodyFilters(Model): + """User-defined filters to return data which will be purged from the table. + + :param column: The column of the table over which the given query should + run + :type column: str + :param 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. + :type operator: str + :param 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. + :type value: object + :param key: When filtering over custom dimensions, this key will be used + as the name of the custom dimension. + :type 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: str=None, operator: str=None, value=None, key: str=None, **kwargs) -> None: + super(WorkspacePurgeBodyFilters, self).__init__(**kwargs) + self.column = column + self.operator = operator + self.value = value + self.key = key + + +class WorkspacePurgeResponse(Model): + """Response containing operationId for a specific purge action. + + All required parameters must be populated in order to send to Azure. + + :param operation_id: Required. Id to use when querying for status for a + particular purge operation. + :type operation_id: str + """ + + _validation = { + 'operation_id': {'required': True}, + } + + _attribute_map = { + 'operation_id': {'key': 'operationId', 'type': 'str'}, + } + + def __init__(self, *, operation_id: str, **kwargs) -> None: + super(WorkspacePurgeResponse, self).__init__(**kwargs) + self.operation_id = operation_id + + +class WorkspacePurgeStatusResponse(Model): + """Response containing status for a specific purge operation. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. Status of the operation represented by the + requested Id. Possible values include: 'pending', 'completed' + :type status: str or ~azure.mgmt.loganalytics.models.PurgeState + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, status, **kwargs) -> None: + super(WorkspacePurgeStatusResponse, self).__init__(**kwargs) + self.status = status + + class WorkspaceSku(Model): """The SKU (tier) of a workspace. diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_operational_insights_management_client_enums.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_operational_insights_management_client_enums.py index f1170dbd55cd..849d8895a5e7 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_operational_insights_management_client_enums.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_operational_insights_management_client_enums.py @@ -55,6 +55,14 @@ class DataSourceKind(str, Enum): sql_data_classification = "SqlDataClassification" +class LinkedServiceEntityStatus(str, Enum): + + succeeded = "Succeeded" + deleting = "Deleting" + provisioning_account = "ProvisioningAccount" + updating = "Updating" + + class DataSourceType(str, Enum): custom_logs = "CustomLogs" @@ -72,7 +80,7 @@ class WorkspaceSkuNameEnum(str, Enum): capacity_reservation = "CapacityReservation" -class EntityStatus(str, Enum): +class WorkspaceEntityStatus(str, Enum): creating = "Creating" succeeded = "Succeeded" @@ -80,6 +88,7 @@ class EntityStatus(str, Enum): canceled = "Canceled" deleting = "Deleting" provisioning_account = "ProvisioningAccount" + updating = "Updating" class PublicNetworkAccessType(str, Enum): @@ -88,6 +97,17 @@ class PublicNetworkAccessType(str, Enum): disabled = "Disabled" #: Disables public connectivity to Log Analytics through public DNS. +class ClusterEntityStatus(str, Enum): + + creating = "Creating" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + deleting = "Deleting" + provisioning_account = "ProvisioningAccount" + updating = "Updating" + + class ClusterSkuNameEnum(str, Enum): capacity_reservation = "CapacityReservation" @@ -103,3 +123,26 @@ class StorageInsightState(str, Enum): ok = "OK" error = "ERROR" + + +class SkuNameEnum(str, Enum): + + free = "Free" + standard = "Standard" + premium = "Premium" + per_node = "PerNode" + per_gb2018 = "PerGB2018" + standalone = "Standalone" + capacity_reservation = "CapacityReservation" + + +class SearchSortEnum(str, Enum): + + asc = "asc" + desc = "desc" + + +class PurgeState(str, Enum): + + pending = "pending" + completed = "completed" diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_paged_models.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_paged_models.py index 739b95705fa3..29e30db6410f 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_paged_models.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_paged_models.py @@ -38,84 +38,84 @@ class DataSourcePaged(Paged): def __init__(self, *args, **kwargs): super(DataSourcePaged, self).__init__(*args, **kwargs) -class ManagementGroupPaged(Paged): +class LinkedServicePaged(Paged): """ - A paging container for iterating over a list of :class:`ManagementGroup ` object + A paging container for iterating over a list of :class:`LinkedService ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagementGroup]'} + 'current_page': {'key': 'value', 'type': '[LinkedService]'} } def __init__(self, *args, **kwargs): - super(ManagementGroupPaged, self).__init__(*args, **kwargs) -class UsageMetricPaged(Paged): + super(LinkedServicePaged, self).__init__(*args, **kwargs) +class LinkedStorageAccountsResourcePaged(Paged): """ - A paging container for iterating over a list of :class:`UsageMetric ` object + A paging container for iterating over a list of :class:`LinkedStorageAccountsResource ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[UsageMetric]'} + 'current_page': {'key': 'value', 'type': '[LinkedStorageAccountsResource]'} } def __init__(self, *args, **kwargs): - super(UsageMetricPaged, self).__init__(*args, **kwargs) -class WorkspacePaged(Paged): + super(LinkedStorageAccountsResourcePaged, self).__init__(*args, **kwargs) +class ManagementGroupPaged(Paged): """ - A paging container for iterating over a list of :class:`Workspace ` object + A paging container for iterating over a list of :class:`ManagementGroup ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Workspace]'} + 'current_page': {'key': 'value', 'type': '[ManagementGroup]'} } def __init__(self, *args, **kwargs): - super(WorkspacePaged, self).__init__(*args, **kwargs) -class LinkedServicePaged(Paged): + super(ManagementGroupPaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): """ - A paging container for iterating over a list of :class:`LinkedService ` object + A paging container for iterating over a list of :class:`Operation ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[LinkedService]'} + 'current_page': {'key': 'value', 'type': '[Operation]'} } def __init__(self, *args, **kwargs): - super(LinkedServicePaged, self).__init__(*args, **kwargs) -class LinkedStorageAccountsResourcePaged(Paged): + super(OperationPaged, self).__init__(*args, **kwargs) +class UsageMetricPaged(Paged): """ - A paging container for iterating over a list of :class:`LinkedStorageAccountsResource ` object + A paging container for iterating over a list of :class:`UsageMetric ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[LinkedStorageAccountsResource]'} + 'current_page': {'key': 'value', 'type': '[UsageMetric]'} } def __init__(self, *args, **kwargs): - super(LinkedStorageAccountsResourcePaged, self).__init__(*args, **kwargs) -class OperationPaged(Paged): + super(UsageMetricPaged, self).__init__(*args, **kwargs) +class WorkspacePaged(Paged): """ - A paging container for iterating over a list of :class:`Operation ` object + A paging container for iterating over a list of :class:`Workspace ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} + 'current_page': {'key': 'value', 'type': '[Workspace]'} } def __init__(self, *args, **kwargs): - super(OperationPaged, self).__init__(*args, **kwargs) + super(WorkspacePaged, self).__init__(*args, **kwargs) class ClusterPaged(Paged): """ A paging container for iterating over a list of :class:`Cluster ` object 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 c13b14cf3be5..074a8cd5a0a9 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 @@ -11,24 +11,38 @@ from ._data_exports_operations import DataExportsOperations from ._data_sources_operations import DataSourcesOperations -from ._workspaces_operations import WorkspacesOperations +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 ._operations import Operations +from ._operation_statuses_operations import OperationStatusesOperations +from ._shared_keys_operations import SharedKeysOperations +from ._usages_operations import UsagesOperations +from ._workspaces_operations import WorkspacesOperations from ._clusters_operations import ClustersOperations -from ._storage_insights_operations import StorageInsightsOperations +from ._storage_insight_configs_operations import StorageInsightConfigsOperations from ._saved_searches_operations import SavedSearchesOperations -from ._operational_insights_management_client_operations import OperationalInsightsManagementClientOperationsMixin +from ._gateways_operations import GatewaysOperations +from ._schema_operations import SchemaOperations +from ._workspace_purge_operations import WorkspacePurgeOperations __all__ = [ 'DataExportsOperations', 'DataSourcesOperations', - 'WorkspacesOperations', + 'IntelligencePacksOperations', 'LinkedServicesOperations', 'LinkedStorageAccountsOperations', + 'ManagementGroupsOperations', 'Operations', + 'OperationStatusesOperations', + 'SharedKeysOperations', + 'UsagesOperations', + 'WorkspacesOperations', 'ClustersOperations', - 'StorageInsightsOperations', + 'StorageInsightConfigsOperations', 'SavedSearchesOperations', - 'OperationalInsightsManagementClientOperationsMixin', + 'GatewaysOperations', + 'SchemaOperations', + 'WorkspacePurgeOperations', ] 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 index 1dd6910a94fb..6acfcd956089 100644 --- 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 @@ -277,25 +277,9 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} - def delete( - self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ClusterErrorResponseException` - """ + def _delete_initial( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -328,6 +312,48 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def delete( + self, resource_group_name, cluster_name, custom_headers=None, raw=False, polling=True, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ClusterErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}'} def get( 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 new file mode 100644 index 000000000000..8252e30c17d8 --- /dev/null +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_gateways_operations.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class GatewaysOperations(object): + """GatewaysOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + + self.config = config + + def delete( + self, resource_group_name, workspace_name, gateway_id, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}'} 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 new file mode 100644 index 000000000000..3d64f0fbbae5 --- /dev/null +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_intelligence_packs_operations.py @@ -0,0 +1,219 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class IntelligencePacksOperations(object): + """IntelligencePacksOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + + self.config = config + + def disable( + self, resource_group_name, workspace_name, intelligence_pack_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.disable.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), + 'intelligencePackName': self._serialize.url("intelligence_pack_name", intelligence_pack_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable'} + + def enable( + self, resource_group_name, workspace_name, intelligence_pack_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.enable.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), + 'intelligencePackName': self._serialize.url("intelligence_pack_name", intelligence_pack_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + enable.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable'} + + def list( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.loganalytics.models.IntelligencePack] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[IntelligencePack]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks'} 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 index 636b5a9441d5..f5628b549e6d 100644 --- 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 @@ -12,6 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -39,30 +41,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def create_or_update( - self, resource_group_name, workspace_name, linked_service_name, parameters, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: LinkedService or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.loganalytics.models.LinkedService or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _create_or_update_initial( + self, resource_group_name, workspace_name, linked_service_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -101,6 +82,7 @@ def create_or_update( raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('LinkedService', response) if response.status_code == 201: @@ -111,28 +93,65 @@ def create_or_update( return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} - def delete( - self, resource_group_name, workspace_name, linked_service_name, custom_headers=None, raw=False, **operation_config): - """Deletes a linked service instance. + def create_or_update( + self, resource_group_name, workspace_name, linked_service_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """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 linked service. + :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 :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LinkedService or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.loganalytics.models.LinkedService] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.loganalytics.models.LinkedService]] :raises: :class:`CloudError` """ + 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, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LinkedService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} + + + def _delete_initial( + self, resource_group_name, workspace_name, linked_service_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -149,6 +168,7 @@ def delete( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -165,9 +185,66 @@ def delete( exp.request_id = response.headers.get('x-ms-request-id') raise exp + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LinkedService', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, workspace_name, linked_service_name, custom_headers=None, raw=False, polling=True, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns LinkedService or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.loganalytics.models.LinkedService] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.loganalytics.models.LinkedService]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + linked_service_name=linked_service_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LinkedService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}'} def get( 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 new file mode 100644 index 000000000000..65ef589a2f98 --- /dev/null +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_management_groups_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ManagementGroupsOperations(object): + """ManagementGroupsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + + self.config = config + + def list( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ManagementGroup + :rtype: + ~azure.mgmt.loganalytics.models.ManagementGroupPaged[~azure.mgmt.loganalytics.models.ManagementGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ManagementGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups'} diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operational_insights_management_client_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operation_statuses_operations.py similarity index 76% rename from sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operational_insights_management_client_operations.py rename to sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operation_statuses_operations.py index 2b18f5d5f66d..5a713df770a6 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operational_insights_management_client_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operation_statuses_operations.py @@ -9,17 +9,37 @@ # regenerated. # -------------------------------------------------------------------------- +import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling + from .. import models -import uuid -class OperationalInsightsManagementClientOperationsMixin(object): +class OperationStatusesOperations(object): + """OperationStatusesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + + self.config = config - def get_async_operations_status( + def get( self, location, async_operation_id, custom_headers=None, raw=False, **operation_config): """Get the status of a long running azure asynchronous operation. @@ -38,7 +58,7 @@ def get_async_operations_status( :raises: :class:`CloudError` """ # Construct URL - url = self.get_async_operations_status.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'location': self._serialize.url("location", location, 'str'), 'asyncOperationId': self._serialize.url("async_operation_id", async_operation_id, 'str'), @@ -78,4 +98,4 @@ def get_async_operations_status( return client_raw_response return deserialized - get_async_operations_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}'} 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 new file mode 100644 index 000000000000..6674d9758e7f --- /dev/null +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_schema_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SchemaOperations(object): + """SchemaOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + + self.config = config + + def get( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SearchGetSchemaResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.loganalytics.models.SearchGetSchemaResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SearchGetSchemaResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema'} 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 new file mode 100644 index 000000000000..de18ff301a11 --- /dev/null +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_shared_keys_operations.py @@ -0,0 +1,166 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SharedKeysOperations(object): + """SharedKeysOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + + self.config = config + + def get_shared_keys( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SharedKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.loganalytics.models.SharedKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_shared_keys.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SharedKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_shared_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys'} + + def regenerate( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SharedKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.loganalytics.models.SharedKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.regenerate.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SharedKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey'} diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insights_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insight_configs_operations.py similarity index 99% rename from sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insights_operations.py rename to sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insight_configs_operations.py index 903d10c6981b..589cb2e1dc66 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insights_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insight_configs_operations.py @@ -16,8 +16,8 @@ from .. import models -class StorageInsightsOperations(object): - """StorageInsightsOperations operations. +class StorageInsightConfigsOperations(object): + """StorageInsightConfigsOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. 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 new file mode 100644 index 000000000000..6c7405cedef7 --- /dev/null +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_usages_operations.py @@ -0,0 +1,113 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class UsagesOperations(object): + """UsagesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + + self.config = config + + def list( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of UsageMetric + :rtype: + ~azure.mgmt.loganalytics.models.UsageMetricPaged[~azure.mgmt.loganalytics.models.UsageMetric] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.UsageMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages'} 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 new file mode 100644 index 000000000000..f82c65a55345 --- /dev/null +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspace_purge_operations.py @@ -0,0 +1,192 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class WorkspacePurgeOperations(object): + """WorkspacePurgeOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2020-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-03-01-preview" + + self.config = config + + def purge( + self, resource_group_name, workspace_name, table, filters, custom_headers=None, raw=False, **operation_config): + """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 table: Table from which to purge data. + :type table: str + :param filters: The set of columns and filters (queries) to run over + them to purge the resulting data. + :type filters: + list[~azure.mgmt.loganalytics.models.WorkspacePurgeBodyFilters] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkspacePurgeResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.loganalytics.models.WorkspacePurgeResponse or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = models.WorkspacePurgeBody(table=table, filters=filters) + + # Construct URL + url = self.purge.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(body, 'WorkspacePurgeBody') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + header_dict = {} + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('WorkspacePurgeResponse', response) + header_dict = { + 'x-ms-status-location': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge'} + + def get_purge_status( + self, resource_group_name, workspace_name, purge_id, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: WorkspacePurgeStatusResponse or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.loganalytics.models.WorkspacePurgeStatusResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_purge_status.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), + 'purgeId': self._serialize.url("purge_id", purge_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkspacePurgeStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}'} 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 27477b7d99ae..2c850d57d69e 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 @@ -41,346 +41,25 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def disable_intelligence_pack( - self, resource_group_name, workspace_name, intelligence_pack_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.disable_intelligence_pack.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), - 'intelligencePackName': self._serialize.url("intelligence_pack_name", intelligence_pack_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - disable_intelligence_pack.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable'} - - def enable_intelligence_pack( - self, resource_group_name, workspace_name, intelligence_pack_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.enable_intelligence_pack.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), - 'intelligencePackName': self._serialize.url("intelligence_pack_name", intelligence_pack_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - enable_intelligence_pack.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable'} - - def list_intelligence_packs( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: list[~azure.mgmt.loganalytics.models.IntelligencePack] or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list_intelligence_packs.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('[IntelligencePack]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_intelligence_packs.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks'} - - def list_management_groups( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagementGroup - :rtype: - ~azure.mgmt.loganalytics.models.ManagementGroupPaged[~azure.mgmt.loganalytics.models.ManagementGroup] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_management_groups.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagementGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_management_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups'} - - def get_shared_keys( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """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 - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SharedKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.loganalytics.models.SharedKeys or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get_shared_keys.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SharedKeys', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_shared_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys'} - - def list_usages( - self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of usage metrics for a workspace. + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the workspaces in a subscription. - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace. - :type workspace_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of UsageMetric + :return: An iterator like instance of Workspace :rtype: - ~azure.mgmt.loganalytics.models.UsageMetricPaged[~azure.mgmt.loganalytics.models.UsageMetric] + ~azure.mgmt.loganalytics.models.WorkspacePaged[~azure.mgmt.loganalytics.models.Workspace] :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_usages.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } url = self._client.format_url(url, **path_format_arguments) @@ -423,10 +102,10 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.UsageMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -498,79 +177,13 @@ def internal_paging(next_link=None): return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces'} - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets the workspaces in a subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Workspace - :rtype: - ~azure.mgmt.loganalytics.models.WorkspacePaged[~azure.mgmt.loganalytics.models.Workspace] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces'} - def _create_or_update_initial( self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } @@ -620,7 +233,8 @@ def create_or_update( self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Create or update a workspace. - :param resource_group_name: The resource group name of 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 @@ -673,7 +287,7 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } @@ -709,7 +323,8 @@ def delete( self, resource_group_name, workspace_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a workspace instance. - :param resource_group_name: The resource group name of 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 @@ -750,7 +365,8 @@ def get( self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): """Gets a workspace instance. - :param resource_group_name: The resource group name of 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 @@ -767,7 +383,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } @@ -811,7 +427,8 @@ def update( self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): """Updates a workspace. - :param resource_group_name: The resource group name of 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 @@ -830,7 +447,7 @@ def update( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) } @@ -873,3 +490,65 @@ def update( return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}'} + + def available_service_tiers( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets the available service tiers for the workspace. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.loganalytics.models.AvailableServiceTier] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.available_service_tiers.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=63, min_length=4, pattern=r'^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[AvailableServiceTier]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + available_service_tiers.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers'} diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/version.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/version.py index 3e682bbd5fb1..85da2c00c1a6 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/version.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.3.0" +VERSION = "0.4.0" diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/dev_requirements.txt b/sdk/loganalytics/azure-mgmt-loganalytics/dev_requirements.txt new file mode 100644 index 000000000000..0b288b2e1260 --- /dev/null +++ b/sdk/loganalytics/azure-mgmt-loganalytics/dev_requirements.txt @@ -0,0 +1,2 @@ +-e ../../../tools/azure-sdk-tools + diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/setup.py b/sdk/loganalytics/azure-mgmt-loganalytics/setup.py index fffa7ef2147e..eea54942f3e7 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/setup.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/setup.py @@ -64,10 +64,10 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ], zip_safe=False,