Skip to content

Commit 452d9bf

Browse files
author
SDKAuto
committed
CodeGen from PR 15607 in Azure/azure-rest-api-specs
Merge 3d0745b309cc35214685f89e0b0f97459b480d6c into 8753415
1 parent a5a4ef4 commit 452d9bf

File tree

377 files changed

+22689
-2824
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

377 files changed

+22689
-2824
lines changed

sdk/monitor/azure-mgmt-monitor/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.4.5",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "03a9896075d924b433aa582000a3731d99516b89",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.4.5",
10+
"readme": "specification/monitor/resource-manager/readme.md"
11+
}

sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@
88
# Changes may cause incorrect behavior and will be lost if the code is
99
# regenerated.
1010
# --------------------------------------------------------------------------
11-
from typing import Any
11+
from typing import TYPE_CHECKING
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
1515
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
1616

1717
from ._version import VERSION
1818

19+
if TYPE_CHECKING:
20+
# pylint: disable=unused-import,ungrouped-imports
21+
from typing import Any
22+
23+
from azure.core.credentials import TokenCredential
1924

2025
class MonitorManagementClientConfiguration(Configuration):
2126
"""Configuration for MonitorManagementClient.
@@ -25,7 +30,7 @@ class MonitorManagementClientConfiguration(Configuration):
2530
2631
:param credential: Credential needed for the client to connect to Azure.
2732
:type credential: ~azure.core.credentials.TokenCredential
28-
:param subscription_id: The Azure subscription Id.
33+
:param subscription_id: The ID of the target subscription.
2934
:type subscription_id: str
3035
"""
3136

sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_management_client.py

Lines changed: 79 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from azure.mgmt.core import ARMPipelineClient
13-
from msrest import Serializer, Deserializer
12+
from typing import TYPE_CHECKING
1413

14+
from azure.mgmt.core import ARMPipelineClient
1515
from azure.profiles import KnownProfiles, ProfileDefinition
1616
from azure.profiles.multiapiclient import MultiApiClientMixin
17+
from msrest import Deserializer, Serializer
18+
1719
from ._configuration import MonitorManagementClientConfiguration
1820

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+
1928
class _SDKClient(object):
2029
def __init__(self, *args, **kwargs):
2130
"""This is a fake class to support current implemetation of MultiApiClientMixin."
@@ -36,31 +45,30 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
3645
3746
:param credential: Credential needed for the client to connect to Azure.
3847
:type credential: ~azure.core.credentials.TokenCredential
39-
:param subscription_id: The Azure subscription Id.
48+
:param subscription_id: The ID of the target subscription.
4049
: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
4454
:param profile: A profile definition, from KnownProfiles to dict.
4555
:type profile: azure.profiles.KnownProfiles
4656
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
4757
"""
4858

