Skip to content

Commit

Permalink
CodeGen from PR 18065 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Update readme.go.md (Azure#18065)

* Update readme.go.md

Enable 2021-05-01-preview diagnostic setting api for Go

* Added 2202-03 tag and update go file

* Add output folder

* Add 'package-2022-03' to directives condition

* Update package-2022-03 resources (DCR, DCRA, DCE)

* Set Monitor to package-2022-03

* Split packages 1

* Split packages 1 (fix on go output folder)

* Split packages second attempt

* Split packages third attempt

* Split packages four attempt

* Split packages fifth attempt

* Fix folders

* fixing go output folder

* fix

* test

* namespace

* fix namespace

Co-authored-by: ArcturusZhang <[email protected]>
Co-authored-by: Jorge Herrera <[email protected]>
Co-authored-by: Jorge Herrera <[email protected]>
  • Loading branch information
4 people committed Mar 30, 2022
1 parent 51c5ade commit 877c015
Show file tree
Hide file tree
Showing 295 changed files with 818 additions and 3,568 deletions.
4 changes: 2 additions & 2 deletions sdk/monitor/azure-mgmt-monitor/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "8174b2fc60e288a9d7fcdff5f9414e43a6ad5989",
"commit": "83f6c7b9ac240d3862e909245f0a61d70ae33908",
"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/[email protected] --use=@autorest/[email protected] --version=3.7.2",
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
"readme": "specification/monitor/resource-manager/readme.md"
}
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 @@ -22,8 +22,8 @@

from azure.core.credentials import TokenCredential

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.
Expand All @@ -45,7 +45,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 @@ -16,7 +16,7 @@
from azure.profiles.multiapiclient import MultiApiClientMixin
from msrest import Deserializer, Serializer

from ._configuration import MonitorManagementClientConfiguration
from ._configuration import MonitorClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
Expand All @@ -31,7 +31,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 @@ -56,7 +56,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
"""

DEFAULT_API_VERSION = '2021-09-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
_PROFILE_TAG = "azure.mgmt.monitor.MonitorClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
Expand All @@ -65,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 @@ -79,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 @@ -108,9 +107,9 @@ def __init__(
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
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 @@ -338,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.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 +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.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 @@ -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 @@ -20,8 +20,8 @@
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

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.
Expand All @@ -42,7 +42,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 @@ -16,7 +16,7 @@
from azure.profiles.multiapiclient import MultiApiClientMixin
from msrest import Deserializer, Serializer

from ._configuration import MonitorManagementClientConfiguration
from ._configuration import MonitorClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
Expand All @@ -30,7 +30,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 @@ -55,7 +55,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient):
"""

DEFAULT_API_VERSION = '2021-09-01'
_PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient"
_PROFILE_TAG = "azure.mgmt.monitor.MonitorClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
None: DEFAULT_API_VERSION,
Expand All @@ -64,7 +64,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 +77,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 @@ -107,9 +106,9 @@ def __init__(
profile: KnownProfiles = KnownProfiles.default,
**kwargs # type: Any
) -> None:
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 @@ -337,19 +336,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 +534,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 @@ -6,11 +6,11 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._monitor_management_client import MonitorManagementClient
from ._monitor_client import MonitorClient
from ._version import VERSION

__version__ = VERSION
__all__ = ['MonitorManagementClient']
__all__ = ['MonitorClient']

# `._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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from azure.core.credentials import TokenCredential


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.
Expand All @@ -37,7 +37,7 @@ def __init__(
subscription_id: str,
**kwargs: Any
) -> None:
super(MonitorManagementClientConfiguration, self).__init__(**kwargs)
super(MonitorClientConfiguration, self).__init__(**kwargs)
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"chosen_version": "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.",
"host_value": "\"https://management.azure.com\"",
"parameterized_host_template": null,
"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\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"MonitorClientConfiguration\"]}}, \"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\": [\"MonitorClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
from msrest import Deserializer, Serializer

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

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

class MonitorManagementClient:
class MonitorClient:
"""Monitor Management Client.
:ivar activity_logs: ActivityLogsOperations operations
Expand Down Expand Up @@ -54,7 +54,7 @@ def __init__(
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = MonitorManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._config = MonitorClientConfiguration(credential=credential, subscription_id=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 Down Expand Up @@ -100,7 +100,7 @@ def close(self):
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,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 @@ -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']

# `._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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from azure.core.credentials_async import AsyncTokenCredential


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.
Expand All @@ -37,7 +37,7 @@ def __init__(
subscription_id: str,
**kwargs: Any
) -> None:
super(MonitorManagementClientConfiguration, self).__init__(**kwargs)
super(MonitorClientConfiguration, self).__init__(**kwargs)
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
Expand Down
Loading

0 comments on commit 877c015

Please sign in to comment.