9
9
# regenerated.
10
10
# --------------------------------------------------------------------------
11
11
12
- from azure .mgmt .core import ARMPipelineClient
13
- from msrest import Serializer , Deserializer
12
+ from typing import TYPE_CHECKING
14
13
14
+ from azure .mgmt .core import ARMPipelineClient
15
15
from azure .profiles import KnownProfiles , ProfileDefinition
16
16
from azure .profiles .multiapiclient import MultiApiClientMixin
17
+ from msrest import Deserializer , Serializer
18
+
17
19
from ._configuration import MonitorManagementClientConfiguration
18
20
21
+ if TYPE_CHECKING :
22
+ # pylint: disable=unused-import,ungrouped-imports
23
+ from typing import Any , Optional
24
+
25
+ from azure .core .credentials import TokenCredential
26
+ from azure .core .pipeline .transport import HttpRequest , HttpResponse
27
+
19
28
class _SDKClient (object ):
20
29
def __init__ (self , * args , ** kwargs ):
21
30
"""This is a fake class to support current implemetation of MultiApiClientMixin."
@@ -36,31 +45,30 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
36
45
37
46
:param credential: Credential needed for the client to connect to Azure.
38
47
:type credential: ~azure.core.credentials.TokenCredential
39
- :param subscription_id: The Azure subscription Id .
48
+ :param subscription_id: The ID of the target subscription .
40
49
:type subscription_id: str
41
- :param str api_version: API version to use if no profile is provided, or if
42
- missing in profile.
43
- :param str base_url: Service URL
50
+ :param api_version: API version to use if no profile is provided, or if missing in profile.
51
+ :type api_version: str
52
+ :param base_url: Service URL
53
+ :type base_url: str
44
54
:param profile: A profile definition, from KnownProfiles to dict.
45
55
:type profile: azure.profiles.KnownProfiles
46
56
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
47
57
"""
48
58
49
- DEFAULT_API_VERSION = '2019-10-17-preview '
59
+ DEFAULT_API_VERSION = '2021-04-01 '
50
60
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
51
61
LATEST_PROFILE = ProfileDefinition ({
52
62
_PROFILE_TAG : {
53
63
None : DEFAULT_API_VERSION ,
54
64
'action_groups' : '2019-06-01' ,
55
- 'activity_log_alerts' : '2017-04 -01' ,
65
+ 'activity_log_alerts' : '2020-10 -01' ,
56
66
'activity_logs' : '2015-04-01' ,
57
67
'alert_rule_incidents' : '2016-03-01' ,
58
68
'alert_rules' : '2016-03-01' ,
59
69
'autoscale_settings' : '2015-04-01' ,
60
70
'baseline' : '2018-09-01' ,
61
71
'baselines' : '2019-03-01' ,
62
- 'diagnostic_settings' : '2017-05-01-preview' ,
63
- 'diagnostic_settings_category' : '2017-05-01-preview' ,
64
72
'event_categories' : '2015-04-01' ,
65
73
'guest_diagnostics_settings' : '2018-06-01-preview' ,
66
74
'guest_diagnostics_settings_association' : '2018-06-01-preview' ,
@@ -72,9 +80,13 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
72
80
'metric_namespaces' : '2017-12-01-preview' ,
73
81
'metrics' : '2018-01-01' ,
74
82
'operations' : '2015-04-01' ,
83
+ 'private_endpoint_connections' : '2019-10-17-preview' ,
84
+ 'private_link_resources' : '2019-10-17-preview' ,
85
+ 'private_link_scope_operation_status' : '2019-10-17-preview' ,
86
+ 'private_link_scoped_resources' : '2019-10-17-preview' ,
87
+ 'private_link_scopes' : '2019-10-17-preview' ,
75
88
'scheduled_query_rules' : '2018-04-16' ,
76
89
'service_diagnostic_settings' : '2016-09-01' ,
77
- 'subscription_diagnostic_settings' : '2017-05-01-preview' ,
78
90
'tenant_activity_logs' : '2015-04-01' ,
79
91
'vm_insights' : '2018-11-27-preview' ,
80
92
}},
@@ -85,9 +97,9 @@ def __init__(
85
97
self ,
86
98
credential , # type: "TokenCredential"
87
99
subscription_id , # type: str
88
- api_version = None ,
89
- base_url = None ,
90
- profile = KnownProfiles .default ,
100
+ api_version = None , # type: Optional[str]
101
+ base_url = None , # type: Optional[str]
102
+ profile = KnownProfiles .default , # type: KnownProfiles
91
103
** kwargs # type: Any
92
104
):
93
105
if not base_url :
@@ -128,6 +140,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
128
140
* 2019-11-01-preview: :mod:`v2019_11_01_preview.models<azure.mgmt.monitor.v2019_11_01_preview.models>`
129
141
* 2020-01-01-preview: :mod:`v2020_01_01_preview.models<azure.mgmt.monitor.v2020_01_01_preview.models>`
130
142
* 2020-05-01-preview: :mod:`v2020_05_01_preview.models<azure.mgmt.monitor.v2020_05_01_preview.models>`
143
+ * 2020-10-01: :mod:`v2020_10_01.models<azure.mgmt.monitor.v2020_10_01.models>`
144
+ * 2021-04-01: :mod:`v2021_04_01.models<azure.mgmt.monitor.v2021_04_01.models>`
145
+ * 2021-05-01-preview: :mod:`v2021_05_01_preview.models<azure.mgmt.monitor.v2021_05_01_preview.models>`
131
146
"""
132
147
if api_version == '2015-04-01' :
133
148
from .v2015_04_01 import models
@@ -192,6 +207,15 @@ def models(cls, api_version=DEFAULT_API_VERSION):
192
207
elif api_version == '2020-05-01-preview' :
193
208
from .v2020_05_01_preview import models
194
209
return models
210
+ elif api_version == '2020-10-01' :
211
+ from .v2020_10_01 import models
212
+ return models
213
+ elif api_version == '2021-04-01' :
214
+ from .v2021_04_01 import models
215
+ return models
216
+ elif api_version == '2021-05-01-preview' :
217
+ from .v2021_05_01_preview import models
218
+ return models
195
219
raise ValueError ("API version {} is not available" .format (api_version ))
196
220
197
221
@property
@@ -225,12 +249,15 @@ def activity_log_alerts(self):
225
249
226
250
* 2017-03-01-preview: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2017_03_01_preview.operations.ActivityLogAlertsOperations>`
227
251
* 2017-04-01: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2017_04_01.operations.ActivityLogAlertsOperations>`
252
+ * 2020-10-01: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2020_10_01.operations.ActivityLogAlertsOperations>`
228
253
"""
229
254
api_version = self ._get_api_version ('activity_log_alerts' )
230
255
if api_version == '2017-03-01-preview' :
231
256
from .v2017_03_01_preview .operations import ActivityLogAlertsOperations as OperationClass
232
257
elif api_version == '2017-04-01' :
233
258
from .v2017_04_01 .operations import ActivityLogAlertsOperations as OperationClass
259
+ elif api_version == '2020-10-01' :
260
+ from .v2020_10_01 .operations import ActivityLogAlertsOperations as OperationClass
234
261
else :
235
262
raise ValueError ("API version {} does not have operation group 'activity_log_alerts'" .format (api_version ))
236
263
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
@@ -265,10 +292,16 @@ def alert_rule_incidents(self):
265
292
def alert_rules (self ):
266
293
"""Instance depends on the API version:
267
294
295
+ * 2015-04-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2015_04_01.operations.AlertRulesOperations>`
296
+ * 2015-07-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2015_07_01.operations.AlertRulesOperations>`
268
297
* 2016-03-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2016_03_01.operations.AlertRulesOperations>`
269
298
"""
270
299
api_version = self ._get_api_version ('alert_rules' )
271
- if api_version == '2016-03-01' :
300
+ if api_version == '2015-04-01' :
301
+ from .v2015_04_01 .operations import AlertRulesOperations as OperationClass
302
+ elif api_version == '2015-07-01' :
303
+ from .v2015_07_01 .operations import AlertRulesOperations as OperationClass
304
+ elif api_version == '2016-03-01' :
272
305
from .v2016_03_01 .operations import AlertRulesOperations as OperationClass
273
306
else :
274
307
raise ValueError ("API version {} does not have operation group 'alert_rules'" .format (api_version ))
@@ -313,15 +346,31 @@ def baselines(self):
313
346
raise ValueError ("API version {} does not have operation group 'baselines'" .format (api_version ))
314
347
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
315
348
349
+ @property
350
+ def data_collection_endpoints (self ):
351
+ """Instance depends on the API version:
352
+
353
+ * 2021-04-01: :class:`DataCollectionEndpointsOperations<azure.mgmt.monitor.v2021_04_01.operations.DataCollectionEndpointsOperations>`
354
+ """
355
+ api_version = self ._get_api_version ('data_collection_endpoints' )
356
+ if api_version == '2021-04-01' :
357
+ from .v2021_04_01 .operations import DataCollectionEndpointsOperations as OperationClass
358
+ else :
359
+ raise ValueError ("API version {} does not have operation group 'data_collection_endpoints'" .format (api_version ))
360
+ return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
361
+
316
362
@property
317
363
def data_collection_rule_associations (self ):
318
364
"""Instance depends on the API version:
319
365
320
366
* 2019-11-01-preview: :class:`DataCollectionRuleAssociationsOperations<azure.mgmt.monitor.v2019_11_01_preview.operations.DataCollectionRuleAssociationsOperations>`
367
+ * 2021-04-01: :class:`DataCollectionRuleAssociationsOperations<azure.mgmt.monitor.v2021_04_01.operations.DataCollectionRuleAssociationsOperations>`
321
368
"""
322
369
api_version = self ._get_api_version ('data_collection_rule_associations' )
323
370
if api_version == '2019-11-01-preview' :
324
371
from .v2019_11_01_preview .operations import DataCollectionRuleAssociationsOperations as OperationClass
372
+ elif api_version == '2021-04-01' :
373
+ from .v2021_04_01 .operations import DataCollectionRuleAssociationsOperations as OperationClass
325
374
else :
326
375
raise ValueError ("API version {} does not have operation group 'data_collection_rule_associations'" .format (api_version ))
327
376
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
@@ -331,10 +380,13 @@ def data_collection_rules(self):
331
380
"""Instance depends on the API version:
332
381
333
382
* 2019-11-01-preview: :class:`DataCollectionRulesOperations<azure.mgmt.monitor.v2019_11_01_preview.operations.DataCollectionRulesOperations>`
383
+ * 2021-04-01: :class:`DataCollectionRulesOperations<azure.mgmt.monitor.v2021_04_01.operations.DataCollectionRulesOperations>`
334
384
"""
335
385
api_version = self ._get_api_version ('data_collection_rules' )
336
386
if api_version == '2019-11-01-preview' :
337
387
from .v2019_11_01_preview .operations import DataCollectionRulesOperations as OperationClass
388
+ elif api_version == '2021-04-01' :
389
+ from .v2021_04_01 .operations import DataCollectionRulesOperations as OperationClass
338
390
else :
339
391
raise ValueError ("API version {} does not have operation group 'data_collection_rules'" .format (api_version ))
340
392
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
@@ -344,10 +396,13 @@ def diagnostic_settings(self):
344
396
"""Instance depends on the API version:
345
397
346
398
* 2017-05-01-preview: :class:`DiagnosticSettingsOperations<azure.mgmt.monitor.v2017_05_01_preview.operations.DiagnosticSettingsOperations>`
399
+ * 2021-05-01-preview: :class:`DiagnosticSettingsOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.DiagnosticSettingsOperations>`
347
400
"""
348
401
api_version = self ._get_api_version ('diagnostic_settings' )
349
402
if api_version == '2017-05-01-preview' :
350
403
from .v2017_05_01_preview .operations import DiagnosticSettingsOperations as OperationClass
404
+ elif api_version == '2021-05-01-preview' :
405
+ from .v2021_05_01_preview .operations import DiagnosticSettingsOperations as OperationClass
351
406
else :
352
407
raise ValueError ("API version {} does not have operation group 'diagnostic_settings'" .format (api_version ))
353
408
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
@@ -357,10 +412,13 @@ def diagnostic_settings_category(self):
357
412
"""Instance depends on the API version:
358
413
359
414
* 2017-05-01-preview: :class:`DiagnosticSettingsCategoryOperations<azure.mgmt.monitor.v2017_05_01_preview.operations.DiagnosticSettingsCategoryOperations>`
415
+ * 2021-05-01-preview: :class:`DiagnosticSettingsCategoryOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.DiagnosticSettingsCategoryOperations>`
360
416
"""
361
417
api_version = self ._get_api_version ('diagnostic_settings_category' )
362
418
if api_version == '2017-05-01-preview' :
363
419
from .v2017_05_01_preview .operations import DiagnosticSettingsCategoryOperations as OperationClass
420
+ elif api_version == '2021-05-01-preview' :
421
+ from .v2021_05_01_preview .operations import DiagnosticSettingsCategoryOperations as OperationClass
364
422
else :
365
423
raise ValueError ("API version {} does not have operation group 'diagnostic_settings_category'" .format (api_version ))
366
424
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
@@ -422,10 +480,13 @@ def management_group_diagnostic_settings(self):
422
480
"""Instance depends on the API version:
423
481
424
482
* 2020-01-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations<azure.mgmt.monitor.v2020_01_01_preview.operations.ManagementGroupDiagnosticSettingsOperations>`
483
+ * 2021-05-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.ManagementGroupDiagnosticSettingsOperations>`
425
484
"""
426
485
api_version = self ._get_api_version ('management_group_diagnostic_settings' )
427
486
if api_version == '2020-01-01-preview' :
428
487
from .v2020_01_01_preview .operations import ManagementGroupDiagnosticSettingsOperations as OperationClass
488
+ elif api_version == '2021-05-01-preview' :
489
+ from .v2021_05_01_preview .operations import ManagementGroupDiagnosticSettingsOperations as OperationClass
429
490
else :
430
491
raise ValueError ("API version {} does not have operation group 'management_group_diagnostic_settings'" .format (api_version ))
431
492
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
@@ -638,10 +699,13 @@ def subscription_diagnostic_settings(self):
638
699
"""Instance depends on the API version:
639
700
640
701
* 2017-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations<azure.mgmt.monitor.v2017_05_01_preview.operations.SubscriptionDiagnosticSettingsOperations>`
702
+ * 2021-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations<azure.mgmt.monitor.v2021_05_01_preview.operations.SubscriptionDiagnosticSettingsOperations>`
641
703
"""
642
704
api_version = self ._get_api_version ('subscription_diagnostic_settings' )
643
705
if api_version == '2017-05-01-preview' :
644
706
from .v2017_05_01_preview .operations import SubscriptionDiagnosticSettingsOperations as OperationClass
707
+ elif api_version == '2021-05-01-preview' :
708
+ from .v2021_05_01_preview .operations import SubscriptionDiagnosticSettingsOperations as OperationClass
645
709
else :
646
710
raise ValueError ("API version {} does not have operation group 'subscription_diagnostic_settings'" .format (api_version ))
647
711
return OperationClass (self ._client , self ._config , Serializer (self ._models_dict (api_version )), Deserializer (self ._models_dict (api_version )))
0 commit comments