Skip to content

Commit

Permalink
CodeGen from PR 13469 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge d7b7309abc6f3bdd5af4a9051d48cb661271065d into dfbbdd2
  • Loading branch information
SDKAuto committed Mar 17, 2021
1 parent a5685ad commit 5133df3
Show file tree
Hide file tree
Showing 215 changed files with 8,541 additions and 1,518 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MonitorManagementClientConfiguration(Configuration):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str api_version: API version to use if no profile is provided, or if
missing in profile.
Expand All @@ -46,32 +46,39 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2019-10-17-preview'
DEFAULT_API_VERSION = '2020-10-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
'action_groups': '2019-06-01',
'activity_log_alerts': '2017-04-01',
'activity_logs': '2015-04-01',
'alert_rule_incidents': '2016-03-01',
'alert_rules': '2016-03-01',
'autoscale_settings': '2015-04-01',
'baseline': '2018-09-01',
'baselines': '2019-03-01',
'data_collection_rule_associations': '2019-11-01-preview',
'data_collection_rules': '2019-11-01-preview',
'diagnostic_settings': '2017-05-01-preview',
'diagnostic_settings_category': '2017-05-01-preview',
'event_categories': '2015-04-01',
'guest_diagnostics_settings': '2018-06-01-preview',
'guest_diagnostics_settings_association': '2018-06-01-preview',
'log_profiles': '2016-03-01',
'management_group_diagnostic_settings': '2020-01-01-preview',
'metric_alerts': '2018-03-01',
'metric_alerts_status': '2018-03-01',
'metric_baseline': '2018-09-01',
'metric_definitions': '2018-01-01',
'metric_namespaces': '2017-12-01-preview',
'metrics': '2018-01-01',
'operations': '2015-04-01',
'private_endpoint_connections': '2019-10-17-preview',
'private_link_resources': '2019-10-17-preview',
'private_link_scope_operation_status': '2019-10-17-preview',
'private_link_scoped_resources': '2019-10-17-preview',
'private_link_scopes': '2019-10-17-preview',
'scheduled_query_rules': '2018-04-16',
'service_diagnostic_settings': '2016-09-01',
'subscription_diagnostic_settings': '2017-05-01-preview',
Expand Down Expand Up @@ -128,6 +135,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2019-11-01-preview: :mod:`v2019_11_01_preview.models<azure.mgmt.monitor.v2019_11_01_preview.models>`
* 2020-01-01-preview: :mod:`v2020_01_01_preview.models<azure.mgmt.monitor.v2020_01_01_preview.models>`
* 2020-05-01-preview: :mod:`v2020_05_01_preview.models<azure.mgmt.monitor.v2020_05_01_preview.models>`
* 2020-10-01: :mod:`v2020_10_01.models<azure.mgmt.monitor.v2020_10_01.models>`
"""
if api_version == '2015-04-01':
from .v2015_04_01 import models
Expand Down Expand Up @@ -192,6 +200,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2020-05-01-preview':
from .v2020_05_01_preview import models
return models
elif api_version == '2020-10-01':
from .v2020_10_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -225,12 +236,15 @@ def activity_log_alerts(self):
* 2017-03-01-preview: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2017_03_01_preview.operations.ActivityLogAlertsOperations>`
* 2017-04-01: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2017_04_01.operations.ActivityLogAlertsOperations>`
* 2020-10-01: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2020_10_01.operations.ActivityLogAlertsOperations>`
"""
api_version = self._get_api_version('activity_log_alerts')
if api_version == '2017-03-01-preview':
from .v2017_03_01_preview.operations import ActivityLogAlertsOperations as OperationClass
elif api_version == '2017-04-01':
from .v2017_04_01.operations import ActivityLogAlertsOperations as OperationClass
elif api_version == '2020-10-01':
from .v2020_10_01.operations import ActivityLogAlertsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'activity_log_alerts'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down Expand Up @@ -265,10 +279,16 @@ def alert_rule_incidents(self):
def alert_rules(self):
"""Instance depends on the API version:
* 2015-04-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2015_04_01.operations.AlertRulesOperations>`
* 2015-07-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2015_07_01.operations.AlertRulesOperations>`
* 2016-03-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2016_03_01.operations.AlertRulesOperations>`
"""
api_version = self._get_api_version('alert_rules')
if api_version == '2016-03-01':
if api_version == '2015-04-01':
from .v2015_04_01.operations import AlertRulesOperations as OperationClass
elif api_version == '2015-07-01':
from .v2015_07_01.operations import AlertRulesOperations as OperationClass
elif api_version == '2016-03-01':
from .v2016_03_01.operations import AlertRulesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'alert_rules'".format(api_version))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MonitorManagementClientConfiguration(Configuration):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str api_version: API version to use if no profile is provided, or if
missing in profile.
Expand All @@ -46,32 +46,39 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""

