Skip to content

Commit

Permalink
CodeGen from PR 13275 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 64827c318ffa6106abeb6fa1362c86ffdbe93294 into d3f2ecf
  • Loading branch information
SDKAuto committed Mar 8, 2021
1 parent c891c27 commit 2507604
Show file tree
Hide file tree
Showing 13 changed files with 1,369 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MonitorManagementClientConfiguration(AzureConfiguration):
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
: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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,39 @@ class MonitorManagementClient(MultiApiClientMixin, SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

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 @@ -119,6 +126,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 @@ -183,6 +191,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 NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -216,12 +227,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 NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(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
@@ -0,0 +1,19 @@
# 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.
# --------------------------------------------------------------------------

from ._configuration import MonitorManagementClientConfiguration
from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient', 'MonitorManagementClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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.
# --------------------------------------------------------------------------
from msrestazure import AzureConfiguration

from .version import VERSION


class MonitorManagementClientConfiguration(AzureConfiguration):
"""Configuration for MonitorManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(MonitorManagementClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

self.add_user_agent('azure-mgmt-monitor/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import MonitorManagementClientConfiguration
from .operations import ActivityLogAlertsOperations
from . import models


class MonitorManagementClient(SDKClient):
"""Monitor Management Client
:ivar config: Configuration for client.
:vartype config: MonitorManagementClientConfiguration
:ivar activity_log_alerts: ActivityLogAlerts operations
:vartype activity_log_alerts: $(python-base-namespace).v2020_10_01.operations.ActivityLogAlertsOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = MonitorManagementClientConfiguration(credentials, subscription_id, base_url)
super(MonitorManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2020-10-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.activity_log_alerts = ActivityLogAlertsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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.
# --------------------------------------------------------------------------

try:
from ._models_py3 import ActionGroup
from ._models_py3 import ActionList
from ._models_py3 import ActivityLogAlertResource
from ._models_py3 import AlertRuleAllOfCondition
from ._models_py3 import AlertRuleAnyOfOrLeafCondition
from ._models_py3 import AlertRuleLeafCondition
from ._models_py3 import AlertRulePatchObject
from ._models_py3 import AzureResource
from ._models_py3 import ErrorResponse, ErrorResponseException
except (SyntaxError, ImportError):
from ._models import ActionGroup
from ._models import ActionList
from ._models import ActivityLogAlertResource
from ._models import AlertRuleAllOfCondition
from ._models import AlertRuleAnyOfOrLeafCondition
from ._models import AlertRuleLeafCondition
from ._models import AlertRulePatchObject
from ._models import AzureResource
from ._models import ErrorResponse, ErrorResponseException
from ._paged_models import ActivityLogAlertResourcePaged

__all__ = [
'ActionGroup',
'ActionList',
'ActivityLogAlertResource',
'AlertRuleAllOfCondition',
'AlertRuleAnyOfOrLeafCondition',
'AlertRuleLeafCondition',
'AlertRulePatchObject',
'AzureResource',
'ErrorResponse', 'ErrorResponseException',
'ActivityLogAlertResourcePaged',
]
Loading

0 comments on commit 2507604

Please sign in to comment.