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

[T2] release monitor 2.0.0 #15921

Merged
merged 1 commit into from
Jan 13, 2021
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions sdk/monitor/azure-mgmt-monitor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 2.0.0 (2020-12-25)

**Breaking changes**

- Client name changed from MonitorClient to MonitorManagementClient

## 1.0.1 (2020-09-18)

**Bug fix**
Expand Down
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_client import MonitorClient
__all__ = ['MonitorClient']
from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']

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


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

Note that all parameters used to create this instance are saved as instance
attributes.
Expand All @@ -40,12 +40,12 @@ 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(MonitorClientConfiguration, self).__init__(**kwargs)
super(MonitorManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'azure-mgmt-monitor/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand Down

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_version.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# 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.
# 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.
# --------------------------------------------------------------------------

VERSION = "1.0.1"
VERSION = "2.0.0"
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_client import MonitorClient
__all__ = ['MonitorClient']
from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from .._version import VERSION


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

Note that all parameters used to create this instance are saved as instance
attributes.
Expand All @@ -39,12 +39,12 @@ 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(MonitorClientConfiguration, self).__init__(**kwargs)
super(MonitorManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'azure-mgmt-monitor/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand Down

Large diffs are not rendered by default.

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_client import MonitorClient
__all__ = ['MonitorClient']
from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']

try:
from ._patch import patch_sdk # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

VERSION = "unknown"

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

Note that all parameters used to create this instance are saved as instance
attributes.
Expand All @@ -43,13 +43,13 @@ 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(MonitorClientConfiguration, self).__init__(**kwargs)
super(MonitorManagementClientConfiguration, 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-eventhub/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,39 @@
"chosen_version": "2015-04-01",
"total_api_version_list": ["2015-04-01"],
"client": {
"name": "MonitorClient",
"filename": "_monitor_client",
"name": "MonitorManagementClient",
"filename": "_monitor_management_client",
"description": "Monitor Management Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false
"has_lro_operations": false,
"client_side_validation": false
},
"global_parameters": {
"sync_method": {
"sync": {
"credential": {
"method_signature": "credential, # type: \"TokenCredential\"",
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"signature": "subscription_id, # type: str",
"description": "The Azure subscription Id.",
"docstring_type": "str",
"required": true
}
},
"async_method": {
"async": {
"credential": {
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential, # type: \"AsyncTokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"signature": "subscription_id, # type: str",
"description": "The Azure subscription Id.",
"docstring_type": "str",
"required": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from azure.core.credentials import TokenCredential

from ._configuration import MonitorClientConfiguration
from ._configuration import MonitorManagementClientConfiguration
from .operations import ActivityLogsOperations
from .operations import AutoscaleSettingsOperations
from .operations import EventCategoriesOperations
Expand All @@ -26,7 +26,7 @@
from . import models


class MonitorClient(object):
class MonitorManagementClient(object):
"""Monitor Management Client.

:ivar activity_logs: ActivityLogsOperations operations
Expand Down Expand Up @@ -56,7 +56,7 @@ def __init__(
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs)
self._config = MonitorManagementClientConfiguration(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)}
Expand All @@ -80,7 +80,7 @@ def close(self):
self._client.close()

def __enter__(self):
# type: () -> MonitorClient
# type: () -> MonitorManagementClient
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_client import MonitorClient
__all__ = ['MonitorClient']
from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient']
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

VERSION = "unknown"

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

Note that all parameters used to create this instance are saved as instance
attributes.
Expand All @@ -40,13 +40,13 @@ 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(MonitorClientConfiguration, self).__init__(**kwargs)
super(MonitorManagementClientConfiguration, 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-eventhub/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import MonitorClientConfiguration
from ._configuration import MonitorManagementClientConfiguration
from .operations import ActivityLogsOperations
from .operations import AutoscaleSettingsOperations
from .operations import EventCategoriesOperations
Expand All @@ -24,7 +24,7 @@
from .. import models


class MonitorClient(object):
class MonitorManagementClient(object):
"""Monitor Management Client.

:ivar activity_logs: ActivityLogsOperations operations
Expand Down Expand Up @@ -53,7 +53,7 @@ def __init__(
) -> None:
if not base_url:
base_url = 'https://management.azure.com'
self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs)
self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
Expand All @@ -75,7 +75,7 @@ def __init__(
async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "MonitorClient":
async def __aenter__(self) -> "MonitorManagementClient":
await self._client.__aenter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -33,7 +33,7 @@ class ActivityLogsOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -46,7 +46,7 @@ def list(
filter: str,
select: Optional[str] = None,
**kwargs
) -> AsyncIterable["models.EventDataCollection"]:
) -> AsyncIterable["_models.EventDataCollection"]:
"""Provides the list of records from the activity logs.
:param filter: Reduces the set of data collected.:code:`<br>`This argument is required and it
Expand Down Expand Up @@ -77,7 +77,7 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.EventDataCollection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.EventDataCollection"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.EventDataCollection"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -125,7 +125,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ErrorResponse, response)
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Loading