49-
DEFAULT_API_VERSION = '2019-10-17-preview'
59+
DEFAULT_API_VERSION = '2021-04-01'
5060
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
5161
LATEST_PROFILE = ProfileDefinition({
5262
_PROFILE_TAG: {
5363
None: DEFAULT_API_VERSION,
5464
'action_groups': '2019-06-01',
55-
'activity_log_alerts': '2017-04-01',
65+
'activity_log_alerts': '2020-10-01',
5666
'activity_logs': '2015-04-01',
5767
'alert_rule_incidents': '2016-03-01',
5868
'alert_rules': '2016-03-01',
5969
'autoscale_settings': '2015-04-01',
6070
'baseline': '2018-09-01',
6171
'baselines': '2019-03-01',
62-
'diagnostic_settings': '2017-05-01-preview',
63-
'diagnostic_settings_category': '2017-05-01-preview',
6472
'event_categories': '2015-04-01',
6573
'guest_diagnostics_settings': '2018-06-01-preview',
6674
'guest_diagnostics_settings_association': '2018-06-01-preview',
@@ -72,9 +80,13 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
7280
'metric_namespaces': '2017-12-01-preview',
7381
'metrics': '2018-01-01',
7482
'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',
7588
'scheduled_query_rules': '2018-04-16',
7689
'service_diagnostic_settings': '2016-09-01',
77-
'subscription_diagnostic_settings': '2017-05-01-preview',
7890
'tenant_activity_logs': '2015-04-01',
7991
'vm_insights': '2018-11-27-preview',
8092
}},
@@ -85,9 +97,9 @@ def __init__(
8597
self,
8698
credential, # type: "TokenCredential"
8799
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
91103
**kwargs # type: Any
92104
):
93105
if not base_url:
@@ -128,6 +140,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
128140
* 2019-11-01-preview: :mod:`v2019_11_01_preview.models<azure.mgmt.monitor.v2019_11_01_preview.models>`
129141
* 2020-01-01-preview: :mod:`v2020_01_01_preview.models<azure.mgmt.monitor.v2020_01_01_preview.models>`
130142
* 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>`
131146
"""
132147
if api_version == '2015-04-01':
133148
from .v2015_04_01 import models
@@ -192,6 +207,15 @@ def models(cls, api_version=DEFAULT_API_VERSION):
192207
elif api_version == '2020-05-01-preview':
193208
from .v2020_05_01_preview import models
194209
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
195219
raise ValueError("API version {} is not available".format(api_version))
196220

197221
@property
@@ -225,12 +249,15 @@ def activity_log_alerts(self):
225249
226250
* 2017-03-01-preview: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2017_03_01_preview.operations.ActivityLogAlertsOperations>`
227251
* 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>`
228253
"""
229254
api_version = self._get_api_version('activity_log_alerts')
230255
if api_version == '2017-03-01-preview':
231256
from .v2017_03_01_preview.operations import ActivityLogAlertsOperations as OperationClass
232257
elif api_version == '2017-04-01':
233258
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
234261
else:
235262
raise ValueError("API version {} does not have operation group 'activity_log_alerts'".format(api_version))
236263
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):
265292
def alert_rules(self):
266293
"""Instance depends on the API version:
267294
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>`
268297
* 2016-03-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2016_03_01.operations.AlertRulesOperations>`
269298
"""
270299
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':
272305
from .v2016_03_01.operations import AlertRulesOperations as OperationClass
273306
else:
274307
raise ValueError("API version {} does not have operation group 'alert_rules'".format(api_version))
@@ -313,15 +346,31 @@ def baselines(self):
313346
raise ValueError("API version {} does not have operation group 'baselines'".format(api_version))
314347
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
315348

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+
316362
@property
317363
def data_collection_rule_associations(self):
318364
"""Instance depends on the API version:
319365
320366
* 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>`
321368
"""
322369
api_version = self._get_api_version('data_collection_rule_associations')
323370
if api_version == '2019-11-01-preview':
324371
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
325374
else:
326375
raise ValueError("API version {} does not have operation group 'data_collection_rule_associations'".format(api_version))
327376
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):
331380
"""Instance depends on the API version:
332381
333382
* 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>`
334384
"""
335385
api_version = self._get_api_version('data_collection_rules')
336386
if api_version == '2019-11-01-preview':
337387
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
338390
else:
339391
raise ValueError("API version {} does not have operation group 'data_collection_rules'".format(api_version))
340392
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):
344396
"""Instance depends on the API version:
345397
346398
* 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>`
347400
"""
348401
api_version = self._get_api_version('diagnostic_settings')
349402
if api_version == '2017-05-01-preview':
350403
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
351406
else:
352407
raise ValueError("API version {} does not have operation group 'diagnostic_settings'".format(api_version))
353408
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):
357412
"""Instance depends on the API version:
358413
359414
* 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>`
360416
"""
361417
api_version = self._get_api_version('diagnostic_settings_category')
362418
if api_version == '2017-05-01-preview':
363419
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
364422
else:
365423
raise ValueError("API version {} does not have operation group 'diagnostic_settings_category'".format(api_version))
366424
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):
422480
"""Instance depends on the API version:
423481
424482
* 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>`
425484
"""
426485
api_version = self._get_api_version('management_group_diagnostic_settings')
427486
if api_version == '2020-01-01-preview':
428487
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
429490
else:
430491
raise ValueError("API version {} does not have operation group 'management_group_diagnostic_settings'".format(api_version))
431492
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):
638699
"""Instance depends on the API version:
639700
640701
* 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>`
641703
"""
642704
api_version = self._get_api_version('subscription_diagnostic_settings')
643705
if api_version == '2017-05-01-preview':
644706
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
645709
else:
646710
raise ValueError("API version {} does not have operation group 'subscription_diagnostic_settings'".format(api_version))
647711
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
# Changes may cause incorrect behavior and will be lost if the code is
99
# regenerated.
1010
# --------------------------------------------------------------------------
11-
from typing import Any
11+
from typing import Any, TYPE_CHECKING
1212

1313
from azure.core.configuration import Configuration
1414
from azure.core.pipeline import policies
1515
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
1616

1717
from .._version import VERSION
1818

19+
if TYPE_CHECKING:
20+
# pylint: disable=unused-import,ungrouped-imports
21+
from azure.core.credentials_async import AsyncTokenCredential
1922

2023
class MonitorManagementClientConfiguration(Configuration):
2124
"""Configuration for MonitorManagementClient.
@@ -25,14 +28,14 @@ class MonitorManagementClientConfiguration(Configuration):
2528
2629
:param credential: Credential needed for the client to connect to Azure.
2730
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
28-
:param subscription_id: The Azure subscription Id.
31+
:param subscription_id: The ID of the target subscription.
2932
:type subscription_id: str
3033
"""
3134

3235
def __init__(
3336
self,
34-
credential, # type: "AsyncTokenCredential"
35-
subscription_id, # type: str
37+
credential: "AsyncTokenCredential",
38+
subscription_id: str,
3639
**kwargs # type: Any
3740
) -> None:
3841
if credential is None:

0 commit comments

Comments
 (0)