Skip to content

Commit

Permalink
CodeGen from PR 12747 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 54c2c16732e50426484e7971de11b11199227eb0 into 6f31fc9
  • Loading branch information
SDKAuto committed Feb 1, 2021
1 parent c91bcda commit 76a08e1
Show file tree
Hide file tree
Showing 279 changed files with 7,186 additions and 1,283 deletions.
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 @@ -47,7 +47,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
"""

DEFAULT_API_VERSION = '2019-10-17-preview'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
_PROFILE_TAG = "azure.mgmt.monitor.MonitorClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
Expand Down Expand Up @@ -92,9 +92,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 @@ -265,10 +265,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 Expand Up @@ -304,10 +310,13 @@ def baseline(self):
def baselines(self):
"""Instance depends on the API version:
* 2018-09-01: :class:`BaselinesOperations<azure.mgmt.monitor.v2018_09_01.operations.BaselinesOperations>`
* 2019-03-01: :class:`BaselinesOperations<azure.mgmt.monitor.v2019_03_01.operations.BaselinesOperations>`
"""
api_version = self._get_api_version('baselines')
if api_version == '2019-03-01':
if api_version == '2018-09-01':
from .v2018_09_01.operations import BaselinesOperations as OperationClass
elif api_version == '2019-03-01':
from .v2019_03_01.operations import BaselinesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'baselines'".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 @@ -47,7 +47,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
"""

DEFAULT_API_VERSION = '2019-10-17-preview'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
_PROFILE_TAG = "azure.mgmt.monitor.MonitorClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
Expand Down Expand Up @@ -92,9 +92,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 @@ -265,10 +265,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 Expand Up @@ -304,10 +310,13 @@ def baseline(self):
def baselines(self):
"""Instance depends on the API version:
* 2018-09-01: :class:`BaselinesOperations<azure.mgmt.monitor.v2018_09_01.aio.operations.BaselinesOperations>`
* 2019-03-01: :class:`BaselinesOperations<azure.mgmt.monitor.v2019_03_01.aio.operations.BaselinesOperations>`
"""
api_version = self._get_api_version('baselines')
if api_version == '2019-03-01':
if api_version == '2018-09-01':
from ..v2018_09_01.aio.operations import BaselinesOperations as OperationClass
elif api_version == '2019-03-01':
from ..v2019_03_01.aio.operations import BaselinesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'baselines'".format(api_version))
Expand Down
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 @@ -20,15 +20,15 @@

VERSION = "unknown"

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 @@ -43,11 +43,10 @@ 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
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,15 +1,15 @@
{
"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",
"name": "MonitorClient",
"filename": "_monitor_client",
"description": "Monitor Management Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"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 @@ -17,16 +17,17 @@

from azure.core.credentials import TokenCredential

from ._configuration import MonitorManagementClientConfiguration
from ._configuration import MonitorClientConfiguration
from .operations import ActivityLogsOperations
from .operations import AutoscaleSettingsOperations
from .operations import EventCategoriesOperations
from .operations import Operations
from .operations import TenantActivityLogsOperations
from .operations import AlertRulesOperations
from . import models


class MonitorManagementClient(object):
class MonitorClient(object):
"""Monitor Management Client.
:ivar activity_logs: ActivityLogsOperations operations
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 @@ -56,12 +59,11 @@ def __init__(
# type: (...) -> 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 = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

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,13 +76,15 @@ 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
self._client.close()

def __enter__(self):
# type: () -> MonitorManagementClient
# type: () -> MonitorClient
self._client.__enter__()
return self

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']
Loading

0 comments on commit 76a08e1

Please sign in to comment.