Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_azure-mgmt-monitor] New Microsoft.Insights api version 2021-02-01-preview #4497

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']
from ._monitor_client import MonitorClient
__all__ = ['MonitorClient']

try:
from ._patch import patch_sdk # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
from ._version import VERSION


class MonitorManagementClientConfiguration(Configuration):
"""Configuration for MonitorManagementClient.
class MonitorClientConfiguration(Configuration):
"""Configuration for MonitorClient.

Note that all parameters used to create this instance are saved as instance
attributes.

: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 @@ -40,7 +40,7 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(MonitorManagementClientConfiguration, self).__init__(**kwargs)
super(MonitorClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from ._configuration import MonitorManagementClientConfiguration
from ._configuration import MonitorClientConfiguration

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand All @@ -23,7 +23,7 @@ def __init__(self, *args, **kwargs):
"""
pass

class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
class MonitorClient(MultiApiClientMixin, _SDKClient):
"""Monitor Management Client.

This ready contains multiple API versions, to help you deal with all of the Azure clouds
Expand All @@ -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'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
DEFAULT_API_VERSION = '2020-10-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorClient"
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 All @@ -92,9 +99,9 @@ def __init__(
):
if not base_url:
base_url = 'https://management.azure.com'
self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs)
self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(MonitorManagementClient, self).__init__(
super(MonitorClient, self).__init__(
api_version=api_version,
profile=profile
)
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 @@ -6,5 +6,5 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']
from ._monitor_client import MonitorClient
__all__ = ['MonitorClient']
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
from .._version import VERSION


class MonitorManagementClientConfiguration(Configuration):
"""Configuration for MonitorManagementClient.
class MonitorClientConfiguration(Configuration):
"""Configuration for MonitorClient.

Note that all parameters used to create this instance are saved as instance
attributes.

: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 @@ -39,7 +39,7 @@ def __init__(
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(MonitorManagementClientConfiguration, self).__init__(**kwargs)
super(MonitorClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from ._configuration import MonitorManagementClientConfiguration
from ._configuration import MonitorClientConfiguration

class _SDKClient(object):
def __init__(self, *args, **kwargs):
Expand All @@ -23,7 +23,7 @@ def __init__(self, *args, **kwargs):
"""
pass

class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
class MonitorClient(MultiApiClientMixin, _SDKClient):
"""Monitor Management Client.

This ready contains multiple API versions, to help you deal with all of the Azure clouds
Expand All @@ -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'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
DEFAULT_API_VERSION = '2020-10-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorClient"
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 All @@ -92,9 +99,9 @@ def __init__(
) -> None:
if not base_url:
base_url = 'https://management.azure.com'
self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs)
self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
super(MonitorManagementClient, self).__init__(
super(MonitorClient, self).__init__(
api_version=api_version,
profile=profile
)
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 @@ -6,8 +6,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']
from ._monitor_client import MonitorClient
__all__ = ['MonitorClient']

try:
from ._patch import patch_sdk # type: ignore
Expand Down
Loading