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] Add new apis for test button feature #85

Closed
wants to merge 1 commit into from
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions sdk/monitor/azure-mgmt-monitor/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.7.2",
"use": [
"@autorest/python@5.12.0",
"@autorest/python@5.13.0",
"@autorest/[email protected]"
],
"commit": "8174b2fc60e288a9d7fcdff5f9414e43a6ad5989",
"commit": "263d3035f12a3d6c7311e24b670cd4125d9ed131",
"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/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected] --version=3.7.2",
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/[email protected] --version=3.7.2",
"readme": "specification/monitor/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

from typing import TYPE_CHECKING

from msrest import Deserializer, Serializer

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

Expand Down Expand Up @@ -65,7 +66,6 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
'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_endpoints': '2021-04-01',
'data_collection_rule_associations': '2021-04-01',
Expand All @@ -79,7 +79,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
'management_group_diagnostic_settings': '2021-05-01-preview',
'metric_alerts': '2018-03-01',
'metric_alerts_status': '2018-03-01',
'metric_baseline': '2018-09-01',
'metric_baseline': '2017-11-01-preview',
'metric_definitions': '2018-01-01',
'metric_namespaces': '2017-12-01-preview',
'metrics': '2018-01-01',
Expand Down Expand Up @@ -338,19 +338,6 @@ def autoscale_settings(self):
raise ValueError("API version {} does not have operation group 'autoscale_settings'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def baseline(self):
"""Instance depends on the API version:

* 2018-09-01: :class:`BaselineOperations<azure.mgmt.monitor.v2018_09_01.operations.BaselineOperations>`
"""
api_version = self._get_api_version('baseline')
if api_version == '2018-09-01':
from .v2018_09_01.operations import BaselineOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'baseline'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def baselines(self):
"""Instance depends on the API version:
Expand Down Expand Up @@ -549,13 +536,10 @@ def metric_baseline(self):
"""Instance depends on the API version:

* 2017-11-01-preview: :class:`MetricBaselineOperations<azure.mgmt.monitor.v2017_11_01_preview.operations.MetricBaselineOperations>`
* 2018-09-01: :class:`MetricBaselineOperations<azure.mgmt.monitor.v2018_09_01.operations.MetricBaselineOperations>`
"""
api_version = self._get_api_version('metric_baseline')
if api_version == '2017-11-01-preview':
from .v2017_11_01_preview.operations import MetricBaselineOperations as OperationClass
elif api_version == '2018-09-01':
from .v2018_09_01.operations import MetricBaselineOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'metric_baseline'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

from typing import Any, Optional, TYPE_CHECKING

from msrest import Deserializer, Serializer

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

Expand Down Expand Up @@ -64,7 +65,6 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
'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_endpoints': '2021-04-01',
'data_collection_rule_associations': '2021-04-01',
Expand All @@ -78,7 +78,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
'management_group_diagnostic_settings': '2021-05-01-preview',
'metric_alerts': '2018-03-01',
'metric_alerts_status': '2018-03-01',
'metric_baseline': '2018-09-01',
'metric_baseline': '2017-11-01-preview',
'metric_definitions': '2018-01-01',
'metric_namespaces': '2017-12-01-preview',
'metrics': '2018-01-01',
Expand Down Expand Up @@ -337,19 +337,6 @@ def autoscale_settings(self):
raise ValueError("API version {} does not have operation group 'autoscale_settings'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def baseline(self):
"""Instance depends on the API version:

* 2018-09-01: :class:`BaselineOperations<azure.mgmt.monitor.v2018_09_01.aio.operations.BaselineOperations>`
"""
api_version = self._get_api_version('baseline')
if api_version == '2018-09-01':
from ..v2018_09_01.aio.operations import BaselineOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'baseline'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def baselines(self):
"""Instance depends on the API version:
Expand Down Expand Up @@ -548,13 +535,10 @@ def metric_baseline(self):
"""Instance depends on the API version:

* 2017-11-01-preview: :class:`MetricBaselineOperations<azure.mgmt.monitor.v2017_11_01_preview.aio.operations.MetricBaselineOperations>`
* 2018-09-01: :class:`MetricBaselineOperations<azure.mgmt.monitor.v2018_09_01.aio.operations.MetricBaselineOperations>`
"""
api_version = self._get_api_version('metric_baseline')
if api_version == '2017-11-01-preview':
from ..v2017_11_01_preview.aio.operations import MetricBaselineOperations as OperationClass
elif api_version == '2018-09-01':
from ..v2018_09_01.aio.operations import MetricBaselineOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'metric_baseline'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
from .v2015_07_01.models import *
from .v2016_03_01.models import *
from .v2016_09_01.models import *
from .v2017_11_01_preview.models import *
from .v2017_12_01_preview.models import *
from .v2018_01_01.models import *
from .v2018_03_01.models import *
from .v2018_04_16.models import *
from .v2018_06_01_preview.models import *
from .v2018_09_01.models import *
from .v2018_11_27_preview.models import *
from .v2019_03_01.models import *
from .v2019_10_17.models import *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from azure.core.credentials import TokenCredential


class MonitorManagementClientConfiguration(Configuration):
class MonitorManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for MonitorManagementClient.

Note that all parameters used to create this instance are saved as instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MonitorManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MonitorManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MonitorManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MonitorManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, Optional, TYPE_CHECKING
from typing import Any, TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer

from . import models
from ._configuration import MonitorManagementClientConfiguration
Expand Down Expand Up @@ -43,7 +44,7 @@ class MonitorManagementClient:
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param base_url: Service URL. Default value is 'https://management.azure.com'.
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
"""

Expand Down Expand Up @@ -71,7 +72,7 @@ def __init__(

def _send_request(
self,
request, # type: HttpRequest
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "3.1.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from azure.core.credentials_async import AsyncTokenCredential


class MonitorManagementClientConfiguration(Configuration):
class MonitorManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for MonitorManagementClient.

Note that all parameters used to create this instance are saved as instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, Awaitable, Optional, TYPE_CHECKING
from typing import Any, Awaitable, TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

from .. import models
from ._configuration import MonitorManagementClientConfiguration
Expand Down Expand Up @@ -44,7 +45,7 @@ class MonitorManagementClient:
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param base_url: Service URL. Default value is 'https://management.azure.com'.
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# pylint: disable=too-many-lines
# 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.
# --------------------------------------------------------------------------
import functools
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models as _models
Expand Down Expand Up @@ -76,14 +74,20 @@ def list(
*authorization*\ , *claims*\ , *correlationId*\ , *description*\ , *eventDataId*\ ,
*eventName*\ , *eventTimestamp*\ , *httpRequest*\ , *level*\ , *operationId*\ ,
*operationName*\ , *properties*\ , *resourceGroupName*\ , *resourceProviderName*\ ,
*resourceId*\ , *status*\ , *submissionTimestamp*\ , *subStatus*\ , *subscriptionId*.
*resourceId*\ , *status*\ , *submissionTimestamp*\ , *subStatus*\ , *subscriptionId*. Default
value is None.
:type select: str
:keyword api_version: Api Version. Default value is "2015-04-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either EventDataCollection or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2015_04_01.models.EventDataCollection]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2015-04-01") # type: str

cls = kwargs.pop('cls', None) # type: ClsType["_models.EventDataCollection"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
Expand All @@ -94,6 +98,7 @@ def prepare_request(next_link=None):

request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
filter=filter,
select=select,
template_url=self.list.metadata['url'],
Expand All @@ -105,6 +110,7 @@ def prepare_request(next_link=None):

request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
filter=filter,
select=select,
template_url=next_link,
Expand All @@ -124,7 +130,11 @@ async def extract_data(pipeline_response):
async def get_next(next_link=None):
request = prepare_request(next_link)

pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
)
response = pipeline_response.http_response

if response.status_code not in [200]:
Expand All @@ -138,4 +148,4 @@ async def get_next(next_link=None):
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/eventtypes/management/values'} # type: ignore
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/eventtypes/management/values"} # type: ignore
Loading