66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
9- from typing import TYPE_CHECKING
9+ from copy import deepcopy
10+ from typing import Any , Optional , TYPE_CHECKING
1011
12+ from azure .core .rest import HttpRequest , HttpResponse
1113from azure .mgmt .core import ARMPipelineClient
1214from msrest import Deserializer , Serializer
1315
16+ from . import models
17+ from ._configuration import LogAnalyticsManagementClientConfiguration
18+ from .operations import AvailableServiceTiersOperations , ClustersOperations , DataExportsOperations , DataSourcesOperations , DeletedWorkspacesOperations , GatewaysOperations , IntelligencePacksOperations , LinkedServicesOperations , LinkedStorageAccountsOperations , ManagementGroupsOperations , OperationStatusesOperations , Operations , SavedSearchesOperations , SchemaOperations , SharedKeysOperations , StorageInsightConfigsOperations , TablesOperations , UsagesOperations , WorkspacePurgeOperations , WorkspacesOperations
19+
1420if TYPE_CHECKING :
1521 # pylint: disable=unused-import,ungrouped-imports
16- from typing import Any , Optional
17-
1822 from azure .core .credentials import TokenCredential
19- from azure .core .pipeline .transport import HttpRequest , HttpResponse
20-
21- from ._configuration import LogAnalyticsManagementClientConfiguration
22- from .operations import DataExportsOperations
23- from .operations import DataSourcesOperations
24- from .operations import IntelligencePacksOperations
25- from .operations import LinkedServicesOperations
26- from .operations import LinkedStorageAccountsOperations
27- from .operations import ManagementGroupsOperations
28- from .operations import OperationStatusesOperations
29- from .operations import SharedKeysOperations
30- from .operations import UsagesOperations
31- from .operations import StorageInsightConfigsOperations
32- from .operations import SavedSearchesOperations
33- from .operations import AvailableServiceTiersOperations
34- from .operations import GatewaysOperations
35- from .operations import SchemaOperations
36- from .operations import WorkspacePurgeOperations
37- from .operations import Operations
38- from .operations import TablesOperations
39- from .operations import ClustersOperations
40- from .operations import WorkspacesOperations
41- from .operations import DeletedWorkspacesOperations
42- from . import models
43-
4423
45- class LogAnalyticsManagementClient ( object ) :
24+ class LogAnalyticsManagementClient :
4625 """Operational Insights Client.
4726
27+ :ivar operations: Operations operations
28+ :vartype operations: azure.mgmt.loganalytics.operations.Operations
29+ :ivar workspaces: WorkspacesOperations operations
30+ :vartype workspaces: azure.mgmt.loganalytics.operations.WorkspacesOperations
31+ :ivar deleted_workspaces: DeletedWorkspacesOperations operations
32+ :vartype deleted_workspaces: azure.mgmt.loganalytics.operations.DeletedWorkspacesOperations
33+ :ivar tables: TablesOperations operations
34+ :vartype tables: azure.mgmt.loganalytics.operations.TablesOperations
4835 :ivar data_exports: DataExportsOperations operations
4936 :vartype data_exports: azure.mgmt.loganalytics.operations.DataExportsOperations
5037 :ivar data_sources: DataSourcesOperations operations
@@ -54,7 +41,8 @@ class LogAnalyticsManagementClient(object):
5441 :ivar linked_services: LinkedServicesOperations operations
5542 :vartype linked_services: azure.mgmt.loganalytics.operations.LinkedServicesOperations
5643 :ivar linked_storage_accounts: LinkedStorageAccountsOperations operations
57- :vartype linked_storage_accounts: azure.mgmt.loganalytics.operations.LinkedStorageAccountsOperations
44+ :vartype linked_storage_accounts:
45+ azure.mgmt.loganalytics.operations.LinkedStorageAccountsOperations
5846 :ivar management_groups: ManagementGroupsOperations operations
5947 :vartype management_groups: azure.mgmt.loganalytics.operations.ManagementGroupsOperations
6048 :ivar operation_statuses: OperationStatusesOperations operations
@@ -64,111 +52,92 @@ class LogAnalyticsManagementClient(object):
6452 :ivar usages: UsagesOperations operations
6553 :vartype usages: azure.mgmt.loganalytics.operations.UsagesOperations
6654 :ivar storage_insight_configs: StorageInsightConfigsOperations operations
67- :vartype storage_insight_configs: azure.mgmt.loganalytics.operations.StorageInsightConfigsOperations
55+ :vartype storage_insight_configs:
56+ azure.mgmt.loganalytics.operations.StorageInsightConfigsOperations
6857 :ivar saved_searches: SavedSearchesOperations operations
6958 :vartype saved_searches: azure.mgmt.loganalytics.operations.SavedSearchesOperations
7059 :ivar available_service_tiers: AvailableServiceTiersOperations operations
71- :vartype available_service_tiers: azure.mgmt.loganalytics.operations.AvailableServiceTiersOperations
60+ :vartype available_service_tiers:
61+ azure.mgmt.loganalytics.operations.AvailableServiceTiersOperations
7262 :ivar gateways: GatewaysOperations operations
7363 :vartype gateways: azure.mgmt.loganalytics.operations.GatewaysOperations
7464 :ivar schema: SchemaOperations operations
7565 :vartype schema: azure.mgmt.loganalytics.operations.SchemaOperations
7666 :ivar workspace_purge: WorkspacePurgeOperations operations
7767 :vartype workspace_purge: azure.mgmt.loganalytics.operations.WorkspacePurgeOperations
78- :ivar operations: Operations operations
79- :vartype operations: azure.mgmt.loganalytics.operations.Operations
80- :ivar tables: TablesOperations operations
81- :vartype tables: azure.mgmt.loganalytics.operations.TablesOperations
8268 :ivar clusters: ClustersOperations operations
8369 :vartype clusters: azure.mgmt.loganalytics.operations.ClustersOperations
84- :ivar workspaces: WorkspacesOperations operations
85- :vartype workspaces: azure.mgmt.loganalytics.operations.WorkspacesOperations
86- :ivar deleted_workspaces: DeletedWorkspacesOperations operations
87- :vartype deleted_workspaces: azure.mgmt.loganalytics.operations.DeletedWorkspacesOperations
8870 :param credential: Credential needed for the client to connect to Azure.
8971 :type credential: ~azure.core.credentials.TokenCredential
9072 :param subscription_id: The ID of the target subscription.
9173 :type subscription_id: str
92- :param str base_url: Service URL
93- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
74+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
75+ :type base_url: str
76+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
77+ Retry-After header is present.
9478 """
9579
9680 def __init__ (
9781 self ,
98- credential , # type: "TokenCredential"
99- subscription_id , # type: str
100- base_url = None , # type: Optional[str]
101- ** kwargs # type: Any
102- ):
103- # type: (...) -> None
104- if not base_url :
105- base_url = 'https://management.azure.com'
106- self ._config = LogAnalyticsManagementClientConfiguration (credential , subscription_id , ** kwargs )
82+ credential : "TokenCredential" ,
83+ subscription_id : str ,
84+ base_url : str = "https://management.azure.com" ,
85+ ** kwargs : Any
86+ ) -> None :
87+ self ._config = LogAnalyticsManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
10788 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
10889
10990 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
11091 self ._serialize = Serializer (client_models )
111- self ._serialize .client_side_validation = False
11292 self ._deserialize = Deserializer (client_models )
113-
114- self .data_exports = DataExportsOperations (
115- self ._client , self ._config , self ._serialize , self ._deserialize )
116- self .data_sources = DataSourcesOperations (
117- self ._client , self ._config , self ._serialize , self ._deserialize )
118- self .intelligence_packs = IntelligencePacksOperations (
119- self ._client , self ._config , self ._serialize , self ._deserialize )
120- self .linked_services = LinkedServicesOperations (
121- self ._client , self ._config , self ._serialize , self ._deserialize )
122- self .linked_storage_accounts = LinkedStorageAccountsOperations (
123- self ._client , self ._config , self ._serialize , self ._deserialize )
124- self .management_groups = ManagementGroupsOperations (
125- self ._client , self ._config , self ._serialize , self ._deserialize )
126- self .operation_statuses = OperationStatusesOperations (
127- self ._client , self ._config , self ._serialize , self ._deserialize )
128- self .shared_keys = SharedKeysOperations (
129- self ._client , self ._config , self ._serialize , self ._deserialize )
130- self .usages = UsagesOperations (
131- self ._client , self ._config , self ._serialize , self ._deserialize )
132- self .storage_insight_configs = StorageInsightConfigsOperations (
133- self ._client , self ._config , self ._serialize , self ._deserialize )
134- self .saved_searches = SavedSearchesOperations (
135- self ._client , self ._config , self ._serialize , self ._deserialize )
136- self .available_service_tiers = AvailableServiceTiersOperations (
137- self ._client , self ._config , self ._serialize , self ._deserialize )
138- self .gateways = GatewaysOperations (
139- self ._client , self ._config , self ._serialize , self ._deserialize )
140- self .schema = SchemaOperations (
141- self ._client , self ._config , self ._serialize , self ._deserialize )
142- self .workspace_purge = WorkspacePurgeOperations (
143- self ._client , self ._config , self ._serialize , self ._deserialize )
144- self .operations = Operations (
145- self ._client , self ._config , self ._serialize , self ._deserialize )
146- self .tables = TablesOperations (
147- self ._client , self ._config , self ._serialize , self ._deserialize )
148- self .clusters = ClustersOperations (
149- self ._client , self ._config , self ._serialize , self ._deserialize )
150- self .workspaces = WorkspacesOperations (
151- self ._client , self ._config , self ._serialize , self ._deserialize )
152- self .deleted_workspaces = DeletedWorkspacesOperations (
153- self ._client , self ._config , self ._serialize , self ._deserialize )
154-
155- def _send_request (self , http_request , ** kwargs ):
156- # type: (HttpRequest, Any) -> HttpResponse
93+ self ._serialize .client_side_validation = False
94+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
95+ self .workspaces = WorkspacesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
96+ self .deleted_workspaces = DeletedWorkspacesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
97+ self .tables = TablesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
98+ self .data_exports = DataExportsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
99+ self .data_sources = DataSourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
100+ self .intelligence_packs = IntelligencePacksOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
101+ self .linked_services = LinkedServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
102+ self .linked_storage_accounts = LinkedStorageAccountsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
103+ self .management_groups = ManagementGroupsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
104+ self .operation_statuses = OperationStatusesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
105+ self .shared_keys = SharedKeysOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
106+ self .usages = UsagesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
107+ self .storage_insight_configs = StorageInsightConfigsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
108+ self .saved_searches = SavedSearchesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
109+ self .available_service_tiers = AvailableServiceTiersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
110+ self .gateways = GatewaysOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
111+ self .schema = SchemaOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
112+ self .workspace_purge = WorkspacePurgeOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
113+ self .clusters = ClustersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
114+
115+
116+ def _send_request (
117+ self ,
118+ request , # type: HttpRequest
119+ ** kwargs : Any
120+ ) -> HttpResponse :
157121 """Runs the network request through the client's chained policies.
158122
159- :param http_request: The network request you want to make. Required.
160- :type http_request: ~azure.core.pipeline.transport.HttpRequest
161- :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
123+ >>> from azure.core.rest import HttpRequest
124+ >>> request = HttpRequest("GET", "https://www.example.org/")
125+ <HttpRequest [GET], url: 'https://www.example.org/'>
126+ >>> response = client._send_request(request)
127+ <HttpResponse: 200 OK>
128+
129+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
130+
131+ :param request: The network request you want to make. Required.
132+ :type request: ~azure.core.rest.HttpRequest
133+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
162134 :return: The response of your network call. Does not do error handling on your response.
163- :rtype: ~azure.core.pipeline.transport .HttpResponse
135+ :rtype: ~azure.core.rest .HttpResponse
164136 """
165- path_format_arguments = {
166- 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' , min_length = 1 ),
167- }
168- http_request .url = self ._client .format_url (http_request .url , ** path_format_arguments )
169- stream = kwargs .pop ("stream" , True )
170- pipeline_response = self ._client ._pipeline .run (http_request , stream = stream , ** kwargs )
171- return pipeline_response .http_response
137+
138+ request_copy = deepcopy (request )
139+ request_copy .url = self ._client .format_url (request_copy .url )
140+ return self ._client .send_request (request_copy , ** kwargs )
172141
173142 def close (self ):
174143 # type: () -> None
0 commit comments