Skip to content

Commit

Permalink
CodeGen from PR 14514 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge b102029c8b2cc762d7fb96e53b7d76533a3c76c5 into b0eec0c
  • Loading branch information
SDKAuto committed Jun 1, 2021
1 parent f559b78 commit f759eec
Show file tree
Hide file tree
Showing 275 changed files with 11,633 additions and 2,653 deletions.
1 change: 1 addition & 0 deletions sdk/monitor/azure-mgmt-monitor/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
11 changes: 11 additions & 0 deletions sdk/monitor/azure-mgmt-monitor/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.2",
"use": [
"@autorest/python@5.8.0",
"@autorest/modelerfour@4.19.2"
],
"commit": "e52276c5272edabba89ef46755f3466f76518389",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"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/python@5.8.0 --use=@autorest/modelerfour@4.19.2 --version=3.4.2",
"readme": "specification/monitor/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any
from typing import TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential

class MonitorManagementClientConfiguration(Configuration):
"""Configuration for MonitorManagementClient.
Expand All @@ -25,7 +30,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 @@ -9,13 +9,22 @@
# regenerated.
# --------------------------------------------------------------------------

from azure.mgmt.core import ARMPipelineClient
from msrest import Serializer, Deserializer
from typing import TYPE_CHECKING

from azure.mgmt.core import ARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from msrest import Deserializer, Serializer

from ._configuration import MonitorManagementClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
Expand All @@ -36,42 +45,50 @@ 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.
:param str base_url: Service URL
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
:param base_url: Service URL
:type base_url: str
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
: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 All @@ -85,9 +102,9 @@ def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
api_version=None,
base_url=None,
profile=KnownProfiles.default,
api_version=None, # type: Optional[str]
base_url=None, # type: Optional[str]
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
if not base_url:
Expand Down Expand Up @@ -128,6 +145,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 +210,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 +246,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 +289,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 @@ -8,14 +8,17 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import Any
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from .._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

class MonitorManagementClientConfiguration(Configuration):
"""Configuration for MonitorManagementClient.
Expand All @@ -25,14 +28,14 @@ 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
"""

def __init__(
self,
credential, # type: "AsyncTokenCredential"
subscription_id, # type: str
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs # type: Any
) -> None:
if credential is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@
# regenerated.
# --------------------------------------------------------------------------

from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Serializer, Deserializer
from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from msrest import Deserializer, Serializer

from ._configuration import MonitorManagementClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
Expand All @@ -36,42 +43,50 @@ 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.
:param str base_url: Service URL
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
:param base_url: Service URL
:type base_url: str
:param profile: A profile definition, from KnownProfiles to dict.
:type profile: azure.profiles.KnownProfiles
: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 All @@ -83,11 +98,11 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):

def __init__(
self,
credential, # type: "AsyncTokenCredential"
subscription_id, # type: str
api_version=None,
base_url=None,
profile=KnownProfiles.default,
credential: "AsyncTokenCredential",
subscription_id: str,
api_version: Optional[str] = None,
base_url: Optional[str] = None,
profile: KnownProfiles = KnownProfiles.default,
**kwargs # type: Any
) -> None:
if not base_url:
Expand Down Expand Up @@ -128,6 +143,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 +208,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 +244,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 +287,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 *
Loading

0 comments on commit f759eec

Please sign in to comment.