Skip to content

Commit

Permalink
CodeGen from PR 19765 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Pattts/predictive autoscale 20221001 (Azure#19765)

* Rev Autoscale API from 2021-05-01-preview to 2022-10-01.

* Fix minor swagger issue. Default should be 'false'

* Fix swagger validation error

* Defining a new package 2022-10

* AutoscaleSettingResource now reference allOf 'resource' which is the actual autoscaleSetting resource definition

* Fix require property issue

* Run prettier against autoscale_API.json
  • Loading branch information
SDKAuto committed Jul 21, 2022
1 parent a8252c6 commit 1e1ed52
Show file tree
Hide file tree
Showing 576 changed files with 28,882 additions and 12,916 deletions.
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.16.0",
"@autorest/[email protected]"
],
"commit": "8174b2fc60e288a9d7fcdff5f9414e43a6ad5989",
"commit": "9ae616c4a5447e9cae43752b68f089bff2e46398",
"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 --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.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 @@ -55,7 +56,7 @@ 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 = '2021-09-01'
DEFAULT_API_VERSION = '2022-06-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -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 @@ -149,6 +149,8 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2021-05-01-preview: :mod:`v2021_05_01_preview.models<azure.mgmt.monitor.v2021_05_01_preview.models>`
* 2021-09-01: :mod:`v2021_09_01.models<azure.mgmt.monitor.v2021_09_01.models>`
* 2021-09-01-preview: :mod:`v2022_02_01_preview.models<azure.mgmt.monitor.v2022_02_01_preview.models>`
* 2022-04-01: :mod:`v2022_04_01.models<azure.mgmt.monitor.v2022_04_01.models>`
* 2022-06-01: :mod:`v2022_06_01.models<azure.mgmt.monitor.v2022_06_01.models>`
"""
if api_version == '2015-04-01':
from .v2015_04_01 import models
Expand Down Expand Up @@ -228,6 +230,12 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2021-09-01-preview':
from .v2022_02_01_preview import models
return models
elif api_version == '2022-04-01':
from .v2022_04_01 import models
return models
elif api_version == '2022-06-01':
from .v2022_06_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand All @@ -240,6 +248,8 @@ def action_groups(self):
* 2019-03-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2019_03_01.operations.ActionGroupsOperations>`
* 2019-06-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2019_06_01.operations.ActionGroupsOperations>`
* 2021-09-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2021_09_01.operations.ActionGroupsOperations>`
* 2022-04-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2022_04_01.operations.ActionGroupsOperations>`
* 2022-06-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2022_06_01.operations.ActionGroupsOperations>`
"""
api_version = self._get_api_version('action_groups')
if api_version == '2017-04-01':
Expand All @@ -254,6 +264,10 @@ def action_groups(self):
from .v2019_06_01.operations import ActionGroupsOperations as OperationClass
elif api_version == '2021-09-01':
from .v2021_09_01.operations import ActionGroupsOperations as OperationClass
elif api_version == '2022-04-01':
from .v2022_04_01.operations import ActionGroupsOperations as OperationClass
elif api_version == '2022-06-01':
from .v2022_06_01.operations import ActionGroupsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'action_groups'".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 @@ -338,19 +352,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 +550,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 @@ -54,7 +55,7 @@ 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 = '2021-09-01'
DEFAULT_API_VERSION = '2022-06-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand All @@ -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 @@ -148,6 +148,8 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2021-05-01-preview: :mod:`v2021_05_01_preview.models<azure.mgmt.monitor.v2021_05_01_preview.models>`
* 2021-09-01: :mod:`v2021_09_01.models<azure.mgmt.monitor.v2021_09_01.models>`
* 2021-09-01-preview: :mod:`v2022_02_01_preview.models<azure.mgmt.monitor.v2022_02_01_preview.models>`
* 2022-04-01: :mod:`v2022_04_01.models<azure.mgmt.monitor.v2022_04_01.models>`
* 2022-06-01: :mod:`v2022_06_01.models<azure.mgmt.monitor.v2022_06_01.models>`
"""
if api_version == '2015-04-01':
from ..v2015_04_01 import models
Expand Down Expand Up @@ -227,6 +229,12 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2021-09-01-preview':
from ..v2022_02_01_preview import models
return models
elif api_version == '2022-04-01':
from ..v2022_04_01 import models
return models
elif api_version == '2022-06-01':
from ..v2022_06_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
Expand All @@ -239,6 +247,8 @@ def action_groups(self):
* 2019-03-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2019_03_01.aio.operations.ActionGroupsOperations>`
* 2019-06-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2019_06_01.aio.operations.ActionGroupsOperations>`
* 2021-09-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2021_09_01.aio.operations.ActionGroupsOperations>`
* 2022-04-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2022_04_01.aio.operations.ActionGroupsOperations>`
* 2022-06-01: :class:`ActionGroupsOperations<azure.mgmt.monitor.v2022_06_01.aio.operations.ActionGroupsOperations>`
"""
api_version = self._get_api_version('action_groups')
if api_version == '2017-04-01':
Expand All @@ -253,6 +263,10 @@ def action_groups(self):
from ..v2019_06_01.aio.operations import ActionGroupsOperations as OperationClass
elif api_version == '2021-09-01':
from ..v2021_09_01.aio.operations import ActionGroupsOperations as OperationClass
elif api_version == '2022-04-01':
from ..v2022_04_01.aio.operations import ActionGroupsOperations as OperationClass
elif api_version == '2022-06-01':
from ..v2022_06_01.aio.operations import ActionGroupsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'action_groups'".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 @@ -337,19 +351,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 +549,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
4 changes: 2 additions & 2 deletions sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
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 *
from .v2020_10_01.models import *
from .v2021_04_01.models import *
from .v2021_05_01_preview.models import *
from .v2021_09_01.models import *
from .v2022_06_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['MonitorManagementClient']
__all__.extend([p for p in _patch_all if p not in __all__])

# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
_patch_sdk()
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
Loading

0 comments on commit 1e1ed52

Please sign in to comment.