DEFAULT_API_VERSION = '2019-10-17-preview'
DEFAULT_API_VERSION = '2020-10-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
'action_groups': '2019-06-01',
'activity_log_alerts': '2017-04-01',
'activity_logs': '2015-04-01',
'alert_rule_incidents': '2016-03-01',
'alert_rules': '2016-03-01',
'autoscale_settings': '2015-04-01',
'baseline': '2018-09-01',
'baselines': '2019-03-01',
'data_collection_rule_associations': '2019-11-01-preview',
'data_collection_rules': '2019-11-01-preview',
'diagnostic_settings': '2017-05-01-preview',
'diagnostic_settings_category': '2017-05-01-preview',
'event_categories': '2015-04-01',
'guest_diagnostics_settings': '2018-06-01-preview',
'guest_diagnostics_settings_association': '2018-06-01-preview',
'log_profiles': '2016-03-01',
'management_group_diagnostic_settings': '2020-01-01-preview',
'metric_alerts': '2018-03-01',
'metric_alerts_status': '2018-03-01',
'metric_baseline': '2018-09-01',
'metric_definitions': '2018-01-01',
'metric_namespaces': '2017-12-01-preview',
'metrics': '2018-01-01',
'operations': '2015-04-01',
'private_endpoint_connections': '2019-10-17-preview',
'private_link_resources': '2019-10-17-preview',
'private_link_scope_operation_status': '2019-10-17-preview',
'private_link_scoped_resources': '2019-10-17-preview',
'private_link_scopes': '2019-10-17-preview',
'scheduled_query_rules': '2018-04-16',
'service_diagnostic_settings': '2016-09-01',
'subscription_diagnostic_settings': '2017-05-01-preview',
Expand Down Expand Up @@ -128,6 +135,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2019-11-01-preview: :mod:`v2019_11_01_preview.models<azure.mgmt.monitor.v2019_11_01_preview.models>`
* 2020-01-01-preview: :mod:`v2020_01_01_preview.models<azure.mgmt.monitor.v2020_01_01_preview.models>`
* 2020-05-01-preview: :mod:`v2020_05_01_preview.models<azure.mgmt.monitor.v2020_05_01_preview.models>`
* 2020-10-01: :mod:`v2020_10_01.models<azure.mgmt.monitor.v2020_10_01.models>`
"""
if api_version == '2015-04-01':
from ..v2015_04_01 import models
Expand Down Expand Up @@ -192,6 +200,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2020-05-01-preview':
from ..v2020_05_01_preview import models
return models
elif api_version == '2020-10-01':
from ..v2020_10_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -225,12 +236,15 @@ def activity_log_alerts(self):
* 2017-03-01-preview: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2017_03_01_preview.aio.operations.ActivityLogAlertsOperations>`
* 2017-04-01: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2017_04_01.aio.operations.ActivityLogAlertsOperations>`
* 2020-10-01: :class:`ActivityLogAlertsOperations<azure.mgmt.monitor.v2020_10_01.aio.operations.ActivityLogAlertsOperations>`
"""
api_version = self._get_api_version('activity_log_alerts')
if api_version == '2017-03-01-preview':
from ..v2017_03_01_preview.aio.operations import ActivityLogAlertsOperations as OperationClass
elif api_version == '2017-04-01':
from ..v2017_04_01.aio.operations import ActivityLogAlertsOperations as OperationClass
elif api_version == '2020-10-01':
from ..v2020_10_01.aio.operations import ActivityLogAlertsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'activity_log_alerts'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down Expand Up @@ -265,10 +279,16 @@ def alert_rule_incidents(self):
def alert_rules(self):
"""Instance depends on the API version:
* 2015-04-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2015_04_01.aio.operations.AlertRulesOperations>`
* 2015-07-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2015_07_01.aio.operations.AlertRulesOperations>`
* 2016-03-01: :class:`AlertRulesOperations<azure.mgmt.monitor.v2016_03_01.aio.operations.AlertRulesOperations>`
"""
api_version = self._get_api_version('alert_rules')
if api_version == '2016-03-01':
if api_version == '2015-04-01':
from ..v2015_04_01.aio.operations import AlertRulesOperations as OperationClass
elif api_version == '2015-07-01':
from ..v2015_07_01.aio.operations import AlertRulesOperations as OperationClass
elif api_version == '2016-03-01':
from ..v2016_03_01.aio.operations import AlertRulesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'alert_rules'".format(api_version))
Expand Down
4 changes: 3 additions & 1 deletion sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from .v2015_04_01.models import *
from .v2016_03_01.models import *
from .v2016_09_01.models import *
from .v2017_04_01.models import *
from .v2017_05_01_preview.models import *
from .v2017_12_01_preview.models import *
from .v2018_01_01.models import *
Expand All @@ -19,3 +18,6 @@
from .v2019_03_01.models import *
from .v2019_06_01.models import *
from .v2019_10_17.models import *
from .v2019_11_01_preview.models import *
from .v2020_01_01_preview.models import *
from .v2020_10_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MonitorManagementClientConfiguration(Configuration):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -47,7 +47,6 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2015-04-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2015-04-01",
"total_api_version_list": ["2015-04-01"],
"total_api_version_list": ["2014-04-01", "2015-04-01"],
"client": {
"name": "MonitorManagementClient",
"filename": "_monitor_management_client",
Expand All @@ -9,7 +9,7 @@
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": false
"client_side_validation": true
},
"global_parameters": {
"sync": {
Expand All @@ -21,7 +21,7 @@
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The Azure subscription Id.",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
Expand All @@ -35,7 +35,7 @@
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "The Azure subscription Id.",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
Expand All @@ -56,7 +56,8 @@
"autoscale_settings": "AutoscaleSettingsOperations",
"event_categories": "EventCategoriesOperations",
"operations": "Operations",
"tenant_activity_logs": "TenantActivityLogsOperations"
"tenant_activity_logs": "TenantActivityLogsOperations",
"alert_rules": "AlertRulesOperations"
},
"operation_mixins": {
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .operations import EventCategoriesOperations
from .operations import Operations
from .operations import TenantActivityLogsOperations
from .operations import AlertRulesOperations
from . import models


Expand All @@ -39,9 +40,11 @@ class MonitorManagementClient(object):
:vartype operations: $(python-base-namespace).v2015_04_01.operations.Operations
:ivar tenant_activity_logs: TenantActivityLogsOperations operations
:vartype tenant_activity_logs: $(python-base-namespace).v2015_04_01.operations.TenantActivityLogsOperations
:ivar alert_rules: AlertRulesOperations operations
:vartype alert_rules: $(python-base-namespace).v2015_04_01.operations.AlertRulesOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""
Expand All @@ -61,7 +64,6 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.activity_logs = ActivityLogsOperations(
Expand All @@ -74,6 +76,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.tenant_activity_logs = TenantActivityLogsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.alert_rules = AlertRulesOperations(
self._client, self._config, self._serialize, self._deserialize)

def close(self):
# type: () -> None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MonitorManagementClientConfiguration(Configuration):
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription Id.
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
"""

Expand All @@ -44,7 +44,6 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2015-04-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Loading

0 comments on commit 5133df3

Please sign in to comment.